aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-11-06 18:06:45 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-11-06 18:06:45 +0200
commitc698425b1ab832fe351aff257815709c01950fc3 (patch)
tree53e1c6439d54d4b4164b7e5f478066c1b00c6a25 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels/MainViewVM.cs
parent202c532e87e8114151e9b38982dcc171347a78ce (diff)
downloadTango-c698425b1ab832fe351aff257815709c01950fc3.tar.gz
Tango-c698425b1ab832fe351aff257815709c01950fc3.zip
Implemented liquid quantity validation on PPC and MS.
Improved PPC full control view.
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.cs48
1 files changed, 31 insertions, 17 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 3a1f3fb11..c9483b9a2 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
@@ -1481,15 +1481,39 @@ namespace Tango.MachineStudio.Developer.ViewModels
JobHandler.Failed += (x, ex) =>
{
- LogManager.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name));
- _eventLogger.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name));
- SetJobFailed();
+ if (ex is InsufficientLiquidQuantityException)
+ {
+ InvokeUI(() =>
+ {
+ _notification.ShowModalDialog<InsufficientLiquidQuantityViewVM, InsufficientLiquidQuantityView>(new InsufficientLiquidQuantityViewVM(ex as InsufficientLiquidQuantityException), (_) =>
+ {
- InvokeUI(() =>
+ MachineOperator.EnableJobLiquidQuantityValidation = false;
+ StartJob();
+
+ }, () =>
+ {
+ SetJobFailed();
+
+ InvokeUI(() =>
+ {
+ StopRecordingIfInProgress();
+ });
+ });
+ });
+ }
+ else
{
- _notification.ShowError("Job failed. " + ex.FlattenMessage());
- StopRecordingIfInProgress();
- });
+ LogManager.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name));
+ _eventLogger.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name));
+ SetJobFailed();
+
+ InvokeUI(() =>
+ {
+ _notification.ShowError("Job failed. " + ex.FlattenMessage());
+ StopRecordingIfInProgress();
+ });
+ }
};
JobHandler.Finalizing += (_, __) =>
@@ -1521,16 +1545,6 @@ 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);