From c698425b1ab832fe351aff257815709c01950fc3 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 6 Nov 2019 18:06:45 +0200 Subject: Implemented liquid quantity validation on PPC and MS. Improved PPC full control view. --- .../ViewModels/MainViewVM.cs | 48 ++++++++++++++-------- 1 file changed, 31 insertions(+), 17 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels') 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(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(new InsufficientLiquidQuantityViewVM(ex), (x) => - { - - MachineOperator.EnableJobLiquidQuantityValidation = false; - StartJob(); - - }, () => { }); - } catch (Exception ex) { LogManager.Log(ex); -- cgit v1.3.1 From 1c9bea6d04dcfbfd1fbf0e1c437c110bc7dafa3e Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 7 Nov 2019 17:39:00 +0200 Subject: Fixed issue with job completion on emulator. Added liquid volumes grid full step. Added full step to dispensing calculations. Fixed issue with gradient generation progress on MS. Worked on software items doc. --- .../ViewModels/MainViewVM.cs | 12 +++---- .../Views/JobView.xaml | 35 +++++++++++++++++++++ .../Twine Software Items (version 1).xlsb.xlsx | Bin 18776 -> 20410 bytes .../Tango.BL/Dispensing/DispensingCalcBase.cs | 10 ++++++ .../Tango.BL/Dispensing/DispensingCalcService.cs | 11 +++++++ .../Tango.BL/Dispensing/IDispensingCalc.cs | 7 +++++ .../Dispensing/TransparentLiquidDispensingCalc.cs | 6 ++-- Software/Visual_Studio/Tango.BL/LiquidVolume.cs | 12 ++++++- .../Tango.Emulations/Emulators/MachineEmulator.cs | 2 +- .../Tango.Integration/Operation/MachineOperator.cs | 9 +++++- 10 files changed, 91 insertions(+), 13 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/ViewModels') 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 c9483b9a2..fec02529b 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 @@ -1034,6 +1034,11 @@ namespace Tango.MachineStudio.Developer.ViewModels { var percent = (e.Progress / e.Total * 100d); + if (_preparingTaskItem != null) + { + _preparingTaskItem.Message = $"Preparing job for printing {(e.Progress / e.Total * 100d).ToString("0.0")}%..."; + } + if (_preparingTaskItem == null && percent == 0) { _preparingTaskItem = _notification.PushTaskItem("Preparing job for printing..."); @@ -1043,13 +1048,6 @@ namespace Tango.MachineStudio.Developer.ViewModels _preparingTaskItem.Pop(); _preparingTaskItem = null; } - else - { - if (_preparingTaskItem != null) - { - _preparingTaskItem.Message = $"Preparing job for printing {(e.Progress / e.Total * 100d).ToString("0.0")}%..."; - } - } } private void MachineOperator_ResumingJob(object sender, ResumingJobEventArgs e) diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 3bda86036..e1bbad6a7 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -1179,6 +1179,41 @@ + + + + + + +