Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/BaseViewModel.cs +1 −1 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* clear chart page (remove all spectra) and close usercontrols */ await clearChartPageAsync(); /* clear REF white (is not removed by removing the RAW one 'cause is not considered as a 'child' spectrum) */ /* clear REF white (is not removed by removing the RAW one because is not considered as a 'child' spectrum) */ WorkingItems.SpectraContainer.tryRemoveSpectrumOfTypeAsync(SpectrumType.Ref); } #endregion Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModel.cs +4 −1 Original line number Diff line number Diff line Loading @@ -430,9 +430,12 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* delete local file */ await deleteSpectrumLocallyAsync(retrievedSpectrumTypeToBeDeleted); if (isDeleteOnCloudRequired) /* delete file on cloud, ONLY IF asked by user AND permission is granted */ if (isDeleteOnCloudRequired && getPermissionsHelper().isSaveOnCloudFromAppAllowed()) { /* delete file on cloud */ await deleteSpectrumOnCloudAsync(getFileId(retrievedSpectrumTypeToBeDeleted)); } /* specific actions for spectra types */ switch (retrievedSpectrumTypeToBeDeleted) Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelAlignment.cs +21 −17 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels initActionQuestionViewModel(question: "AlignmentAskDeletingContinuumRemoved".GetText(), optionalQuestion: "OptionalActionDeleteOnCloudQuestion".GetText(), isOptionalActionChecked: false, isOptionalActionVisible: true); isOptionalActionVisible: getPermissionsHelper().isSaveOnCloudFromAppAllowed()); } } Loading Loading @@ -97,6 +97,9 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels else showDialogMessage("SaveSpectrumLocalOutputFolderNotDefinedMessage".GetText(), DialogMessageType.Warning); /* if no permission to save/delete on cloud is granted, then return */ if (getPermissionsHelper().isSaveOnCloudFromAppAllowed()) { /* save aligned spectrum on cloud */ GenericIdResponseModel saveCloudFileResult = await AlignmentViewModel.saveSpectrumOfTypeAlignedOnCloudAsync(); if (saveCloudFileResult == null) Loading @@ -115,6 +118,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* save isSavedOnCloud and id of spectrum */ WorkingItems.SpectraContainer.tryGetSpectrumOfType(SpectrumType.Aligned).setIsSavedOnCloud(saveCloudFileResult.IsOk); WorkingItems.SpectraContainer.tryGetSpectrumOfType(SpectrumType.Aligned).setId(saveCloudFileResult.Id); } IsLoading = false; Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelSegmentsFit.cs +45 −28 Original line number Diff line number Diff line Loading @@ -33,7 +33,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* init actionusercontrol viewmodel */ string question = "ContinuumRemovedAskDeletingContinuumRemoved".GetText(); string optionalQuestion = "OptionalActionDeleteOnCloudQuestion".GetText(); bool isOptionalActionVisible = true; bool isOptionalActionVisible = getPermissionsHelper().isSaveOnCloudFromAppAllowed(); /* when continuum-removed is deleted because fit-segments are deleted... */ if (isDeletingFitSegmentsInProgress) { question = "ContinuumRemovedAskDeletingAlsoContinuumRemoved".GetText(); Loading @@ -59,7 +60,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels initActionQuestionViewModel(question: "SegmentsFitAskDeletingSegmentFitModels".GetText(), optionalQuestion: string.Empty, isOptionalActionChecked: false, isOptionalActionVisible: false); isOptionalActionVisible: getPermissionsHelper().isSaveOnCloudFromAppAllowed()); } } Loading Loading @@ -244,7 +245,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels #endregion #region save private async Task saveSpectrumOfTypeContinuumRemovedAsync(RemoteOperationType remoteOperationType) private async Task saveSpectrumOfTypeContinuumRemovedAsync(SaveFileOperationType saveFileOperationType) { /* raise error message if no aligned spectrum existing */ if (!WorkingItems.SpectraContainer.isAnySpectrumOfType(SpectrumType.ContinuumRemoved)) Loading @@ -258,15 +259,29 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* save aligned spectrum locally, in a local folder */ if (await isOutputFolderDefinedAsync()) { (bool isOk, string exMsg) saveLocalFileResult = await SegmentsFitViewModel.saveSpectrumOfTypeAsLocalFileAsync(SpectrumType.ContinuumRemoved); /* determine whether replace or create new version of local file */ Windows.Storage.CreationCollisionOption creationCollisionOption = Windows.Storage.CreationCollisionOption.ReplaceExisting; if (saveFileOperationType == SaveFileOperationType.SaveAsCopy) creationCollisionOption = Windows.Storage.CreationCollisionOption.GenerateUniqueName; (bool isOk, string exMsg) saveLocalFileResult = await SegmentsFitViewModel.saveSpectrumOfTypeAsLocalFileAsync(SpectrumType.ContinuumRemoved, creationCollisionOption); if (!saveLocalFileResult.isOk) showDialogMessage(saveLocalFileResult.exMsg, DialogMessageType.Warning); } else showDialogMessage("SaveSpectrumLocalOutputFolderNotDefinedMessage".GetText(), DialogMessageType.Warning); /* if no permission to save/delete on cloud is granted, then return */ if (getPermissionsHelper().isSaveOnCloudFromAppAllowed()) { /* determine whether replace or create new version on cloud */ RemoteOperationType remoteOperationType = RemoteOperationType.SaveSpectrumOfTypeContinuumRemoved; if (saveFileOperationType == SaveFileOperationType.SaveAsCopy) remoteOperationType = RemoteOperationType.SaveAsCopySpectrumOfTypeContinuumRemoved; /* save continuum-removed spectrum on cloud */ SegmentsProcessingResponseModel saveCloudFileResult = await SegmentsFitViewModel.saveSpectrumOfTypeAlignedOnCloudAsync(remoteOperationType); SegmentsProcessingResponseModel saveCloudFileResult = await SegmentsFitViewModel.saveSpectrumOfTypeContinuumRemovedOnCloudAsync(remoteOperationType); if (saveCloudFileResult == null) { IsLoading = false; Loading @@ -293,7 +308,9 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels { SegmentsFitViewModel.setSegmentId(segment.Id, segment.XStart, segment.XEnd); } } /* used for show/hide save buttons (the one for upsert, the one for save-as-a-copy) */ SegmentsFitViewModel.IsContinuumRemovedSaved = true; IsLoading = false; Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelSmoothing.cs +25 −24 Original line number Diff line number Diff line Loading @@ -2,8 +2,6 @@ using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Helpers.UI.Chart.ProcessingHelpers; using INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels; using INAF.Apps.Uwp.SLabDataManager.Views.UserControls; using INAF.Libraries.NetStandard.Extensions; using INAF.Libraries.NetStandard.ScienceModels.Extensions; using INAF.Libraries.NetStandard.ScienceModels.Spectra; using INAF.Libraries.NetStandard.SLabCommonModels.Models.WebApp.Responses; Loading Loading @@ -41,7 +39,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels initActionQuestionViewModel(question: "SmoothingAskDeletingSmoothedSpectrumBySegments".GetText(), optionalQuestion: "OptionalActionDeleteOnCloudQuestion".GetText(), isOptionalActionChecked: false, isOptionalActionVisible: true); isOptionalActionVisible: getPermissionsHelper().isSaveOnCloudFromAppAllowed()); } } Loading Loading @@ -70,7 +68,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels initActionQuestionViewModel(question: "SmoothingAskDeletingSmoothedSpectrum".GetText(), optionalQuestion: "OptionalActionDeleteOnCloudQuestion".GetText(), isOptionalActionChecked: false, isOptionalActionVisible: true); isOptionalActionVisible: getPermissionsHelper().isSaveOnCloudFromAppAllowed()); } } Loading Loading @@ -309,6 +307,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels else showDialogMessage("SaveSpectrumLocalOutputFolderNotDefinedMessage".GetText(), DialogMessageType.Warning); if (getPermissionsHelper().isSaveOnCloudFromAppAllowed()) { /* save smoothed spectrum on cloud */ SegmentsProcessingResponseModel saveCloudFileResult = await SmoothingViewModel.saveSpectrumOfTypeSmoothedOnCloudAsync(destSpectrumType); if (saveCloudFileResult == null) Loading @@ -333,6 +333,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels { smoothingViewModel.setSegmentId(segment.Id, segment.XStart, segment.XEnd); } } IsLoading = false; Loading Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/BaseViewModel.cs +1 −1 Original line number Diff line number Diff line Loading @@ -198,7 +198,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* clear chart page (remove all spectra) and close usercontrols */ await clearChartPageAsync(); /* clear REF white (is not removed by removing the RAW one 'cause is not considered as a 'child' spectrum) */ /* clear REF white (is not removed by removing the RAW one because is not considered as a 'child' spectrum) */ WorkingItems.SpectraContainer.tryRemoveSpectrumOfTypeAsync(SpectrumType.Ref); } #endregion Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModel.cs +4 −1 Original line number Diff line number Diff line Loading @@ -430,9 +430,12 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* delete local file */ await deleteSpectrumLocallyAsync(retrievedSpectrumTypeToBeDeleted); if (isDeleteOnCloudRequired) /* delete file on cloud, ONLY IF asked by user AND permission is granted */ if (isDeleteOnCloudRequired && getPermissionsHelper().isSaveOnCloudFromAppAllowed()) { /* delete file on cloud */ await deleteSpectrumOnCloudAsync(getFileId(retrievedSpectrumTypeToBeDeleted)); } /* specific actions for spectra types */ switch (retrievedSpectrumTypeToBeDeleted) Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelAlignment.cs +21 −17 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels initActionQuestionViewModel(question: "AlignmentAskDeletingContinuumRemoved".GetText(), optionalQuestion: "OptionalActionDeleteOnCloudQuestion".GetText(), isOptionalActionChecked: false, isOptionalActionVisible: true); isOptionalActionVisible: getPermissionsHelper().isSaveOnCloudFromAppAllowed()); } } Loading Loading @@ -97,6 +97,9 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels else showDialogMessage("SaveSpectrumLocalOutputFolderNotDefinedMessage".GetText(), DialogMessageType.Warning); /* if no permission to save/delete on cloud is granted, then return */ if (getPermissionsHelper().isSaveOnCloudFromAppAllowed()) { /* save aligned spectrum on cloud */ GenericIdResponseModel saveCloudFileResult = await AlignmentViewModel.saveSpectrumOfTypeAlignedOnCloudAsync(); if (saveCloudFileResult == null) Loading @@ -115,6 +118,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* save isSavedOnCloud and id of spectrum */ WorkingItems.SpectraContainer.tryGetSpectrumOfType(SpectrumType.Aligned).setIsSavedOnCloud(saveCloudFileResult.IsOk); WorkingItems.SpectraContainer.tryGetSpectrumOfType(SpectrumType.Aligned).setId(saveCloudFileResult.Id); } IsLoading = false; Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelSegmentsFit.cs +45 −28 Original line number Diff line number Diff line Loading @@ -33,7 +33,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* init actionusercontrol viewmodel */ string question = "ContinuumRemovedAskDeletingContinuumRemoved".GetText(); string optionalQuestion = "OptionalActionDeleteOnCloudQuestion".GetText(); bool isOptionalActionVisible = true; bool isOptionalActionVisible = getPermissionsHelper().isSaveOnCloudFromAppAllowed(); /* when continuum-removed is deleted because fit-segments are deleted... */ if (isDeletingFitSegmentsInProgress) { question = "ContinuumRemovedAskDeletingAlsoContinuumRemoved".GetText(); Loading @@ -59,7 +60,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels initActionQuestionViewModel(question: "SegmentsFitAskDeletingSegmentFitModels".GetText(), optionalQuestion: string.Empty, isOptionalActionChecked: false, isOptionalActionVisible: false); isOptionalActionVisible: getPermissionsHelper().isSaveOnCloudFromAppAllowed()); } } Loading Loading @@ -244,7 +245,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels #endregion #region save private async Task saveSpectrumOfTypeContinuumRemovedAsync(RemoteOperationType remoteOperationType) private async Task saveSpectrumOfTypeContinuumRemovedAsync(SaveFileOperationType saveFileOperationType) { /* raise error message if no aligned spectrum existing */ if (!WorkingItems.SpectraContainer.isAnySpectrumOfType(SpectrumType.ContinuumRemoved)) Loading @@ -258,15 +259,29 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels /* save aligned spectrum locally, in a local folder */ if (await isOutputFolderDefinedAsync()) { (bool isOk, string exMsg) saveLocalFileResult = await SegmentsFitViewModel.saveSpectrumOfTypeAsLocalFileAsync(SpectrumType.ContinuumRemoved); /* determine whether replace or create new version of local file */ Windows.Storage.CreationCollisionOption creationCollisionOption = Windows.Storage.CreationCollisionOption.ReplaceExisting; if (saveFileOperationType == SaveFileOperationType.SaveAsCopy) creationCollisionOption = Windows.Storage.CreationCollisionOption.GenerateUniqueName; (bool isOk, string exMsg) saveLocalFileResult = await SegmentsFitViewModel.saveSpectrumOfTypeAsLocalFileAsync(SpectrumType.ContinuumRemoved, creationCollisionOption); if (!saveLocalFileResult.isOk) showDialogMessage(saveLocalFileResult.exMsg, DialogMessageType.Warning); } else showDialogMessage("SaveSpectrumLocalOutputFolderNotDefinedMessage".GetText(), DialogMessageType.Warning); /* if no permission to save/delete on cloud is granted, then return */ if (getPermissionsHelper().isSaveOnCloudFromAppAllowed()) { /* determine whether replace or create new version on cloud */ RemoteOperationType remoteOperationType = RemoteOperationType.SaveSpectrumOfTypeContinuumRemoved; if (saveFileOperationType == SaveFileOperationType.SaveAsCopy) remoteOperationType = RemoteOperationType.SaveAsCopySpectrumOfTypeContinuumRemoved; /* save continuum-removed spectrum on cloud */ SegmentsProcessingResponseModel saveCloudFileResult = await SegmentsFitViewModel.saveSpectrumOfTypeAlignedOnCloudAsync(remoteOperationType); SegmentsProcessingResponseModel saveCloudFileResult = await SegmentsFitViewModel.saveSpectrumOfTypeContinuumRemovedOnCloudAsync(remoteOperationType); if (saveCloudFileResult == null) { IsLoading = false; Loading @@ -293,7 +308,9 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels { SegmentsFitViewModel.setSegmentId(segment.Id, segment.XStart, segment.XEnd); } } /* used for show/hide save buttons (the one for upsert, the one for save-as-a-copy) */ SegmentsFitViewModel.IsContinuumRemovedSaved = true; IsLoading = false; Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelSmoothing.cs +25 −24 Original line number Diff line number Diff line Loading @@ -2,8 +2,6 @@ using INAF.Apps.Uwp.SLabDataManager.Helpers; using INAF.Apps.Uwp.SLabDataManager.Helpers.UI.Chart.ProcessingHelpers; using INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels; using INAF.Apps.Uwp.SLabDataManager.Views.UserControls; using INAF.Libraries.NetStandard.Extensions; using INAF.Libraries.NetStandard.ScienceModels.Extensions; using INAF.Libraries.NetStandard.ScienceModels.Spectra; using INAF.Libraries.NetStandard.SLabCommonModels.Models.WebApp.Responses; Loading Loading @@ -41,7 +39,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels initActionQuestionViewModel(question: "SmoothingAskDeletingSmoothedSpectrumBySegments".GetText(), optionalQuestion: "OptionalActionDeleteOnCloudQuestion".GetText(), isOptionalActionChecked: false, isOptionalActionVisible: true); isOptionalActionVisible: getPermissionsHelper().isSaveOnCloudFromAppAllowed()); } } Loading Loading @@ -70,7 +68,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels initActionQuestionViewModel(question: "SmoothingAskDeletingSmoothedSpectrum".GetText(), optionalQuestion: "OptionalActionDeleteOnCloudQuestion".GetText(), isOptionalActionChecked: false, isOptionalActionVisible: true); isOptionalActionVisible: getPermissionsHelper().isSaveOnCloudFromAppAllowed()); } } Loading Loading @@ -309,6 +307,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels else showDialogMessage("SaveSpectrumLocalOutputFolderNotDefinedMessage".GetText(), DialogMessageType.Warning); if (getPermissionsHelper().isSaveOnCloudFromAppAllowed()) { /* save smoothed spectrum on cloud */ SegmentsProcessingResponseModel saveCloudFileResult = await SmoothingViewModel.saveSpectrumOfTypeSmoothedOnCloudAsync(destSpectrumType); if (saveCloudFileResult == null) Loading @@ -333,6 +333,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels { smoothingViewModel.setSegmentId(segment.Id, segment.XStart, segment.XEnd); } } IsLoading = false; Loading