Loading INAF.Apps.Uwp.SLabDataManager/Assets/xml/remoteoperations.xml +1 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,6 @@ <operation type="Authentication">Account/LoginForJwt</operation> <operation type="SaveAlignedFile">AppSpectraFilesActions/SaveAlignedSpectrum</operation> <operation type="SaveFileOfType">AppSpectraFilesActions/SaveSpectrumOfType</operation> <operation type="IsSavedOnCloud">AppSpectraFilesActions/IsSavedOnCloud</operation> <operation type="IsSavedOnCloud">AppSpectraFilesActions/IsSpectrumSavedOnCloud</operation> </operationUrls> </remoteOperationsData> No newline at end of file INAF.Apps.Uwp.SLabDataManager/Charts/SpectraContainer.cs +9 −9 Original line number Diff line number Diff line Loading @@ -249,7 +249,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts spectrum.PropertyChanged += Spectrum_PropertyChanged; } public INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel tryGetSpectrumOfType(SpectrumType spectrumType) public SpectrumModel tryGetSpectrumOfType(SpectrumType spectrumType) { return Spectra.FirstOrDefault(x => x.Type == spectrumType); } Loading Loading @@ -333,7 +333,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts IsError = false; ErrorMessage = string.Empty; INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel aligningSpectrum = null; SpectrumModel aligningSpectrum = null; string exMsg = string.Empty; await Task.Run(() => Loading @@ -342,11 +342,11 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts { aligningSpectrum = createAligningSpectrum(); var refSpectrum = tryGetSpectrumOfType(SpectrumType.Ref); if (refSpectrum != null) var refWhiteSpectrum = tryGetSpectrumOfType(SpectrumType.RefWhite); if (refWhiteSpectrum != null) { multiplyByRef(ref aligningSpectrum, refSpectrum); refWhiteSpectrum); } /* retrieve the reference segment and calculate the mean values at the borders of the segment for aligning other segments */ Loading Loading @@ -385,7 +385,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts } } private void alignLeftSide(ref INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel aligningSpectrum, private void alignLeftSide(ref SpectrumModel aligningSpectrum, WavelengthModel refLowSeparator, double refSegmentLeftMean) { Loading @@ -408,7 +408,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts } } private void alignRightSide(ref INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel aligningSpectrum, private void alignRightSide(ref SpectrumModel aligningSpectrum, WavelengthModel refHighSeparator, double refSegmentRightMean) { Loading @@ -428,8 +428,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts } } private void multiplyByRef(ref INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel aligningSpectrum, INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel refSpectrum) private void multiplyByRef(ref SpectrumModel aligningSpectrum, SpectrumModel refSpectrum) { double refMaxY = refSpectrum.Elements.Max(x => x.Y); Loading INAF.Apps.Uwp.SLabDataManager/Constants/Constants.cs +0 −5 Original line number Diff line number Diff line Loading @@ -6,11 +6,6 @@ public static readonly string RED = "BB1717"; public static readonly string YELLOW = "D1AB43"; public static readonly string RAW_SPECTRUM_FILE = "rawspectrumfile"; public static readonly string RAW_SPECTRUM_FILE_TOKEN = "rawspectrumfiletoken"; public static readonly string REF_SPECTRUM_FILE = "refspectrumfile"; public static readonly string REF_SPECTRUM_FILE_TOKEN = "refspectrumfiletoken"; public static readonly string X_AXIS_MAJOR_STEP = "xaxismajorstep"; public static readonly string WAVELENGTH_MEASURE_UNITS = "wavelengthmeasureunits"; public static readonly string MAJOR_LINES_VISIBILITY = "majorlinesvisibility"; Loading INAF.Apps.Uwp.SLabDataManager/Converters/SpectrumConverter.cs +24 −0 Original line number Diff line number Diff line Loading @@ -35,4 +35,28 @@ namespace INAF.Apps.Uwp.SLabDataManager.Converters throw new NotImplementedException(); } } public sealed class SpectrumModelConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { try { string _spectrumType = (string)parameter; SpectrumType spectrumType = _spectrumType.ToSpectrumType(); SpectraContainer spectraContainer = Ioc.Default.GetService<SpectraContainer>(); return spectraContainer.tryGetSpectrumOfType(spectrumType); } catch (Exception) { return string.Empty; } } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } } INAF.Apps.Uwp.SLabDataManager/Converters/SpectrumSummaryConverters.cs +3 −28 Original line number Diff line number Diff line using INAF.Apps.Uwp.SLabDataManager.Charts; using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Helpers.UI; using INAF.Apps.Uwp.SLabDataManager.ViewModels; using INAF.Libraries.NetStandard.ScienceModels.Extensions; using Microsoft.Toolkit.Mvvm.DependencyInjection; using Microsoft.Toolkit.Mvvm.Input; using System; using Windows.UI.Xaml; using Windows.UI.Xaml.Data; Loading @@ -9,37 +12,9 @@ using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media.Imaging; using static INAF.Apps.Uwp.SLabDataManager.Constants.Enums; using static INAF.Libraries.NetStandard.SLabCommonModels.Enums.Enums; using INAF.Libraries.NetStandard.ScienceModels.Extensions; using Microsoft.Toolkit.Mvvm.Input; using INAF.Libraries.NetStandard.ScienceModels.Spectra; using INAF.Apps.Uwp.SLabDataManager.ViewModels; namespace INAF.Apps.Uwp.SLabDataManager.Converters { public sealed class SpectrumModelConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { try { string _spectrumType = (string)parameter; SpectrumType spectrumType = _spectrumType.ToSpectrumType(); SpectraContainer spectraContainer = Ioc.Default.GetService<SpectraContainer>(); return spectraContainer.tryGetSpectrumOfType(spectrumType); } catch (Exception) { return string.Empty; } } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } public sealed class SpectrumSummaryFilepathConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) Loading Loading
INAF.Apps.Uwp.SLabDataManager/Assets/xml/remoteoperations.xml +1 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,6 @@ <operation type="Authentication">Account/LoginForJwt</operation> <operation type="SaveAlignedFile">AppSpectraFilesActions/SaveAlignedSpectrum</operation> <operation type="SaveFileOfType">AppSpectraFilesActions/SaveSpectrumOfType</operation> <operation type="IsSavedOnCloud">AppSpectraFilesActions/IsSavedOnCloud</operation> <operation type="IsSavedOnCloud">AppSpectraFilesActions/IsSpectrumSavedOnCloud</operation> </operationUrls> </remoteOperationsData> No newline at end of file
INAF.Apps.Uwp.SLabDataManager/Charts/SpectraContainer.cs +9 −9 Original line number Diff line number Diff line Loading @@ -249,7 +249,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts spectrum.PropertyChanged += Spectrum_PropertyChanged; } public INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel tryGetSpectrumOfType(SpectrumType spectrumType) public SpectrumModel tryGetSpectrumOfType(SpectrumType spectrumType) { return Spectra.FirstOrDefault(x => x.Type == spectrumType); } Loading Loading @@ -333,7 +333,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts IsError = false; ErrorMessage = string.Empty; INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel aligningSpectrum = null; SpectrumModel aligningSpectrum = null; string exMsg = string.Empty; await Task.Run(() => Loading @@ -342,11 +342,11 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts { aligningSpectrum = createAligningSpectrum(); var refSpectrum = tryGetSpectrumOfType(SpectrumType.Ref); if (refSpectrum != null) var refWhiteSpectrum = tryGetSpectrumOfType(SpectrumType.RefWhite); if (refWhiteSpectrum != null) { multiplyByRef(ref aligningSpectrum, refSpectrum); refWhiteSpectrum); } /* retrieve the reference segment and calculate the mean values at the borders of the segment for aligning other segments */ Loading Loading @@ -385,7 +385,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts } } private void alignLeftSide(ref INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel aligningSpectrum, private void alignLeftSide(ref SpectrumModel aligningSpectrum, WavelengthModel refLowSeparator, double refSegmentLeftMean) { Loading @@ -408,7 +408,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts } } private void alignRightSide(ref INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel aligningSpectrum, private void alignRightSide(ref SpectrumModel aligningSpectrum, WavelengthModel refHighSeparator, double refSegmentRightMean) { Loading @@ -428,8 +428,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.Charts } } private void multiplyByRef(ref INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel aligningSpectrum, INAF.Apps.Uwp.SLabDataManager.Models.Spectrum.SpectrumModel refSpectrum) private void multiplyByRef(ref SpectrumModel aligningSpectrum, SpectrumModel refSpectrum) { double refMaxY = refSpectrum.Elements.Max(x => x.Y); Loading
INAF.Apps.Uwp.SLabDataManager/Constants/Constants.cs +0 −5 Original line number Diff line number Diff line Loading @@ -6,11 +6,6 @@ public static readonly string RED = "BB1717"; public static readonly string YELLOW = "D1AB43"; public static readonly string RAW_SPECTRUM_FILE = "rawspectrumfile"; public static readonly string RAW_SPECTRUM_FILE_TOKEN = "rawspectrumfiletoken"; public static readonly string REF_SPECTRUM_FILE = "refspectrumfile"; public static readonly string REF_SPECTRUM_FILE_TOKEN = "refspectrumfiletoken"; public static readonly string X_AXIS_MAJOR_STEP = "xaxismajorstep"; public static readonly string WAVELENGTH_MEASURE_UNITS = "wavelengthmeasureunits"; public static readonly string MAJOR_LINES_VISIBILITY = "majorlinesvisibility"; Loading
INAF.Apps.Uwp.SLabDataManager/Converters/SpectrumConverter.cs +24 −0 Original line number Diff line number Diff line Loading @@ -35,4 +35,28 @@ namespace INAF.Apps.Uwp.SLabDataManager.Converters throw new NotImplementedException(); } } public sealed class SpectrumModelConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { try { string _spectrumType = (string)parameter; SpectrumType spectrumType = _spectrumType.ToSpectrumType(); SpectraContainer spectraContainer = Ioc.Default.GetService<SpectraContainer>(); return spectraContainer.tryGetSpectrumOfType(spectrumType); } catch (Exception) { return string.Empty; } } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } }
INAF.Apps.Uwp.SLabDataManager/Converters/SpectrumSummaryConverters.cs +3 −28 Original line number Diff line number Diff line using INAF.Apps.Uwp.SLabDataManager.Charts; using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Helpers.UI; using INAF.Apps.Uwp.SLabDataManager.ViewModels; using INAF.Libraries.NetStandard.ScienceModels.Extensions; using Microsoft.Toolkit.Mvvm.DependencyInjection; using Microsoft.Toolkit.Mvvm.Input; using System; using Windows.UI.Xaml; using Windows.UI.Xaml.Data; Loading @@ -9,37 +12,9 @@ using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media.Imaging; using static INAF.Apps.Uwp.SLabDataManager.Constants.Enums; using static INAF.Libraries.NetStandard.SLabCommonModels.Enums.Enums; using INAF.Libraries.NetStandard.ScienceModels.Extensions; using Microsoft.Toolkit.Mvvm.Input; using INAF.Libraries.NetStandard.ScienceModels.Spectra; using INAF.Apps.Uwp.SLabDataManager.ViewModels; namespace INAF.Apps.Uwp.SLabDataManager.Converters { public sealed class SpectrumModelConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) { try { string _spectrumType = (string)parameter; SpectrumType spectrumType = _spectrumType.ToSpectrumType(); SpectraContainer spectraContainer = Ioc.Default.GetService<SpectraContainer>(); return spectraContainer.tryGetSpectrumOfType(spectrumType); } catch (Exception) { return string.Empty; } } public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } public sealed class SpectrumSummaryFilepathConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, string language) Loading