aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs60
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;