Commit b5f77ebe authored by Francesco Carraro's avatar Francesco Carraro
Browse files

added 'ProcessingSteps' in ChartViewModel for tracking the parent/child...

added 'ProcessingSteps' in ChartViewModel for tracking the parent/child relations when processing spectra
parent 8bdf2d83
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8" ?>
<logbook>
	<updates>
		<!--<fixes>
			<fix>Fixed missing warning when saving info</fix>
			<fix>Removed wrong animation when resizing app and Chart page is active with right-panels opened</fix>
			<fix>Fixed smoothing by spectrum</fix>
		</fixes>-->
		<addings>
		<fixes>
			<fix>Fixed saving of parent Id for each processing step</fix>
		</fixes>
		<!--<addings>
			<adding>Added reading of stdDev for Y values, when available</adding>
		</addings>
		</addings>-->
	</updates>
</logbook>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@
  <Identity
    Name="INAF.Apps.Uwp.SLabDataManager"
    Publisher="CN=INAF-IAPS, O=INAF, C=IT"
    Version="1.0.32.0" />
    Version="1.0.34.0" />

  <mp:PhoneIdentity PhoneProductId="07F38165-05DE-4ED7-8514-60D1E8CDCBFE" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

+4 −5
Original line number Diff line number Diff line
@@ -194,6 +194,10 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
            chartViewModel.SpectrumTypeToBeDeleted = SpectrumType.Raw;
            /* delete all spectra and close panels */
            await chartViewModel.deleteProcessedSpectraProcedureAsync();
            /* clear all retrieved processed spectra, if any is available */
            ProcessedSpectraContainer.clear();
            /* clear processing steps */
            chartViewModel.initProcessingSteps();
            /* clear info in panel before closing it */
            var userControlsViewModelFactory = serviceProvider.GetRequiredService<UserControlsViewModelFactory>();
            userControlsViewModelFactory.resetSampleDataViewModel();
@@ -278,11 +282,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        }
        #endregion

        protected void tryClearProcessedSpectra()
        {
            ProcessedSpectraContainer.clear();
        }

        #region ACTION QUESTION
        protected void initActionQuestionViewModel(string question,
                                                   string optionalQuestion,
+38 −8
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
            UserControlsHelper = serviceProvider.GetRequiredService<UserControlsHelper>();

            userControlsViewModelFactory = serviceProvider.GetRequiredService<UserControlsViewModelFactory>();

            initProcessingSteps();
        }

        #region navigation events
@@ -124,7 +126,10 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        public UserControlsHelper UserControlsHelper { get; private set; }
        #endregion

        #region properties
        /* creates a list of processing steps for current RAW spectrum */
        public List<SpectrumType> ProcessingSteps { get; private set; }

        #region PROPERTIES
        private double chartLegendHeight;
        public double ChartLegendHeight
        {
@@ -235,7 +240,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        #endregion
        #endregion

        #region raise methods
        #region RAISE METHODS
        public void raiseHideAlignmentFlyoutRequired()
        {
            IsHideAlignmentFlyoutRequired = true;
@@ -261,7 +266,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        }
        #endregion

        #region methods
        #region METHODS
        private void clear()
        {
            WorkingItems.SpectraContainer.PropertyChanged -= SpectraContainer_PropertyChanged;
@@ -373,7 +378,32 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        }
        #endregion

        #region delete spectra
        #region MANAGE PROCESSING STEPS
        public void initProcessingSteps()
        {
            ProcessingSteps = new List<SpectrumType>();
        }

        public void addProcessingStep(SpectrumType spectrumType)
        {
            if (!ProcessingSteps.Contains(spectrumType))
                ProcessingSteps.Add(spectrumType);
        }

        public SpectrumType getParentSpectrumType(SpectrumType spectrumType)
        {
            int index = ProcessingSteps.IndexOf(spectrumType);
            return (index == -1) ? SpectrumType.None : ProcessingSteps[index - 1];
        }

        public void insertProcessingStep(int index, SpectrumType spectrumType)
        {
            if (!ProcessingSteps.Contains(spectrumType))
                ProcessingSteps.Insert(index, spectrumType);
        }
        #endregion

        #region DELETE SPECTRA
        public void closeAllUserControlsProcedure()
        {
            /* hide panel for creating continuum */
@@ -514,7 +544,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        }
        #endregion

        #region usercontrols open/close
        #region USERCONTROLS OPEN/CLOSE
        private void highlightUserControl(string name)
        {
            UserControlsHelper.bringToFrontUserControl(name);
@@ -535,7 +565,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        }
        #endregion

        #region init usercontrols viewmodels
        #region INIT USERCONTROLS VIEWMODELS
        public void initAlignmentViewModel()
        {
            if (AlignmentViewModel == null)
@@ -566,7 +596,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        }
        #endregion

        #region processed spectra management
        #region PROCESSED SPECTRA MANAGEMENT
        public async Task tryManageProcessedSpectraSettingsAsync(UserControl userControl)
        {
            var selectedUserControl = UserControlsHelper.UserControls.FirstOrDefault(x => x.GetType() == userControl.GetType());
@@ -640,7 +670,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels
        }
        #endregion

        #region commands
        #region COMMANDS
        private RelayCommand<string> commandCloseUserControl;
        public RelayCommand<string> CommandCloseUserControl => commandCloseUserControl ?? (commandCloseUserControl = new RelayCommand<string>((name) => raiseUserControlClosing(name)));

+3 −0
Original line number Diff line number Diff line
@@ -66,6 +66,9 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels

            if (string.IsNullOrEmpty(result.DialogMessage))
            {
                /* add processing step to the list */
                addProcessingStep(SpectrumType.Aligned);

                /* save info about files used for alignment */
                ((ChartSpectrumOfTypeAlignedModel)result.Spectrum).ParentFiles.ParentFile = WorkingItems.SpectraContainer.tryGetSpectrumOfType(SpectrumType.Raw).ToSpectrumFileBaseInfo();
                ((ChartSpectrumOfTypeAlignedModel)result.Spectrum).ParentFiles.RefFile = WorkingItems.SpectraContainer.tryGetSpectrumOfType(SpectrumType.Ref).ToSpectrumFileBaseInfo();
Loading