Loading INAF.Apps.Uwp.SLabDataManager.sln +21 −21 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "INAF.Libraries.Uwp.RemoteAu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "INAF.Libraries.NetStandard.SLabCommonModels", "..\..\Libraries\NetStandard\INAF.Libraries.NetStandard.SLabCommonModels\INAF.Libraries.NetStandard.SLabCommonModels\INAF.Libraries.NetStandard.SLabCommonModels.csproj", "{E02E4913-486E-4EFA-9057-B8936ADB2AD0}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "INAF.Libraries.NetStandard.AlgLib", "..\..\Libraries\NetStandard\INAF.Libraries.NetStandard.AlgLib\INAF.Libraries.NetStandard.AlgLib\INAF.Libraries.NetStandard.AlgLib.csproj", "{1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "INAF.Libraries.NetStandard.Math", "..\..\Libraries\NetStandard\INAF.Libraries.NetStandard.Math\INAF.Libraries.NetStandard.Math\INAF.Libraries.NetStandard.Math.csproj", "{B3B6C5D4-35FF-46D2-A56C-829E10569601}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Loading Loading @@ -289,26 +289,26 @@ Global {E02E4913-486E-4EFA-9057-B8936ADB2AD0}.Release|x64.Build.0 = Release|Any CPU {E02E4913-486E-4EFA-9057-B8936ADB2AD0}.Release|x86.ActiveCfg = Release|Any CPU {E02E4913-486E-4EFA-9057-B8936ADB2AD0}.Release|x86.Build.0 = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|Any CPU.Build.0 = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|ARM.ActiveCfg = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|ARM.Build.0 = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|ARM64.ActiveCfg = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|ARM64.Build.0 = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|x64.ActiveCfg = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|x64.Build.0 = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|x86.ActiveCfg = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|x86.Build.0 = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|Any CPU.ActiveCfg = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|Any CPU.Build.0 = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|ARM.ActiveCfg = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|ARM.Build.0 = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|ARM64.ActiveCfg = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|ARM64.Build.0 = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|x64.ActiveCfg = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|x64.Build.0 = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|x86.ActiveCfg = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|x86.Build.0 = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|Any CPU.Build.0 = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|ARM.ActiveCfg = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|ARM.Build.0 = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|ARM64.ActiveCfg = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|ARM64.Build.0 = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|x64.ActiveCfg = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|x64.Build.0 = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|x86.ActiveCfg = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|x86.Build.0 = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|Any CPU.ActiveCfg = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|Any CPU.Build.0 = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|ARM.ActiveCfg = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|ARM.Build.0 = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|ARM64.ActiveCfg = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|ARM64.Build.0 = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|x64.ActiveCfg = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|x64.Build.0 = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|x86.ActiveCfg = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Loading INAF.Apps.Uwp.SLabDataManager/App.xaml.cs +9 −2 Original line number Diff line number Diff line Loading @@ -4,12 +4,15 @@ using INAF.Apps.Uwp.SLabDataManager.Charts.Containers; using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Helpers.RemoteOperations; using INAF.Apps.Uwp.SLabDataManager.Helpers.UI.Chart; using INAF.Apps.Uwp.SLabDataManager.Helpers.UI.Chart.ProcessingHelpers; using INAF.Apps.Uwp.SLabDataManager.Helpers.XmlReaders; using INAF.Apps.Uwp.SLabDataManager.Models; using INAF.Apps.Uwp.SLabDataManager.Models.Fit; using INAF.Apps.Uwp.SLabDataManager.Models.Spectrum; using INAF.Apps.Uwp.SLabDataManager.Services; using INAF.Apps.Uwp.SLabDataManager.ViewModels; using INAF.Libraries.NetStandard.AlgLib; using INAF.Libraries.NetStandard.Math.Fit.Linear; using INAF.Libraries.NetStandard.Math.Fit.Spline; using INAF.Libraries.Uwp.Logging; using INAF.Libraries.Uwp.RemoteAuthentication; using INAF.Libraries.Uwp.Settings; Loading Loading @@ -115,12 +118,12 @@ namespace INAF.Apps.Uwp.SLabDataManager /* singletons */ .AddSingleton<ChartAnnotationsHelper>() .AddSingleton<ContinuumSpectraContainer>() .AddSingleton<CustomLinesAnnotationsRepository>() .AddSingleton<FitMethodsContainer>() .AddSingleton<Logger>(logger) .AddSingleton<RecentFilesHelper>() .AddSingleton<RemoteOperationsRepository>() .AddSingleton<SecondaryWindowHelper>() .AddSingleton<SegmentsFitModelContainer>() .AddSingleton<SelectedRefBand>() .AddSingleton<SettingsHelper>() .AddSingleton<SpectraContainer>() Loading @@ -135,9 +138,13 @@ namespace INAF.Apps.Uwp.SLabDataManager .AddTransient<AuthenticationManager>() .AddTransient<ConfigReader>() .AddTransient<FitFunctionsReader>() .AddTransient<LinearFitHelper>() .AddTransient<LinearProcessingHelper>() .AddTransient<SplineProcessingHelper>() .AddTransient<RemoteOperationsHelper>() .AddTransient<RemoteOperationsManager>() .AddTransient<RemoteOperationsXmlReader>() .AddTransient<SegmentFitModelsFactory>() .AddTransient<SpectrumModelFactory>() .AddTransient<SpectrumProcessingHelper>() .AddTransient<SpectrumReader>() Loading INAF.Apps.Uwp.SLabDataManager/Assets/xml/fitfunctions.xml +7 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8" ?> <functions> <function name="Straight line"> <helperClass>LinearFitHelper</helperClass> <methodName>buildSpline1DFitInterpolant</methodName> </function> <function name="Linear spline"> <helperClass>SplineFitHelper</helperClass> <methodName>buildSpline1DFitInterpolant</methodName> <parameter name="Regularization constant"> <default>0.0001</default> Loading @@ -10,6 +15,7 @@ <explanation>"Param:Regularization constant passed by user;Meaning:Value must be >= 0"</explanation> </function> <function name="Cubic spline"> <helperClass>SplineFitHelper</helperClass> <methodName>buildSpline1DFitCubicInterpolant</methodName> <parameter name="Number of basis functions"> <default>4</default> Loading @@ -19,6 +25,7 @@ <explanation>"Param:Number of basis functions;Meaning:Value must be >= 4"</explanation> </function> <function name="Hermite spline"> <helperClass>SplineFitHelper</helperClass> <methodName>buildSpline1DFitHermiteInterpolant</methodName> <parameter name="Number of basis functions"> <default>4</default> Loading INAF.Apps.Uwp.SLabDataManager/Charts/Containers/SpectraContainer.cs +11 −4 Original line number Diff line number Diff line using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Models; using INAF.Apps.Uwp.SLabDataManager.Models; using INAF.Libraries.Uwp.Logging; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; Loading Loading @@ -57,13 +55,22 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts.Containers spectrum.PropertyChanged += Spectrum_PropertyChanged; } public SpectrumModel cloneSpectrum(SpectrumType srcType, SpectrumType destType) public SpectrumModel getClonedEmptySpectrum(SpectrumType srcType, SpectrumType destType) { SpectrumModel clonedSpectrum = getClonedSpectrum(srcType, destType); clonedSpectrum.clear(); return clonedSpectrum; } public SpectrumModel getClonedSpectrum(SpectrumType srcType, SpectrumType destType) { if (!isAnySpectrumOfType(srcType)) return null; SpectrumModel clonedSpectrum = (SpectrumModel)tryGetSpectrumOfType(srcType).Clone(); clonedSpectrum.setType(destType); clonedSpectrum.setColor(); clonedSpectrum.updateTitle(); return clonedSpectrum; } Loading INAF.Apps.Uwp.SLabDataManager/Converters/Converters.cs +53 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,8 @@ using INAF.Apps.Uwp.SLabDataManager.Charts.Containers; using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Models; using INAF.Apps.Uwp.SLabDataManager.Models.Fit; using INAF.Apps.Uwp.SLabDataManager.Models.Fit.Parameters; using INAF.Libraries.NetStandard.Extensions; using INAF.Libraries.NetStandard.ScienceModels.Extensions; using Microsoft.Toolkit.Mvvm.DependencyInjection; Loading Loading @@ -124,6 +126,34 @@ namespace INAF.Apps.Uwp.SLabDataManager.Converters } } public sealed class ParameterConstraintVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { try { if (value == null ) return Visibility.Collapsed; ParameterConstraintModel parameterConstraint = (ParameterConstraintModel)value; if (parameterConstraint != null) return Visibility.Visible; else return Visibility.Collapsed; } catch (Exception) { return Visibility.Collapsed; } } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } public sealed class ShortFilepathConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) Loading Loading @@ -249,6 +279,29 @@ namespace INAF.Apps.Uwp.SLabDataManager.Converters } } public sealed class WidthWithParameterConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { try { double width = (double)value; double offset = System.Convert.ToDouble(parameter); return width - offset; } 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 Loading
INAF.Apps.Uwp.SLabDataManager.sln +21 −21 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "INAF.Libraries.Uwp.RemoteAu EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "INAF.Libraries.NetStandard.SLabCommonModels", "..\..\Libraries\NetStandard\INAF.Libraries.NetStandard.SLabCommonModels\INAF.Libraries.NetStandard.SLabCommonModels\INAF.Libraries.NetStandard.SLabCommonModels.csproj", "{E02E4913-486E-4EFA-9057-B8936ADB2AD0}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "INAF.Libraries.NetStandard.AlgLib", "..\..\Libraries\NetStandard\INAF.Libraries.NetStandard.AlgLib\INAF.Libraries.NetStandard.AlgLib\INAF.Libraries.NetStandard.AlgLib.csproj", "{1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "INAF.Libraries.NetStandard.Math", "..\..\Libraries\NetStandard\INAF.Libraries.NetStandard.Math\INAF.Libraries.NetStandard.Math\INAF.Libraries.NetStandard.Math.csproj", "{B3B6C5D4-35FF-46D2-A56C-829E10569601}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Loading Loading @@ -289,26 +289,26 @@ Global {E02E4913-486E-4EFA-9057-B8936ADB2AD0}.Release|x64.Build.0 = Release|Any CPU {E02E4913-486E-4EFA-9057-B8936ADB2AD0}.Release|x86.ActiveCfg = Release|Any CPU {E02E4913-486E-4EFA-9057-B8936ADB2AD0}.Release|x86.Build.0 = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|Any CPU.Build.0 = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|ARM.ActiveCfg = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|ARM.Build.0 = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|ARM64.ActiveCfg = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|ARM64.Build.0 = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|x64.ActiveCfg = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|x64.Build.0 = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|x86.ActiveCfg = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Debug|x86.Build.0 = Debug|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|Any CPU.ActiveCfg = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|Any CPU.Build.0 = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|ARM.ActiveCfg = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|ARM.Build.0 = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|ARM64.ActiveCfg = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|ARM64.Build.0 = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|x64.ActiveCfg = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|x64.Build.0 = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|x86.ActiveCfg = Release|Any CPU {1BA32F86-A1B8-4DE2-83A0-E75DA27355F3}.Release|x86.Build.0 = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|Any CPU.Build.0 = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|ARM.ActiveCfg = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|ARM.Build.0 = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|ARM64.ActiveCfg = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|ARM64.Build.0 = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|x64.ActiveCfg = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|x64.Build.0 = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|x86.ActiveCfg = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Debug|x86.Build.0 = Debug|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|Any CPU.ActiveCfg = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|Any CPU.Build.0 = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|ARM.ActiveCfg = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|ARM.Build.0 = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|ARM64.ActiveCfg = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|ARM64.Build.0 = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|x64.ActiveCfg = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|x64.Build.0 = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|x86.ActiveCfg = Release|Any CPU {B3B6C5D4-35FF-46D2-A56C-829E10569601}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Loading
INAF.Apps.Uwp.SLabDataManager/App.xaml.cs +9 −2 Original line number Diff line number Diff line Loading @@ -4,12 +4,15 @@ using INAF.Apps.Uwp.SLabDataManager.Charts.Containers; using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Helpers.RemoteOperations; using INAF.Apps.Uwp.SLabDataManager.Helpers.UI.Chart; using INAF.Apps.Uwp.SLabDataManager.Helpers.UI.Chart.ProcessingHelpers; using INAF.Apps.Uwp.SLabDataManager.Helpers.XmlReaders; using INAF.Apps.Uwp.SLabDataManager.Models; using INAF.Apps.Uwp.SLabDataManager.Models.Fit; using INAF.Apps.Uwp.SLabDataManager.Models.Spectrum; using INAF.Apps.Uwp.SLabDataManager.Services; using INAF.Apps.Uwp.SLabDataManager.ViewModels; using INAF.Libraries.NetStandard.AlgLib; using INAF.Libraries.NetStandard.Math.Fit.Linear; using INAF.Libraries.NetStandard.Math.Fit.Spline; using INAF.Libraries.Uwp.Logging; using INAF.Libraries.Uwp.RemoteAuthentication; using INAF.Libraries.Uwp.Settings; Loading Loading @@ -115,12 +118,12 @@ namespace INAF.Apps.Uwp.SLabDataManager /* singletons */ .AddSingleton<ChartAnnotationsHelper>() .AddSingleton<ContinuumSpectraContainer>() .AddSingleton<CustomLinesAnnotationsRepository>() .AddSingleton<FitMethodsContainer>() .AddSingleton<Logger>(logger) .AddSingleton<RecentFilesHelper>() .AddSingleton<RemoteOperationsRepository>() .AddSingleton<SecondaryWindowHelper>() .AddSingleton<SegmentsFitModelContainer>() .AddSingleton<SelectedRefBand>() .AddSingleton<SettingsHelper>() .AddSingleton<SpectraContainer>() Loading @@ -135,9 +138,13 @@ namespace INAF.Apps.Uwp.SLabDataManager .AddTransient<AuthenticationManager>() .AddTransient<ConfigReader>() .AddTransient<FitFunctionsReader>() .AddTransient<LinearFitHelper>() .AddTransient<LinearProcessingHelper>() .AddTransient<SplineProcessingHelper>() .AddTransient<RemoteOperationsHelper>() .AddTransient<RemoteOperationsManager>() .AddTransient<RemoteOperationsXmlReader>() .AddTransient<SegmentFitModelsFactory>() .AddTransient<SpectrumModelFactory>() .AddTransient<SpectrumProcessingHelper>() .AddTransient<SpectrumReader>() Loading
INAF.Apps.Uwp.SLabDataManager/Assets/xml/fitfunctions.xml +7 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8" ?> <functions> <function name="Straight line"> <helperClass>LinearFitHelper</helperClass> <methodName>buildSpline1DFitInterpolant</methodName> </function> <function name="Linear spline"> <helperClass>SplineFitHelper</helperClass> <methodName>buildSpline1DFitInterpolant</methodName> <parameter name="Regularization constant"> <default>0.0001</default> Loading @@ -10,6 +15,7 @@ <explanation>"Param:Regularization constant passed by user;Meaning:Value must be >= 0"</explanation> </function> <function name="Cubic spline"> <helperClass>SplineFitHelper</helperClass> <methodName>buildSpline1DFitCubicInterpolant</methodName> <parameter name="Number of basis functions"> <default>4</default> Loading @@ -19,6 +25,7 @@ <explanation>"Param:Number of basis functions;Meaning:Value must be >= 4"</explanation> </function> <function name="Hermite spline"> <helperClass>SplineFitHelper</helperClass> <methodName>buildSpline1DFitHermiteInterpolant</methodName> <parameter name="Number of basis functions"> <default>4</default> Loading
INAF.Apps.Uwp.SLabDataManager/Charts/Containers/SpectraContainer.cs +11 −4 Original line number Diff line number Diff line using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Models; using INAF.Apps.Uwp.SLabDataManager.Models; using INAF.Libraries.Uwp.Logging; using Microsoft.Extensions.DependencyInjection; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading.Tasks; Loading Loading @@ -57,13 +55,22 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts.Containers spectrum.PropertyChanged += Spectrum_PropertyChanged; } public SpectrumModel cloneSpectrum(SpectrumType srcType, SpectrumType destType) public SpectrumModel getClonedEmptySpectrum(SpectrumType srcType, SpectrumType destType) { SpectrumModel clonedSpectrum = getClonedSpectrum(srcType, destType); clonedSpectrum.clear(); return clonedSpectrum; } public SpectrumModel getClonedSpectrum(SpectrumType srcType, SpectrumType destType) { if (!isAnySpectrumOfType(srcType)) return null; SpectrumModel clonedSpectrum = (SpectrumModel)tryGetSpectrumOfType(srcType).Clone(); clonedSpectrum.setType(destType); clonedSpectrum.setColor(); clonedSpectrum.updateTitle(); return clonedSpectrum; } Loading
INAF.Apps.Uwp.SLabDataManager/Converters/Converters.cs +53 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,8 @@ using INAF.Apps.Uwp.SLabDataManager.Charts.Containers; using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Models; using INAF.Apps.Uwp.SLabDataManager.Models.Fit; using INAF.Apps.Uwp.SLabDataManager.Models.Fit.Parameters; using INAF.Libraries.NetStandard.Extensions; using INAF.Libraries.NetStandard.ScienceModels.Extensions; using Microsoft.Toolkit.Mvvm.DependencyInjection; Loading Loading @@ -124,6 +126,34 @@ namespace INAF.Apps.Uwp.SLabDataManager.Converters } } public sealed class ParameterConstraintVisibilityConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { try { if (value == null ) return Visibility.Collapsed; ParameterConstraintModel parameterConstraint = (ParameterConstraintModel)value; if (parameterConstraint != null) return Visibility.Visible; else return Visibility.Collapsed; } catch (Exception) { return Visibility.Collapsed; } } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } public sealed class ShortFilepathConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) Loading Loading @@ -249,6 +279,29 @@ namespace INAF.Apps.Uwp.SLabDataManager.Converters } } public sealed class WidthWithParameterConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { try { double width = (double)value; double offset = System.Convert.ToDouble(parameter); return width - offset; } 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