From e89f04cbdda4e34baef11d43c9f812773911a33c Mon Sep 17 00:00:00 2001 From: Roy Date: Mon, 26 Dec 2022 21:33:29 +0200 Subject: Implemented Waste Replace Handling. Implemented Job Stop on Out Of Range on MachineOperator. Implemented job upload error on Volumes out of range. --- .../Tango.PPC.UI/Dialogs/WasteReplacementView.xaml | 37 ++++++++++++ .../Dialogs/WasteReplacementView.xaml.cs | 28 +++++++++ .../Tango.PPC.UI/Dialogs/WasteReplacementViewVM.cs | 69 ++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementView.xaml create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementView.xaml.cs create mode 100644 Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/WasteReplacementViewVM.cs (limited to 'Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs') 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 @@ + + + + + LATER + DONE + + + + Replace Waste Cartridge + + The waste cartridge is close to full and needs to be replaced. + + Please open the cartridge door, insert two empty cartridges then close the door. + + + When finish press "DONE". + + + + + + + + + + + + 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 +{ + /// + /// Interaction logic for SpoolReplaceView.xaml + /// + 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; + } + } +} -- cgit v1.3.1