aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-09-26 12:34:25 +0300
committerShlomo Hecht <shlomo@twine-s.com>2019-09-26 12:34:25 +0300
commit189f45f48fbf1181cc9af20c93901fa9cedb9fb1 (patch)
treecb18927a213fdf73ffc4b6197220db97a87984fe /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
parent387c1ee40b7bce5edd92491dc8d9edeb30a02524 (diff)
parent60186d68fdbb9c3cc1a6f83c12228db90b48488d (diff)
downloadTango-189f45f48fbf1181cc9af20c93901fa9cedb9fb1.tar.gz
Tango-189f45f48fbf1181cc9af20c93901fa9cedb9fb1.zip
version 1.4.5.1
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.cs70
1 files changed, 70 insertions, 0 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 3f551c866..2d04866d8 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
@@ -795,6 +816,8 @@ namespace Tango.MachineStudio.Developer.ViewModels
{
Settings = SettingsManager.Default.GetOrCreate<DeveloperModuleSettings>();
+ AutoProcessSelection = Settings.AutoProcessSelection;
+
SelectedJobs = new ObservableCollection<Job>();
JobEvents = new ObservableCollection<MachinesEvent>();
@@ -864,6 +887,23 @@ namespace Tango.MachineStudio.Developer.ViewModels
catch { }
}
+ if (AutoProcessSelection && IsJobVisible && IsVisible && ActiveJob != null && ActiveJob.Segments != null && !_rml_has_no_cct && !_disable_gamut_check)
+ {
+ 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 +1378,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;
@@ -1446,6 +1506,16 @@ namespace Tango.MachineStudio.Developer.ViewModels
//Finally Canceled..
};
}
+ catch (InsufficientLiquidQuantityException ex)
+ {
+ _notification.ShowModalDialog<InsufficientLiquidQuantityViewVM, InsufficientLiquidQuantityView>(new InsufficientLiquidQuantityViewVM(ex), (x) =>
+ {
+
+ MachineOperator.EnableJobLiquidQuantityValidation = false;
+ StartJob();
+
+ }, () => { });
+ }
catch (Exception ex)
{
LogManager.Log(ex);