Loading INAF.Apps.Uwp.SLabDataManager/INAF.Apps.Uwp.SLabDataManager.csproj +2 −2 Original line number Diff line number Diff line Loading @@ -132,10 +132,10 @@ <Version>8.0.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Analytics"> <Version>4.5.3</Version> <Version>5.0.1</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Crashes"> <Version>4.5.3</Version> <Version>5.0.1</Version> </PackageReference> <PackageReference Include="Microsoft.Extensions.DependencyInjection"> <Version>7.0.0</Version> Loading INAF.Apps.Uwp.SLabDataManager/Models/Chart/SpectraFactory.cs +11 −6 Original line number Diff line number Diff line Loading @@ -207,30 +207,35 @@ namespace INAF.Apps.Uwp.SLabDataManager.Models.Chart #region clone public IChartSpectrumModel getClonedSpectrum<T>(SpectrumType srcType, SpectrumType destType) where T : IChartSpectrumModel SpectrumType destType, SpectrumLevel spectrumLevel) where T : IChartSpectrumModel { (IChartSpectrumModel destSpectrum, IChartSpectrumModel rawSpectrumClone) result = getElementsForClone<T>(srcType, destType); destType, spectrumLevel); result.destSpectrum.Elements = result.rawSpectrumClone.Elements; return result.destSpectrum; } public IChartSpectrumModel getEmptyClonedSpectrum<T>(SpectrumType srcType, SpectrumType destType) where T : IChartSpectrumModel SpectrumType destType, SpectrumLevel spectrumLevel) where T : IChartSpectrumModel { (IChartSpectrumModel destSpectrum, IChartSpectrumModel rawSpectrumClone) result = getElementsForClone<T>(srcType, destType); destType, spectrumLevel); return result.destSpectrum; } private (IChartSpectrumModel destSpectrum, IChartSpectrumModel rawSpectrumClone) getElementsForClone<T>(SpectrumType srcType, SpectrumType destType) where T : IChartSpectrumModel SpectrumType destType, SpectrumLevel spectrumLevel) where T : IChartSpectrumModel { var rawSpectrumClone = (IChartSpectrumModel)spectraContainer.tryGetSpectrumOfType(srcType).Clone(); var destSpectrum = (T)Activator.CreateInstance(typeof(T), new object[] { serviceProvider, destType, rawSpectrumClone.Filename, rawSpectrumClone.Filepath }); var destSpectrum = (T)Activator.CreateInstance(typeof(T), new object[] { serviceProvider, destType, spectrumLevel, rawSpectrumClone.Filename, rawSpectrumClone.Filepath }); destSpectrum.ParentId = rawSpectrumClone.Id; destSpectrum.setColor(); Loading INAF.Apps.Uwp.SLabDataManager/Package.appxmanifest +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ <Identity Name="INAF.Apps.Uwp.SLabDataManager" Publisher="CN=INAF-IAPS, O=INAF, C=IT" Version="1.0.16.0" /> Version="1.0.17.0" /> <mp:PhoneIdentity PhoneProductId="07F38165-05DE-4ED7-8514-60D1E8CDCBFE" PhonePublisherId="00000000-0000-0000-0000-000000000000"/> Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelSegmentsFit.cs +5 −2 Original line number Diff line number Diff line Loading @@ -125,10 +125,13 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels .tryGetSpectrumOfType(SpectrumType.Continuum); else continuum = spectraFactory.getEmptyClonedSpectrum<ChartSpectrumModel>(srcType: SpectrumType.Aligned, destType: SpectrumType.Continuum); destType: SpectrumType.Continuum, spectrumLevel: SpectrumLevel.Averaged); /* clone aligned spectrum and extract points belonging to selected fit-segment */ IEnumerable<ElementModel> range = spectraFactory.getClonedSpectrum<ChartSpectrumModel>(srcType: SpectrumType.Aligned, destType: SpectrumType.Continuum) IEnumerable<ElementModel> range = spectraFactory.getClonedSpectrum<ChartSpectrumModel>(srcType: SpectrumType.Aligned, destType: SpectrumType.Continuum, spectrumLevel: SpectrumLevel.Averaged) .getRange(segmentFitModel.P1.X, segmentFitModel.P2.X); /* show panel with segments */ Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelSmoothing.cs +4 −2 Original line number Diff line number Diff line Loading @@ -118,7 +118,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* clone spectrum for smoothing */ var spectraFactory = serviceProvider.GetRequiredService<SpectraFactory>(); var clonedSpectrum = spectraFactory.getClonedSpectrum<ChartSpectrumOfTypeSmoothedModel>(srcType: SmoothingViewModel.SelectedSpectrumType, destType: destSpectrumType); destType: destSpectrumType, spectrumLevel: SpectrumLevel.Averaged); /* apply smoothing */ (IChartSpectrumModel smoothedSpectrum, bool isOk) smoothingResult = await SmoothingViewModel.applySmoothingToSegments(clonedSpectrum); Loading Loading @@ -211,7 +212,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* clone spectrum for smoothing */ var spectraFactory = serviceProvider.GetRequiredService<SpectraFactory>(); var clonedSpectrum = spectraFactory.getClonedSpectrum<ChartSpectrumOfTypeSmoothedModel>(srcType: srcSpectrumType, destType: destSpectrumType); destType: destSpectrumType, spectrumLevel: SpectrumLevel.Averaged); /* apply smoothing */ (IChartSpectrumModel smoothedSpectrum, bool isOk) smoothingResult = await SmoothingViewModel.applySmoothingToSpectrum(clonedSpectrum); Loading Loading
INAF.Apps.Uwp.SLabDataManager/INAF.Apps.Uwp.SLabDataManager.csproj +2 −2 Original line number Diff line number Diff line Loading @@ -132,10 +132,10 @@ <Version>8.0.0</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Analytics"> <Version>4.5.3</Version> <Version>5.0.1</Version> </PackageReference> <PackageReference Include="Microsoft.AppCenter.Crashes"> <Version>4.5.3</Version> <Version>5.0.1</Version> </PackageReference> <PackageReference Include="Microsoft.Extensions.DependencyInjection"> <Version>7.0.0</Version> Loading
INAF.Apps.Uwp.SLabDataManager/Models/Chart/SpectraFactory.cs +11 −6 Original line number Diff line number Diff line Loading @@ -207,30 +207,35 @@ namespace INAF.Apps.Uwp.SLabDataManager.Models.Chart #region clone public IChartSpectrumModel getClonedSpectrum<T>(SpectrumType srcType, SpectrumType destType) where T : IChartSpectrumModel SpectrumType destType, SpectrumLevel spectrumLevel) where T : IChartSpectrumModel { (IChartSpectrumModel destSpectrum, IChartSpectrumModel rawSpectrumClone) result = getElementsForClone<T>(srcType, destType); destType, spectrumLevel); result.destSpectrum.Elements = result.rawSpectrumClone.Elements; return result.destSpectrum; } public IChartSpectrumModel getEmptyClonedSpectrum<T>(SpectrumType srcType, SpectrumType destType) where T : IChartSpectrumModel SpectrumType destType, SpectrumLevel spectrumLevel) where T : IChartSpectrumModel { (IChartSpectrumModel destSpectrum, IChartSpectrumModel rawSpectrumClone) result = getElementsForClone<T>(srcType, destType); destType, spectrumLevel); return result.destSpectrum; } private (IChartSpectrumModel destSpectrum, IChartSpectrumModel rawSpectrumClone) getElementsForClone<T>(SpectrumType srcType, SpectrumType destType) where T : IChartSpectrumModel SpectrumType destType, SpectrumLevel spectrumLevel) where T : IChartSpectrumModel { var rawSpectrumClone = (IChartSpectrumModel)spectraContainer.tryGetSpectrumOfType(srcType).Clone(); var destSpectrum = (T)Activator.CreateInstance(typeof(T), new object[] { serviceProvider, destType, rawSpectrumClone.Filename, rawSpectrumClone.Filepath }); var destSpectrum = (T)Activator.CreateInstance(typeof(T), new object[] { serviceProvider, destType, spectrumLevel, rawSpectrumClone.Filename, rawSpectrumClone.Filepath }); destSpectrum.ParentId = rawSpectrumClone.Id; destSpectrum.setColor(); Loading
INAF.Apps.Uwp.SLabDataManager/Package.appxmanifest +1 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,7 @@ <Identity Name="INAF.Apps.Uwp.SLabDataManager" Publisher="CN=INAF-IAPS, O=INAF, C=IT" Version="1.0.16.0" /> Version="1.0.17.0" /> <mp:PhoneIdentity PhoneProductId="07F38165-05DE-4ED7-8514-60D1E8CDCBFE" PhonePublisherId="00000000-0000-0000-0000-000000000000"/> Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelSegmentsFit.cs +5 −2 Original line number Diff line number Diff line Loading @@ -125,10 +125,13 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels .tryGetSpectrumOfType(SpectrumType.Continuum); else continuum = spectraFactory.getEmptyClonedSpectrum<ChartSpectrumModel>(srcType: SpectrumType.Aligned, destType: SpectrumType.Continuum); destType: SpectrumType.Continuum, spectrumLevel: SpectrumLevel.Averaged); /* clone aligned spectrum and extract points belonging to selected fit-segment */ IEnumerable<ElementModel> range = spectraFactory.getClonedSpectrum<ChartSpectrumModel>(srcType: SpectrumType.Aligned, destType: SpectrumType.Continuum) IEnumerable<ElementModel> range = spectraFactory.getClonedSpectrum<ChartSpectrumModel>(srcType: SpectrumType.Aligned, destType: SpectrumType.Continuum, spectrumLevel: SpectrumLevel.Averaged) .getRange(segmentFitModel.P1.X, segmentFitModel.P2.X); /* show panel with segments */ Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelSmoothing.cs +4 −2 Original line number Diff line number Diff line Loading @@ -118,7 +118,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* clone spectrum for smoothing */ var spectraFactory = serviceProvider.GetRequiredService<SpectraFactory>(); var clonedSpectrum = spectraFactory.getClonedSpectrum<ChartSpectrumOfTypeSmoothedModel>(srcType: SmoothingViewModel.SelectedSpectrumType, destType: destSpectrumType); destType: destSpectrumType, spectrumLevel: SpectrumLevel.Averaged); /* apply smoothing */ (IChartSpectrumModel smoothedSpectrum, bool isOk) smoothingResult = await SmoothingViewModel.applySmoothingToSegments(clonedSpectrum); Loading Loading @@ -211,7 +212,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* clone spectrum for smoothing */ var spectraFactory = serviceProvider.GetRequiredService<SpectraFactory>(); var clonedSpectrum = spectraFactory.getClonedSpectrum<ChartSpectrumOfTypeSmoothedModel>(srcType: srcSpectrumType, destType: destSpectrumType); destType: destSpectrumType, spectrumLevel: SpectrumLevel.Averaged); /* apply smoothing */ (IChartSpectrumModel smoothedSpectrum, bool isOk) smoothingResult = await SmoothingViewModel.applySmoothingToSpectrum(clonedSpectrum); Loading