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/PPC | |
| 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/PPC')
9 files changed, 30 insertions, 39 deletions
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> |
