diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-09-24 12:07:14 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-09-24 12:07:14 +0300 |
| commit | cb769a96ca8841ced9cff6ed4a6c99939e139610 (patch) | |
| tree | c1e3e51f1ce32961592abd0b98223575cdf8a29d /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels | |
| parent | b5c5758e431077d84fb53a3ff62f8e751fca2731 (diff) | |
| download | Tango-cb769a96ca8841ced9cff6ed4a6c99939e139610.tar.gz Tango-cb769a96ca8841ced9cff6ed4a6c99939e139610.zip | |
Implemented auto process selection on Research module.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs index c2fad9d87..f5313d4cd 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs @@ -552,14 +552,35 @@ namespace Tango.MachineStudio.Developer.ViewModels set { _enableColorConversion = value; RaisePropertyChangedAuto(); } } + /// <summary> + /// Gets or sets the authentication provider. + /// </summary> public IAuthenticationProvider AuthenticationProvider { get; set; } + /// <summary> + /// Gets or sets the module settings. + /// </summary> public DeveloperModuleSettings Settings { get { return _settings; } set { _settings = value; RaisePropertyChangedAuto(); } } + private bool _autoProcessSelection; + /// <summary> + /// Gets or sets a value indicating whether [automatic process selection]. + /// </summary> + public bool AutoProcessSelection + { + get { return _autoProcessSelection; } + set + { + _autoProcessSelection = value; + RaisePropertyChangedAuto(); + Settings.AutoProcessSelection = _autoProcessSelection; + } + } + #endregion #region Commands @@ -864,6 +885,23 @@ namespace Tango.MachineStudio.Developer.ViewModels catch { } } + if (AutoProcessSelection) + { + try + { + var recommendedProcess = _converter.GetRecommendedProcessParameters(ActiveJob, RmlProcessParametersTableGroup); + + if (recommendedProcess != null && recommendedProcess != SelectedProcessParametersTable) + { + SelectedProcessParametersTable = recommendedProcess; + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error resolving recommended process parameters."); + } + } + Thread.Sleep(500); } } @@ -1338,6 +1376,26 @@ namespace Tango.MachineStudio.Developer.ViewModels stop.SetLiquidVolumes(SelectedMachine.Configuration, SelectedRML, SelectedProcessParametersTable); } + if (AutoProcessSelection) + { + LogManager.Log("Auto process parameters selection enabled. Trying to resolve the recommended process parameters..."); + try + { + var recommendedProcess = _converter.GetRecommendedProcessParameters(ActiveJob, RmlProcessParametersTableGroup); + + if (recommendedProcess != null && recommendedProcess != SelectedProcessParametersTable) + { + SelectedProcessParametersTable = recommendedProcess; + } + } + catch (Exception ex) + { + LogManager.Log(ex, "Error resolving recommended process parameters."); + _notification.ShowError("An error occurred while trying to resolve the recommended process parameters.Please try to disable the auto selection."); + return; + } + } + JobEvents.Clear(); IsJobFailed = false; IsJobCanceled = false; @@ -1448,7 +1506,7 @@ namespace Tango.MachineStudio.Developer.ViewModels } catch (InsufficientLiquidQuantityException ex) { - _notification.ShowModalDialog<InsufficientLiquidQuantityViewVM, InsufficientLiquidQuantityView>(new InsufficientLiquidQuantityViewVM(ex), (x) => + _notification.ShowModalDialog<InsufficientLiquidQuantityViewVM, InsufficientLiquidQuantityView>(new InsufficientLiquidQuantityViewVM(ex), (x) => { MachineOperator.EnableJobLiquidQuantityValidation = false; |
