Commit 8cd949d2 authored by Francesco Carraro's avatar Francesco Carraro
Browse files

working on alignment options...

parent 7e92caa8
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "INAF.Libraries.Uwp.Converte
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "INAF.Libraries.Uwp.TelerikChartsExtensions", "..\..\Libraries\Uwp\INAF.Libraries.Uwp.TelerikChartsExtensions\INAF.Libraries.Uwp.TelerikChartsExtensions\INAF.Libraries.Uwp.TelerikChartsExtensions.csproj", "{BB43C3BA-3085-4D81-9733-2BF398EAA6CF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "INAF.Libraries.Uwp.Xml", "..\..\Libraries\Uwp\INAF.Libraries.Uwp.Xml\INAF.Libraries.Uwp.Xml\INAF.Libraries.Uwp.Xml.csproj", "{D9886C08-77CA-49A7-B55C-37613771079B}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
@@ -221,6 +223,26 @@ Global
		{BB43C3BA-3085-4D81-9733-2BF398EAA6CF}.Release|x64.Build.0 = Release|x64
		{BB43C3BA-3085-4D81-9733-2BF398EAA6CF}.Release|x86.ActiveCfg = Release|x86
		{BB43C3BA-3085-4D81-9733-2BF398EAA6CF}.Release|x86.Build.0 = Release|x86
		{D9886C08-77CA-49A7-B55C-37613771079B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{D9886C08-77CA-49A7-B55C-37613771079B}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{D9886C08-77CA-49A7-B55C-37613771079B}.Debug|ARM.ActiveCfg = Debug|ARM
		{D9886C08-77CA-49A7-B55C-37613771079B}.Debug|ARM.Build.0 = Debug|ARM
		{D9886C08-77CA-49A7-B55C-37613771079B}.Debug|ARM64.ActiveCfg = Debug|ARM64
		{D9886C08-77CA-49A7-B55C-37613771079B}.Debug|ARM64.Build.0 = Debug|ARM64
		{D9886C08-77CA-49A7-B55C-37613771079B}.Debug|x64.ActiveCfg = Debug|x64
		{D9886C08-77CA-49A7-B55C-37613771079B}.Debug|x64.Build.0 = Debug|x64
		{D9886C08-77CA-49A7-B55C-37613771079B}.Debug|x86.ActiveCfg = Debug|x86
		{D9886C08-77CA-49A7-B55C-37613771079B}.Debug|x86.Build.0 = Debug|x86
		{D9886C08-77CA-49A7-B55C-37613771079B}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{D9886C08-77CA-49A7-B55C-37613771079B}.Release|Any CPU.Build.0 = Release|Any CPU
		{D9886C08-77CA-49A7-B55C-37613771079B}.Release|ARM.ActiveCfg = Release|ARM
		{D9886C08-77CA-49A7-B55C-37613771079B}.Release|ARM.Build.0 = Release|ARM
		{D9886C08-77CA-49A7-B55C-37613771079B}.Release|ARM64.ActiveCfg = Release|ARM64
		{D9886C08-77CA-49A7-B55C-37613771079B}.Release|ARM64.Build.0 = Release|ARM64
		{D9886C08-77CA-49A7-B55C-37613771079B}.Release|x64.ActiveCfg = Release|x64
		{D9886C08-77CA-49A7-B55C-37613771079B}.Release|x64.Build.0 = Release|x64
		{D9886C08-77CA-49A7-B55C-37613771079B}.Release|x86.ActiveCfg = Release|x86
		{D9886C08-77CA-49A7-B55C-37613771079B}.Release|x86.Build.0 = Release|x86
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
+7 −0
Original line number Diff line number Diff line
using INAF.Apps.Uwp.Charts;
using INAF.Apps.Uwp.SLabDataManager.Helpers;
using INAF.Apps.Uwp.SLabDataManager.Helpers.ConfigHelpers;
using INAF.Apps.Uwp.SLabDataManager.Models;
using INAF.Apps.Uwp.SLabDataManager.Services;
using INAF.Apps.Uwp.SLabDataManager.ViewModels;
using INAF.Libraries.Uwp.Logging;
using INAF.Libraries.Uwp.Settings;
using INAF.Libraries.Uwp.StorageItemsAccess;
using INAF.Libraries.Uwp.Xml;
using Microsoft.AppCenter;
using Microsoft.AppCenter.Analytics;
using Microsoft.AppCenter.Crashes;
@@ -77,6 +79,7 @@ namespace INAF.Apps.Uwp.SLabDataManager
            Ioc.Default.ConfigureServices(
                new ServiceCollection()
                /* singletons */
                .AddSingleton<AlignmentConfigModel>()
                .AddSingleton<SpectrumChartOptionsModel>()
                .AddSingleton<Logger>(logger)
                .AddSingleton<SettingsHelper>()
@@ -84,6 +87,10 @@ namespace INAF.Apps.Uwp.SLabDataManager
                .AddSingleton<StorageItemsAccessHelper>()
                .AddSingleton<UpdateUIHelper>()
                .AddSingleton<WorkingItemsModel>()
                /* transient */
                .AddTransient<ConfigReader>()
                .AddTransient<SpectrumReader>()
                .AddTransient<XmlHelper>()
                /* view models */
                .AddTransient<ChartViewModel>()
                .AddSingleton<MainViewModel>()
+11 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8" ?>
<config>
	<spectrumAlignment>
		<separators>
			<wavelength>350</wavelength>
			<wavelength>1000</wavelength>
			<wavelength>1800</wavelength>
			<wavelength>2500</wavelength>
		</separators>
	</spectrumAlignment>
</config>
+5 −5
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ namespace INAF.Apps.Uwp.Charts
        public List<GridLineVisibility> MajorLinesVisibilityValues
        {
            get { return majorLinesVisibilityValues; }
            set { majorLinesVisibilityValues = value; RaisePropertyChanged(nameof(MajorLinesVisibilityValues)); }
            private set { majorLinesVisibilityValues = value; RaisePropertyChanged(nameof(MajorLinesVisibilityValues)); }
        }

        private GridLineVisibility selectedMajorLinesVisibility;
@@ -89,14 +89,14 @@ namespace INAF.Apps.Uwp.Charts
        public GridLineVisibility SelectedStripLinesVisibility
        {
            get { return selectedStripLinesVisibility; }
            private set { selectedStripLinesVisibility = value; saveStripLinesVisibility(value); RaisePropertyChanged(nameof(SelectedStripLinesVisibility)); }
            set { selectedStripLinesVisibility = value; saveStripLinesVisibility(value); RaisePropertyChanged(nameof(SelectedStripLinesVisibility)); }
        }

        private List<GridLineVisibility> stripLinesVisibilityValues;
        public List<GridLineVisibility> StripLinesVisibilityValues
        {
            get { return stripLinesVisibilityValues; }
            set { stripLinesVisibilityValues = value; RaisePropertyChanged(nameof(StripLinesVisibilityValues)); }
            private set { stripLinesVisibilityValues = value; RaisePropertyChanged(nameof(StripLinesVisibilityValues)); }
        }

        public bool tryReadStripLinesVisibility()
@@ -194,10 +194,10 @@ namespace INAF.Apps.Uwp.Charts
        public WavelengthMeasureUnit SelectedWavelengthMeasureUnit
        {
            get { return selectedWavelengthMeasureUnit; }
           private  set { selectedWavelengthMeasureUnit = value; saveWavelengthMeasureUnits(value); switchXAxisValues(); RaisePropertyChanged(nameof(SelectedWavelengthMeasureUnit)); }
            set { selectedWavelengthMeasureUnit = value; saveWavelengthMeasureUnits(value); switchXAxisValues(); RaisePropertyChanged(nameof(SelectedWavelengthMeasureUnit)); }
        }

        public List<WavelengthMeasureUnit> WavelengthMeasureUnits { get; set; }
        public List<WavelengthMeasureUnit> WavelengthMeasureUnits { get; private set; }

        public bool tryReadWavelengthMeasureUnits()
        {
+22 −0
Original line number Diff line number Diff line
@@ -167,6 +167,28 @@ namespace INAF.Apps.Uwp.SLabDataManager.Converters
        }
    }

    public sealed class WidthConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
        {
            try
            {
                double width = (double)value;

                return width - 60;
            }
            catch (Exception)
            {
                return 0;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, string language)
        {
            throw new NotImplementedException();
        }
    }

    public sealed class XAxisTitleConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, string language)
Loading