diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-11-13 11:59:51 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2019-11-13 11:59:51 +0200 |
| commit | b294fd44000766de11ce6c0e2d82d2fae81c82b9 (patch) | |
| tree | a49292df75c5ab265ff3f7f3254e9504db1f9420 /Software/Visual_Studio | |
| parent | 81ad4efdc9ec8593a75bf68fb3b39b97aa35aaa6 (diff) | |
| download | Tango-b294fd44000766de11ce6c0e2d82d2fae81c82b9.tar.gz Tango-b294fd44000766de11ce6c0e2d82d2fae81c82b9.zip | |
Restored job liquid quantity validation to start of procedure.
Diffstat (limited to 'Software/Visual_Studio')
12 files changed, 48 insertions, 90 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 93baf3b9d..fd20a0b1c 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 @@ -1479,39 +1479,15 @@ namespace Tango.MachineStudio.Developer.ViewModels JobHandler.Failed += (x, ex) => { - if (ex is InsufficientLiquidQuantityException) - { - InvokeUI(() => - { - _notification.ShowModalDialog<InsufficientLiquidQuantityViewVM, InsufficientLiquidQuantityView>(new InsufficientLiquidQuantityViewVM(ex as InsufficientLiquidQuantityException), (_) => - { - - MachineOperator.EnableJobLiquidQuantityValidation = false; - StartJob(); - - }, () => - { - SetJobFailed(); + LogManager.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name)); + _eventLogger.Log(ex, String.Format("Job {0} has failed.", RunningJob.Name)); + SetJobFailed(); - InvokeUI(() => - { - StopRecordingIfInProgress(); - }); - }); - }); - } - else + InvokeUI(() => { - 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(); - }); - } + _notification.ShowError("Job failed. " + ex.FlattenMessage()); + StopRecordingIfInProgress(); + }); }; JobHandler.Finalizing += (_, __) => @@ -1543,6 +1519,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); diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml index f0e9dc29c..9bf76c026 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/InsufficientLiquidQuantityView.xaml @@ -6,7 +6,7 @@ xmlns:vm="clr-namespace:Tango.MachineStudio.Developer.ViewModels" xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views" mc:Ignorable="d" - Height="450" Width="800" Background="{StaticResource WhiteBackgroundBrush}" d:DataContext="{d:DesignInstance Type=vm:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}"> + Height="450" Width="800" d:DataContext="{d:DesignInstance Type=vm:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}"> <Grid Margin="10"> <DockPanel> <StackPanel DockPanel.Dock="Top"> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index 65d8ecba3..3092b60c1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -116,10 +116,6 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> - <Page Include="Dialogs\InsufficientLiquidQuantityView.xaml"> - <Generator>MSBuild:Compile</Generator> - <SubType>Designer</SubType> - </Page> <Page Include="Dialogs\JobCreationView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> @@ -215,10 +211,6 @@ <Compile Include="Dialogs\CatalogSelectionView.xaml.cs"> <DependentUpon>CatalogSelectionView.xaml</DependentUpon> </Compile> - <Compile Include="Dialogs\InsufficientLiquidQuantityView.xaml.cs"> - <DependentUpon>InsufficientLiquidQuantityView.xaml</DependentUpon> - </Compile> - <Compile Include="Dialogs\InsufficientLiquidQuantityViewVM.cs" /> <Compile Include="Dialogs\JobCreationView.xaml.cs"> <DependentUpon>JobCreationView.xaml</DependentUpon> </Compile> @@ -496,7 +488,7 @@ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs index b98cde7dd..58aa1e841 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobProgressViewVM.cs @@ -144,27 +144,10 @@ namespace Tango.PPC.Jobs.ViewModels e.JobHandler.StatusChanged += JobHandler_StatusChanged; e.JobHandler.SpoolChangeRequired += JobHandler_SpoolChangeRequired; e.JobHandler.Stopped += JobHandler_Stopped; - e.JobHandler.Failed += JobHandler_Failed; _stop_job_btn.Push(); } - private void JobHandler_Failed(object sender, Exception ex) - { - if (ex is InsufficientLiquidQuantityException) - { - InvokeUI(async () => - { - await NotificationProvider.ShowDialog(new InsufficientLiquidQuantityViewVM(ex as InsufficientLiquidQuantityException)); - - if (IsVisible) - { - await NavigationManager.NavigateBack(); - } - }); - } - } - /// <summary> /// Handles the SpoolChangeRequired event of the JobHandler. /// </summary> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index ebdd18aeb..a4cf491ba 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -651,6 +651,10 @@ namespace Tango.PPC.Jobs.ViewModels var handler = await PrintingManager.Print(Job, _db); await NavigationManager.NavigateTo<JobsModule>(nameof(JobProgressView)); } + catch (InsufficientLiquidQuantityException) + { + //Ignore.. + } catch (Exception ex) { LogManager.Log(ex, "Could not start the current job."); diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/InsufficientLiquidQuantityView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml index 90492ce9f..8b8983fa5 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/InsufficientLiquidQuantityView.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml @@ -1,10 +1,10 @@ -<UserControl x:Class="Tango.PPC.Jobs.Dialogs.InsufficientLiquidQuantityView" +<UserControl x:Class="Tango.PPC.UI.Dialogs.InsufficientLiquidQuantityView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" - xmlns:local="clr-namespace:Tango.PPC.Jobs.Dialogs" + xmlns:local="clr-namespace:Tango.PPC.UI.Dialogs" mc:Ignorable="d" Background="{StaticResource TangoPrimaryBackgroundBrush}" Width="700" Height="800" d:DataContext="{d:DesignInstance Type=local:InsufficientLiquidQuantityViewVM, IsDesignTimeCreatable=False}"> <Grid Margin="20"> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/InsufficientLiquidQuantityView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs index eabff89b4..9ec1eec0e 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/InsufficientLiquidQuantityView.xaml.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityView.xaml.cs @@ -15,7 +15,7 @@ using System.Windows.Shapes; using Tango.Integration.Operation; using static Tango.Integration.Operation.InsufficientLiquidQuantityException; -namespace Tango.PPC.Jobs.Dialogs +namespace Tango.PPC.UI.Dialogs { /// <summary> /// Interaction logic for InsufficientLiquidQuantityView.xaml diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/InsufficientLiquidQuantityViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs index e8cd8df85..8b15d2e00 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/InsufficientLiquidQuantityViewVM.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/InsufficientLiquidQuantityViewVM.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Tango.Integration.Operation; using Tango.SharedUI; -namespace Tango.PPC.Jobs.Dialogs +namespace Tango.PPC.UI.Dialogs { public class InsufficientLiquidQuantityViewVM : DialogViewVM { diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs index 21c68d3e6..56ec2fa7e 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Printing/DefaultPrintingManager.cs @@ -56,8 +56,16 @@ namespace Tango.PPC.UI.Printing #if STUBPRINT handler = await _machineProvider.MachineOperator.PrintStub(job); #else - - handler = await _machineProvider.MachineOperator.Print(job); + try + { + handler = await _machineProvider.MachineOperator.Print(job); + } + catch (InsufficientLiquidQuantityException ex) + { + LogManager.Log(ex); + await _notificationProvider.ShowDialog(new InsufficientLiquidQuantityViewVM(ex)); + throw ex; + } #endif handler.Completed += async (x, e) => @@ -105,13 +113,9 @@ namespace Tango.PPC.UI.Printing }; handler.Failed += async (x, e) => { - if (e is InsufficientLiquidQuantityException) - { - return; - } - try { + job.JobStatus = JobStatuses.Disrupted; if (!context.IsDisposed) diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj index 92576abde..1cabc959d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj @@ -128,6 +128,10 @@ <Compile Include="Dialogs\CartridgeValidationView.xaml.cs"> <DependentUpon>CartridgeValidationView.xaml</DependentUpon> </Compile> + <Compile Include="Dialogs\InsufficientLiquidQuantityView.xaml.cs"> + <DependentUpon>InsufficientLiquidQuantityView.xaml</DependentUpon> + </Compile> + <Compile Include="Dialogs\InsufficientLiquidQuantityViewVM.cs" /> <Compile Include="Dialogs\ScreenLockView.xaml.cs"> <DependentUpon>ScreenLockView.xaml</DependentUpon> </Compile> @@ -209,6 +213,10 @@ <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> + <Page Include="Dialogs\InsufficientLiquidQuantityView.xaml"> + <Generator>MSBuild:Compile</Generator> + <SubType>Designer</SubType> + </Page> <Page Include="Dialogs\ScreenLockView.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> @@ -579,7 +587,7 @@ if $(ConfigurationName) == Release del *.xml</PostBuildEvent> </PropertyGroup> <ProjectExtensions> <VisualStudio> - <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" /> + <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" /> </VisualStudio> </ProjectExtensions> </Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest index d72e75011..efc5f8179 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> + <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />--> </requestedPrivileges> </security> </trustInfo> diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index d6d926800..451ed8219 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -1916,25 +1916,6 @@ namespace Tango.Integration.Operation return; } - if (EnableJobLiquidQuantityValidation) - { - try - { - //ValidateJobLiquidQuantity(originalJob, processParameters, job.Machine.Configuration); - var ticketForValidation = ticket.Clone(); - ticketForValidation.NumberOfUnits = (uint)originalJob.NumberOfUnits; - ValidateJobLiquidQuantity(ticketForValidation, processParameters, job.Machine.Configuration); - } - catch (Exception ex) - { - Status = MachineStatuses.ReadyToDye; - PrintingFailed?.Invoke(this, new PrintingFailedEventArgs(handler, clonedJob, ex)); - PrintingEnded?.Invoke(this, new PrintingEventArgs(handler, clonedJob)); - handler.RaiseFailed(ex); - return; - } - } - var segs = new List<JobSegment>(); if (JobUnitsMethod == JobUnitsMethods.Operator) |
