diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-12-26 21:33:29 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-12-26 21:33:29 +0200 |
| commit | e89f04cbdda4e34baef11d43c9f812773911a33c (patch) | |
| tree | bc7d1a8684d7e7487b80c9ab3801b3bc988cbb65 /Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs | |
| parent | 2bb75ed18045f59ae694adf04439e0297f77a89f (diff) | |
| download | Tango-e89f04cbdda4e34baef11d43c9f812773911a33c.tar.gz Tango-e89f04cbdda4e34baef11d43c9f812773911a33c.zip | |
Implemented Waste Replace Handling.
Implemented Job Stop on Out Of Range on MachineOperator.
Implemented job upload error on Volumes out of range.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs')
3 files changed, 134 insertions, 0 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementView.xaml new file mode 100644 index 000000000..6279ce81c --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementView.xaml @@ -0,0 +1,37 @@ +<UserControl x:Class="Tango.PPC.UI.Dialogs.WasteReplacementView" + 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.UI.Dialogs" + mc:Ignorable="d" + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" Width="570" Height="700" d:DataContext="{d:DesignInstance Type=local:WasteReplacementViewVM, IsDesignTimeCreatable=False}"> + <Grid Margin="20"> + <DockPanel> + <Grid DockPanel.Dock="Bottom"> + <touch:TouchButton HorizontalAlignment="Left" CornerRadius="25" Command="{Binding CloseCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">LATER</touch:TouchButton> + <touch:TouchButton HorizontalAlignment="Right" CornerRadius="25" Command="{Binding OKCommand}" Style="{StaticResource TangoHollowButton}" Width="150" Height="50" VerticalAlignment="Bottom">DONE</touch:TouchButton> + </Grid> + <StackPanel DockPanel.Dock="Top"> + <Image Source="/Images/waste_replace.png" RenderOptions.BitmapScalingMode="Fant" Stretch="Uniform" Height="120"></Image> + <TextBlock HorizontalAlignment="Center" Margin="0 20 0 0" FontSize="{StaticResource TangoHeaderFontSize}">Replace Waste Cartridge</TextBlock> + <TextBlock Margin="20 10" HorizontalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center"> + <Run>The waste cartridge is close to full and needs to be replaced.</Run> + <LineBreak/> + <Run>Please open the cartridge door, insert two empty cartridges then close the door.</Run> + <LineBreak/> + <LineBreak/> + <Run>When finish press "DONE".</Run> + </TextBlock> + </StackPanel> + <Grid> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="219*"/> + <ColumnDefinition Width="311*"/> + </Grid.ColumnDefinitions> + + </Grid> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementView.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementView.xaml.cs new file mode 100644 index 000000000..5bddf160b --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.PPC.UI.Dialogs +{ + /// <summary> + /// Interaction logic for SpoolReplaceView.xaml + /// </summary> + public partial class WasteReplacementView : UserControl + { + public WasteReplacementView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementViewVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementViewVM.cs new file mode 100644 index 000000000..0e2f4bb56 --- /dev/null +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementViewVM.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.Core.DI; +using Tango.PMR.Diagnostics; +using Tango.PPC.Common.Connection; +using Tango.SharedUI; + +namespace Tango.PPC.UI.Dialogs +{ + public class WasteReplacementViewVM : DialogViewVM + { + private bool _doorClosed; + private bool _doorOpened; + + [TangoInject] + private IMachineProvider MachineProvider { get; set; } + + public WasteReplacementViewVM() + { + TangoIOC.Default.Inject(this); + MachineProvider.MachineOperator.EventsNotification += MachineOperator_EventsNotification; + } + + private void MachineOperator_EventsNotification(object sender, StartEventsNotificationResponse e) + { + if (!_doorOpened) + { + if (e.Events.Select(x => x.Type).Contains(PMR.Diagnostics.EventType.CartridgesCoverOpen)) + { + _doorOpened = true; + } + } + else + { + if (!e.Events.Select(x => x.Type).Contains(PMR.Diagnostics.EventType.CartridgesCoverOpen)) + { + _doorClosed = true; + InvalidateRelayCommands(); + } + } + } + + protected override void Accept() + { + DisposeEvents(); + base.Accept(); + } + + protected override void Cancel() + { + DisposeEvents(); + base.Cancel(); + } + + protected override bool CanOK() + { + return base.CanOK() && _doorClosed && _doorOpened; + } + + private void DisposeEvents() + { + MachineProvider.MachineOperator.EventsNotification -= MachineOperator_EventsNotification; + } + } +} |
