Loading INAF.Apps.Uwp.SLabDataManager/App.xaml.cs +0 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ namespace INAF.Apps.Uwp.SLabDataManager public static Dictionary<string, object> AppDictionary; public static Dictionary<UIContext, AppWindow> AppWindows; public static bool IsFirstRawFileReading; private ActivationService ActivationService { Loading Loading @@ -111,8 +110,6 @@ namespace INAF.Apps.Uwp.SLabDataManager private void initServices() { IsFirstRawFileReading = true; /* create app dictionary shared across all app */ AppDictionary = new Dictionary<string, object>(); Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModel.cs +0 −32 Original line number Diff line number Diff line Loading @@ -78,8 +78,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels if (!App.AppDictionary.TryAdd(Constants.Constants.LAST_PAGE, nameof(ChartPage))) App.AppDictionary[Constants.Constants.LAST_PAGE] = nameof(ChartPage); saveIsSegmentsFitUserControlAutoOpenEnabled(); clear(); await base.OnNavigatingFrom(e); Loading Loading @@ -185,20 +183,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels set { SetProperty(ref isHideAlignmentFlyoutRequired, value); } } private bool isSegmentsFitsUserControlAutoOpenEnabled; public bool IsSegmentsFitsUserControlAutoOpenEnabled { get { return isSegmentsFitsUserControlAutoOpenEnabled; } set { SetProperty(ref isSegmentsFitsUserControlAutoOpenEnabled, value); } } private bool isSegmentsFitsUserControlAutoOpenRequired; public bool IsSegmentsFitsUserControlAutoOpenRequired { get { return isSegmentsFitsUserControlAutoOpenRequired; } set { SetProperty(ref isSegmentsFitsUserControlAutoOpenRequired, value); } } private SegmentFitModel selectedSegment; public SegmentFitModel SelectedSegment { Loading Loading @@ -280,12 +264,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels IsDisableFitFocusRequired = true; isDisableFitFocusRequired = false; } private void raiseIsSegmentsFitsUserControlAutoOpenRequired() { IsSegmentsFitsUserControlAutoOpenRequired = true; isSegmentsFitsUserControlAutoOpenRequired = false; // DO NOT UNCOMMENT THIS! } #endregion #region methods Loading Loading @@ -321,16 +299,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels IsDisableFitFocusRequired = false; IsFocusRequired = false; ///* segments fit */ //if (!tryReadIsSegmentsFitsUserControlAvailable()) // IsSegmentsFitsUserControlAvailable = false; if (!tryReadIsSegmentsFitUserControlAutoOpenEnabled()) IsSegmentsFitsUserControlAutoOpenEnabled = true; if (!tryReadIsSegmentsFitsUserControlAutoOpenRequired()) IsSegmentsFitsUserControlAutoOpenRequired = false; /* dialogs */ IsOperationDialogRequired = false; DialogMessage = string.Empty; Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelSegmentsFit.cs +1 −41 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels UserControlsHelper.RequiredUserControlName = nameof(SegmentsFitUserControl).FirstCharToLowerCase(); // this is used to select the right tab in ChartPage->tabViewPanels, if shown if (isRaiseEventAllowed) raiseIsSegmentsFitsUserControlAutoOpenRequired(); SegmentsFitViewModel.raiseIsSegmentsFitsUserControlAutoOpenRequired(); /* fit current segment with selected fit method */ if (segmentFitModel.SelectedFitMethod == null) Loading Loading @@ -366,46 +366,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels } #endregion #region segments-fit panel private void saveIsSegmentsFitUserControlAutoOpenEnabled() { settingsHelper.save(nameof(IsSegmentsFitsUserControlAutoOpenEnabled), IsSegmentsFitsUserControlAutoOpenEnabled.ToString()); } private void saveIsSegmentsFitsUserControlAutoOpenRequired() { settingsHelper.save(nameof(IsSegmentsFitsUserControlAutoOpenRequired), IsSegmentsFitsUserControlAutoOpenRequired.ToString()); } public bool tryReadIsSegmentsFitUserControlAutoOpenEnabled() { bool isFound = false; string value = settingsHelper.get(nameof(IsSegmentsFitsUserControlAutoOpenEnabled)); if (!string.IsNullOrEmpty(value)) { IsSegmentsFitsUserControlAutoOpenEnabled = value.ToBool(); isFound = true; } return isFound; } public bool tryReadIsSegmentsFitsUserControlAutoOpenRequired() { bool isFound = false; string value = settingsHelper.get(nameof(IsSegmentsFitsUserControlAutoOpenRequired)); if (!string.IsNullOrEmpty(value)) { IsSegmentsFitsUserControlAutoOpenRequired = value.ToBool(); isFound = true; } return isFound; } #endregion #region commands private RelayCommand commandAskClearFitSegments; public RelayCommand CommandAskClearFitSegments => commandAskClearFitSegments ?? (commandAskClearFitSegments = new RelayCommand(() => askClearFitSegments())); Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/MainViewModel.cs +20 −13 Original line number Diff line number Diff line Loading @@ -203,10 +203,10 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels } #region recent files private async Task addToRecentFilesAsync(string filepath, string token, string key) private async Task addToRecentFilesAsync(string filepath, string token, string suffix) { await Task.Run(() => recentFilesHelper.save(new RecentFileModel(filepath, token, key), key)); await tryReadRecentFilesProcedureAsync(); await Task.Run(() => recentFilesHelper.save(new RecentFileModel(filepath, token, suffix), suffix)); await tryReadRecentFilesProcedureAsync().ConfigureAwait(true); } private async Task<bool> tryReadUserPermissionsAsync() Loading Loading @@ -291,6 +291,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels isHideRecentFilesFlyoutRequired = false; // reset variable for next notification await readLabFileAsync(file, spectrumType, isFromRecentFileSelection: true); recentFilesHelper.moveToTopOfList(file.Path, spectrumType.ToString()); } } Loading @@ -305,6 +306,12 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels string token = storageItemsAccessHelper.save(file); addToRecentFilesAsync(file.Path, token, spectrumType.ToString()); } else { /* move selected item on top of the list of recent files */ recentFilesHelper.moveToTopOfList(file.Path, spectrumType.ToString()); await tryReadRecentFilesProcedureAsync().ConfigureAwait(true); } /* remember access to file */ storageItemsAccessHelper.save(spectrumType.ToString(), file); Loading @@ -312,17 +319,11 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels System.Diagnostics.Debug.WriteLine($"reading {spectrumType.ToString()} Spectrum type..."); if (spectrumType == SpectrumType.Raw) { /* clearing chart page and processedspectracontainer is not required on 1st file loading */ //if (!App.IsFirstRawFileReading) //{ /* clear chart page, if any chart is available */ await clearChartPageAsync(); /* clear all retrieved processed spectra, if any is available */ tryClearProcessedSpectra(); //} //App.IsFirstRawFileReading = false; } /* try reading the file to make spectrum available */ Loading Loading @@ -498,17 +499,23 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels { IsLoading = true; string key = FileExt.Xml.ToString(); string suffix = FileExt.Xml.ToString(); /* add selected file to recent files list and save the list update */ if (!isFromRecentFileSelection) { string token = storageItemsAccessHelper.save(file); addToRecentFilesAsync(file.Path, token, key).ConfigureAwait(true); addToRecentFilesAsync(file.Path, token, suffix).ConfigureAwait(true); } else { /* move selected item on top of the list of recent files */ recentFilesHelper.moveToTopOfList(file.Path, suffix); await tryReadRecentFilesProcedureAsync().ConfigureAwait(true); } /* remember access to file */ storageItemsAccessHelper.save(key, file); storageItemsAccessHelper.save(suffix, file); /* clear summaries in 'Lab files' tab, if any is present */ WorkingItems.LabSpectraSummaries.resetSummaryOfType(SpectrumType.Raw); Loading @@ -521,7 +528,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels UserControlsHelper.initUserControlsToBeOpened(); var xmlSpectrumFileReader = serviceProvider.GetRequiredService<XmlSpectrumFileReader>(); (IChartSpectrumModel spectrum, string exMsg) result = await xmlSpectrumFileReader.readFileAsync(key).ConfigureAwait(true); (IChartSpectrumModel spectrum, string exMsg) result = await xmlSpectrumFileReader.readFileAsync(suffix).ConfigureAwait(true); if (!string.IsNullOrEmpty(result.exMsg)) { Loading INAF.Apps.Uwp.SLabDataManager/ViewModels/UserControlViewModels/ChartPanels/SegmentsFitViewModel.cs +59 −10 Original line number Diff line number Diff line Loading @@ -38,8 +38,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels CheckSpectrumType = SpectrumType.ContinuumRemoved; init(); tryReadIsAddingPointsForContinuumRemovalAllowed(); } #region properties Loading Loading @@ -102,6 +100,28 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels } } private bool isSegmentsFitUserControlAutoOpenEnabled; public bool IsSegmentsFitUserControlAutoOpenEnabled { get { return isSegmentsFitUserControlAutoOpenEnabled; } set { if (SetProperty(ref isSegmentsFitUserControlAutoOpenEnabled, value)) saveIsSegmentsFitUserControlAutoOpenEnabled(); } } private bool isSegmentsFitsUserControlAutoOpenRequired; public bool IsSegmentsFitsUserControlAutoOpenRequired { get { return isSegmentsFitsUserControlAutoOpenRequired; } set { if (SetProperty(ref isSegmentsFitsUserControlAutoOpenRequired, value)) saveIsSegmentsFitsUserControlAutoOpenRequired(); } } private bool isSegmentHighlightRequired; public bool IsSegmentHighlightRequired { Loading @@ -116,13 +136,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels set { SetProperty(ref isSegmentLowlightRequired, value); } } private bool isSegmentsFitPanelAutoOpenEnabled; public bool IsSegmentsFitPanelAutoOpenEnabled { get { return isSegmentsFitPanelAutoOpenEnabled; } set { SetProperty(ref isSegmentsFitPanelAutoOpenEnabled, value); } } public List<PointModel> MissingPoints { get; private set; } private PointModel newPoint; Loading Loading @@ -185,6 +198,13 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels public void init() { if (!tryReadIsAddingPointsForContinuumRemovalAllowed()) IsAddingPointsForContinuumRemovalAllowed = false; /* segments fit */ if (!tryReadIsSegmentsFitUserControlAutoOpenEnabled()) IsSegmentsFitUserControlAutoOpenEnabled = true; AreFitSettingsReady = false; IsContinuumRemovedSaved = false; Loading Loading @@ -558,6 +578,12 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels isSegmentHighlightRequired = false; } public void raiseIsSegmentsFitsUserControlAutoOpenRequired() { IsSegmentsFitsUserControlAutoOpenRequired = true; isSegmentsFitsUserControlAutoOpenRequired = false; // DO NOT UNCOMMENT THIS! } public void raiseIsSegmentsLowlightRequired() { IsSegmentLowlightRequired = true; Loading @@ -577,14 +603,37 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels settingsHelper.save(nameof(IsAddingPointsForContinuumRemovalAllowed), IsAddingPointsForContinuumRemovalAllowed); } private void saveIsSegmentsFitUserControlAutoOpenEnabled() { settingsHelper.save(nameof(IsSegmentsFitUserControlAutoOpenEnabled), IsSegmentsFitUserControlAutoOpenEnabled); } private void saveIsSegmentsFitsUserControlAutoOpenRequired() { settingsHelper.save(nameof(IsSegmentsFitsUserControlAutoOpenRequired), IsSegmentsFitsUserControlAutoOpenRequired); } private void saveNumOfPointsForMissingPoints(int numOfPointsForMissingPoints) { settingsHelper.save(Constants.Constants.NUM_OF_POINTS_FOR_MISSING_POINTS, numOfPointsForMissingPoints); } public void tryReadIsAddingPointsForContinuumRemovalAllowed() public bool tryReadIsAddingPointsForContinuumRemovalAllowed() { if (!settingsHelper.contains(nameof(IsAddingPointsForContinuumRemovalAllowed))) return false; IsAddingPointsForContinuumRemovalAllowed = settingsHelper.getValue<bool>(nameof(IsAddingPointsForContinuumRemovalAllowed)); return true; } private bool tryReadIsSegmentsFitUserControlAutoOpenEnabled() { if (!settingsHelper.contains(nameof(IsSegmentsFitUserControlAutoOpenEnabled))) return false; IsSegmentsFitUserControlAutoOpenEnabled = settingsHelper.getValue<bool>(nameof(IsSegmentsFitUserControlAutoOpenEnabled)); return true; } public void tryReadNumOfPointsForMissingPoints(int numOfPointsForMissingPoints) Loading Loading
INAF.Apps.Uwp.SLabDataManager/App.xaml.cs +0 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ namespace INAF.Apps.Uwp.SLabDataManager public static Dictionary<string, object> AppDictionary; public static Dictionary<UIContext, AppWindow> AppWindows; public static bool IsFirstRawFileReading; private ActivationService ActivationService { Loading Loading @@ -111,8 +110,6 @@ namespace INAF.Apps.Uwp.SLabDataManager private void initServices() { IsFirstRawFileReading = true; /* create app dictionary shared across all app */ AppDictionary = new Dictionary<string, object>(); Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModel.cs +0 −32 Original line number Diff line number Diff line Loading @@ -78,8 +78,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels if (!App.AppDictionary.TryAdd(Constants.Constants.LAST_PAGE, nameof(ChartPage))) App.AppDictionary[Constants.Constants.LAST_PAGE] = nameof(ChartPage); saveIsSegmentsFitUserControlAutoOpenEnabled(); clear(); await base.OnNavigatingFrom(e); Loading Loading @@ -185,20 +183,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels set { SetProperty(ref isHideAlignmentFlyoutRequired, value); } } private bool isSegmentsFitsUserControlAutoOpenEnabled; public bool IsSegmentsFitsUserControlAutoOpenEnabled { get { return isSegmentsFitsUserControlAutoOpenEnabled; } set { SetProperty(ref isSegmentsFitsUserControlAutoOpenEnabled, value); } } private bool isSegmentsFitsUserControlAutoOpenRequired; public bool IsSegmentsFitsUserControlAutoOpenRequired { get { return isSegmentsFitsUserControlAutoOpenRequired; } set { SetProperty(ref isSegmentsFitsUserControlAutoOpenRequired, value); } } private SegmentFitModel selectedSegment; public SegmentFitModel SelectedSegment { Loading Loading @@ -280,12 +264,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels IsDisableFitFocusRequired = true; isDisableFitFocusRequired = false; } private void raiseIsSegmentsFitsUserControlAutoOpenRequired() { IsSegmentsFitsUserControlAutoOpenRequired = true; isSegmentsFitsUserControlAutoOpenRequired = false; // DO NOT UNCOMMENT THIS! } #endregion #region methods Loading Loading @@ -321,16 +299,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels IsDisableFitFocusRequired = false; IsFocusRequired = false; ///* segments fit */ //if (!tryReadIsSegmentsFitsUserControlAvailable()) // IsSegmentsFitsUserControlAvailable = false; if (!tryReadIsSegmentsFitUserControlAutoOpenEnabled()) IsSegmentsFitsUserControlAutoOpenEnabled = true; if (!tryReadIsSegmentsFitsUserControlAutoOpenRequired()) IsSegmentsFitsUserControlAutoOpenRequired = false; /* dialogs */ IsOperationDialogRequired = false; DialogMessage = string.Empty; Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/ChartViewModelSegmentsFit.cs +1 −41 Original line number Diff line number Diff line Loading @@ -135,7 +135,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels UserControlsHelper.RequiredUserControlName = nameof(SegmentsFitUserControl).FirstCharToLowerCase(); // this is used to select the right tab in ChartPage->tabViewPanels, if shown if (isRaiseEventAllowed) raiseIsSegmentsFitsUserControlAutoOpenRequired(); SegmentsFitViewModel.raiseIsSegmentsFitsUserControlAutoOpenRequired(); /* fit current segment with selected fit method */ if (segmentFitModel.SelectedFitMethod == null) Loading Loading @@ -366,46 +366,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels } #endregion #region segments-fit panel private void saveIsSegmentsFitUserControlAutoOpenEnabled() { settingsHelper.save(nameof(IsSegmentsFitsUserControlAutoOpenEnabled), IsSegmentsFitsUserControlAutoOpenEnabled.ToString()); } private void saveIsSegmentsFitsUserControlAutoOpenRequired() { settingsHelper.save(nameof(IsSegmentsFitsUserControlAutoOpenRequired), IsSegmentsFitsUserControlAutoOpenRequired.ToString()); } public bool tryReadIsSegmentsFitUserControlAutoOpenEnabled() { bool isFound = false; string value = settingsHelper.get(nameof(IsSegmentsFitsUserControlAutoOpenEnabled)); if (!string.IsNullOrEmpty(value)) { IsSegmentsFitsUserControlAutoOpenEnabled = value.ToBool(); isFound = true; } return isFound; } public bool tryReadIsSegmentsFitsUserControlAutoOpenRequired() { bool isFound = false; string value = settingsHelper.get(nameof(IsSegmentsFitsUserControlAutoOpenRequired)); if (!string.IsNullOrEmpty(value)) { IsSegmentsFitsUserControlAutoOpenRequired = value.ToBool(); isFound = true; } return isFound; } #endregion #region commands private RelayCommand commandAskClearFitSegments; public RelayCommand CommandAskClearFitSegments => commandAskClearFitSegments ?? (commandAskClearFitSegments = new RelayCommand(() => askClearFitSegments())); Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/MainViewModel.cs +20 −13 Original line number Diff line number Diff line Loading @@ -203,10 +203,10 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels } #region recent files private async Task addToRecentFilesAsync(string filepath, string token, string key) private async Task addToRecentFilesAsync(string filepath, string token, string suffix) { await Task.Run(() => recentFilesHelper.save(new RecentFileModel(filepath, token, key), key)); await tryReadRecentFilesProcedureAsync(); await Task.Run(() => recentFilesHelper.save(new RecentFileModel(filepath, token, suffix), suffix)); await tryReadRecentFilesProcedureAsync().ConfigureAwait(true); } private async Task<bool> tryReadUserPermissionsAsync() Loading Loading @@ -291,6 +291,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels isHideRecentFilesFlyoutRequired = false; // reset variable for next notification await readLabFileAsync(file, spectrumType, isFromRecentFileSelection: true); recentFilesHelper.moveToTopOfList(file.Path, spectrumType.ToString()); } } Loading @@ -305,6 +306,12 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels string token = storageItemsAccessHelper.save(file); addToRecentFilesAsync(file.Path, token, spectrumType.ToString()); } else { /* move selected item on top of the list of recent files */ recentFilesHelper.moveToTopOfList(file.Path, spectrumType.ToString()); await tryReadRecentFilesProcedureAsync().ConfigureAwait(true); } /* remember access to file */ storageItemsAccessHelper.save(spectrumType.ToString(), file); Loading @@ -312,17 +319,11 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels System.Diagnostics.Debug.WriteLine($"reading {spectrumType.ToString()} Spectrum type..."); if (spectrumType == SpectrumType.Raw) { /* clearing chart page and processedspectracontainer is not required on 1st file loading */ //if (!App.IsFirstRawFileReading) //{ /* clear chart page, if any chart is available */ await clearChartPageAsync(); /* clear all retrieved processed spectra, if any is available */ tryClearProcessedSpectra(); //} //App.IsFirstRawFileReading = false; } /* try reading the file to make spectrum available */ Loading Loading @@ -498,17 +499,23 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels { IsLoading = true; string key = FileExt.Xml.ToString(); string suffix = FileExt.Xml.ToString(); /* add selected file to recent files list and save the list update */ if (!isFromRecentFileSelection) { string token = storageItemsAccessHelper.save(file); addToRecentFilesAsync(file.Path, token, key).ConfigureAwait(true); addToRecentFilesAsync(file.Path, token, suffix).ConfigureAwait(true); } else { /* move selected item on top of the list of recent files */ recentFilesHelper.moveToTopOfList(file.Path, suffix); await tryReadRecentFilesProcedureAsync().ConfigureAwait(true); } /* remember access to file */ storageItemsAccessHelper.save(key, file); storageItemsAccessHelper.save(suffix, file); /* clear summaries in 'Lab files' tab, if any is present */ WorkingItems.LabSpectraSummaries.resetSummaryOfType(SpectrumType.Raw); Loading @@ -521,7 +528,7 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels UserControlsHelper.initUserControlsToBeOpened(); var xmlSpectrumFileReader = serviceProvider.GetRequiredService<XmlSpectrumFileReader>(); (IChartSpectrumModel spectrum, string exMsg) result = await xmlSpectrumFileReader.readFileAsync(key).ConfigureAwait(true); (IChartSpectrumModel spectrum, string exMsg) result = await xmlSpectrumFileReader.readFileAsync(suffix).ConfigureAwait(true); if (!string.IsNullOrEmpty(result.exMsg)) { Loading
INAF.Apps.Uwp.SLabDataManager/ViewModels/UserControlViewModels/ChartPanels/SegmentsFitViewModel.cs +59 −10 Original line number Diff line number Diff line Loading @@ -38,8 +38,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels CheckSpectrumType = SpectrumType.ContinuumRemoved; init(); tryReadIsAddingPointsForContinuumRemovalAllowed(); } #region properties Loading Loading @@ -102,6 +100,28 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels } } private bool isSegmentsFitUserControlAutoOpenEnabled; public bool IsSegmentsFitUserControlAutoOpenEnabled { get { return isSegmentsFitUserControlAutoOpenEnabled; } set { if (SetProperty(ref isSegmentsFitUserControlAutoOpenEnabled, value)) saveIsSegmentsFitUserControlAutoOpenEnabled(); } } private bool isSegmentsFitsUserControlAutoOpenRequired; public bool IsSegmentsFitsUserControlAutoOpenRequired { get { return isSegmentsFitsUserControlAutoOpenRequired; } set { if (SetProperty(ref isSegmentsFitsUserControlAutoOpenRequired, value)) saveIsSegmentsFitsUserControlAutoOpenRequired(); } } private bool isSegmentHighlightRequired; public bool IsSegmentHighlightRequired { Loading @@ -116,13 +136,6 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels set { SetProperty(ref isSegmentLowlightRequired, value); } } private bool isSegmentsFitPanelAutoOpenEnabled; public bool IsSegmentsFitPanelAutoOpenEnabled { get { return isSegmentsFitPanelAutoOpenEnabled; } set { SetProperty(ref isSegmentsFitPanelAutoOpenEnabled, value); } } public List<PointModel> MissingPoints { get; private set; } private PointModel newPoint; Loading Loading @@ -185,6 +198,13 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels public void init() { if (!tryReadIsAddingPointsForContinuumRemovalAllowed()) IsAddingPointsForContinuumRemovalAllowed = false; /* segments fit */ if (!tryReadIsSegmentsFitUserControlAutoOpenEnabled()) IsSegmentsFitUserControlAutoOpenEnabled = true; AreFitSettingsReady = false; IsContinuumRemovedSaved = false; Loading Loading @@ -558,6 +578,12 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels isSegmentHighlightRequired = false; } public void raiseIsSegmentsFitsUserControlAutoOpenRequired() { IsSegmentsFitsUserControlAutoOpenRequired = true; isSegmentsFitsUserControlAutoOpenRequired = false; // DO NOT UNCOMMENT THIS! } public void raiseIsSegmentsLowlightRequired() { IsSegmentLowlightRequired = true; Loading @@ -577,14 +603,37 @@ namespace INAF.Apps.Uwp.SLabDataManager.ViewModels.UserControlViewModels settingsHelper.save(nameof(IsAddingPointsForContinuumRemovalAllowed), IsAddingPointsForContinuumRemovalAllowed); } private void saveIsSegmentsFitUserControlAutoOpenEnabled() { settingsHelper.save(nameof(IsSegmentsFitUserControlAutoOpenEnabled), IsSegmentsFitUserControlAutoOpenEnabled); } private void saveIsSegmentsFitsUserControlAutoOpenRequired() { settingsHelper.save(nameof(IsSegmentsFitsUserControlAutoOpenRequired), IsSegmentsFitsUserControlAutoOpenRequired); } private void saveNumOfPointsForMissingPoints(int numOfPointsForMissingPoints) { settingsHelper.save(Constants.Constants.NUM_OF_POINTS_FOR_MISSING_POINTS, numOfPointsForMissingPoints); } public void tryReadIsAddingPointsForContinuumRemovalAllowed() public bool tryReadIsAddingPointsForContinuumRemovalAllowed() { if (!settingsHelper.contains(nameof(IsAddingPointsForContinuumRemovalAllowed))) return false; IsAddingPointsForContinuumRemovalAllowed = settingsHelper.getValue<bool>(nameof(IsAddingPointsForContinuumRemovalAllowed)); return true; } private bool tryReadIsSegmentsFitUserControlAutoOpenEnabled() { if (!settingsHelper.contains(nameof(IsSegmentsFitUserControlAutoOpenEnabled))) return false; IsSegmentsFitUserControlAutoOpenEnabled = settingsHelper.getValue<bool>(nameof(IsSegmentsFitUserControlAutoOpenEnabled)); return true; } public void tryReadNumOfPointsForMissingPoints(int numOfPointsForMissingPoints) Loading