From ba7f3bc94afb0495d8301f9676ac9269434a944e Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Tue, 13 Oct 2020 09:50:38 +0300 Subject: Implemented PPC maintenance Waste status. --- Software/Graphics/Mobile/Waste/absent.png | Bin 0 -> 892 bytes Software/Graphics/Mobile/Waste/absent@2x.png | Bin 0 -> 3180 bytes Software/Graphics/Mobile/Waste/absent@3x.png | Bin 0 -> 5991 bytes Software/Graphics/Mobile/Waste/absent_error.png | Bin 0 -> 1378 bytes Software/Graphics/Mobile/Waste/absent_error@2x.png | Bin 0 -> 6753 bytes Software/Graphics/Mobile/Waste/absent_error@3x.png | Bin 0 -> 12644 bytes Software/Graphics/Mobile/Waste/absent_right.png | Bin 0 -> 1452 bytes Software/Graphics/Mobile/Waste/absent_right@2x.png | Bin 0 -> 6780 bytes Software/Graphics/Mobile/Waste/absent_right@3x.png | Bin 0 -> 12460 bytes Software/Graphics/Mobile/Waste/present_empty.png | Bin 0 -> 946 bytes .../Graphics/Mobile/Waste/present_empty@2x.png | Bin 0 -> 3143 bytes .../Graphics/Mobile/Waste/present_empty@3x.png | Bin 0 -> 5370 bytes .../Graphics/Mobile/Waste/present_empty_error.png | Bin 0 -> 1440 bytes .../Mobile/Waste/present_empty_error@2x.png | Bin 0 -> 6545 bytes .../Mobile/Waste/present_empty_error@3x.png | Bin 0 -> 11886 bytes .../Graphics/Mobile/Waste/present_empty_right.png | Bin 0 -> 1497 bytes .../Mobile/Waste/present_empty_right@2x.png | Bin 0 -> 6446 bytes .../Mobile/Waste/present_empty_right@3x.png | Bin 0 -> 11687 bytes Software/Graphics/Mobile/Waste/present_full.png | Bin 0 -> 1684 bytes Software/Graphics/Mobile/Waste/present_full@2x.png | Bin 0 -> 11114 bytes Software/Graphics/Mobile/Waste/present_full@3x.png | Bin 0 -> 23222 bytes .../Graphics/Mobile/Waste/present_full_error.png | Bin 0 -> 2308 bytes .../Mobile/Waste/present_full_error@2x.png | Bin 0 -> 15348 bytes .../Mobile/Waste/present_full_error@3x.png | Bin 0 -> 30927 bytes .../Graphics/Mobile/Waste/present_full_right.png | Bin 0 -> 2035 bytes .../Mobile/Waste/present_full_right@2x.png | Bin 0 -> 12782 bytes .../Mobile/Waste/present_full_right@3x.png | Bin 0 -> 25851 bytes .../Tango.PPC.Maintenance/Images/Waste/absent.png | Bin 0 -> 892 bytes .../Images/Waste/present_empty_error.png | Bin 0 -> 1440 bytes .../Images/Waste/present_empty_right.png | Bin 0 -> 1497 bytes .../Images/Waste/present_full_right.png | Bin 0 -> 2035 bytes .../Tango.PPC.Maintenance.csproj | 12 ++++- .../ViewModels/MaintenanceViewVM.cs | 53 +++++++++++++++--- .../Views/MaintenanceView.xaml | 59 +++++++++++++++++++-- 34 files changed, 111 insertions(+), 13 deletions(-) create mode 100644 Software/Graphics/Mobile/Waste/absent.png create mode 100644 Software/Graphics/Mobile/Waste/absent@2x.png create mode 100644 Software/Graphics/Mobile/Waste/absent@3x.png create mode 100644 Software/Graphics/Mobile/Waste/absent_error.png create mode 100644 Software/Graphics/Mobile/Waste/absent_error@2x.png create mode 100644 Software/Graphics/Mobile/Waste/absent_error@3x.png create mode 100644 Software/Graphics/Mobile/Waste/absent_right.png create mode 100644 Software/Graphics/Mobile/Waste/absent_right@2x.png create mode 100644 Software/Graphics/Mobile/Waste/absent_right@3x.png create mode 100644 Software/Graphics/Mobile/Waste/present_empty.png create mode 100644 Software/Graphics/Mobile/Waste/present_empty@2x.png create mode 100644 Software/Graphics/Mobile/Waste/present_empty@3x.png create mode 100644 Software/Graphics/Mobile/Waste/present_empty_error.png create mode 100644 Software/Graphics/Mobile/Waste/present_empty_error@2x.png create mode 100644 Software/Graphics/Mobile/Waste/present_empty_error@3x.png create mode 100644 Software/Graphics/Mobile/Waste/present_empty_right.png create mode 100644 Software/Graphics/Mobile/Waste/present_empty_right@2x.png create mode 100644 Software/Graphics/Mobile/Waste/present_empty_right@3x.png create mode 100644 Software/Graphics/Mobile/Waste/present_full.png create mode 100644 Software/Graphics/Mobile/Waste/present_full@2x.png create mode 100644 Software/Graphics/Mobile/Waste/present_full@3x.png create mode 100644 Software/Graphics/Mobile/Waste/present_full_error.png create mode 100644 Software/Graphics/Mobile/Waste/present_full_error@2x.png create mode 100644 Software/Graphics/Mobile/Waste/present_full_error@3x.png create mode 100644 Software/Graphics/Mobile/Waste/present_full_right.png create mode 100644 Software/Graphics/Mobile/Waste/present_full_right@2x.png create mode 100644 Software/Graphics/Mobile/Waste/present_full_right@3x.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/absent.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_error.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_right.png create mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_full_right.png diff --git a/Software/Graphics/Mobile/Waste/absent.png b/Software/Graphics/Mobile/Waste/absent.png new file mode 100644 index 000000000..8fc4e1b33 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/absent.png differ diff --git a/Software/Graphics/Mobile/Waste/absent@2x.png b/Software/Graphics/Mobile/Waste/absent@2x.png new file mode 100644 index 000000000..61560acf4 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/absent@2x.png differ diff --git a/Software/Graphics/Mobile/Waste/absent@3x.png b/Software/Graphics/Mobile/Waste/absent@3x.png new file mode 100644 index 000000000..799d66292 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/absent@3x.png differ diff --git a/Software/Graphics/Mobile/Waste/absent_error.png b/Software/Graphics/Mobile/Waste/absent_error.png new file mode 100644 index 000000000..4f59b6148 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/absent_error.png differ diff --git a/Software/Graphics/Mobile/Waste/absent_error@2x.png b/Software/Graphics/Mobile/Waste/absent_error@2x.png new file mode 100644 index 000000000..eca6fb96c Binary files /dev/null and b/Software/Graphics/Mobile/Waste/absent_error@2x.png differ diff --git a/Software/Graphics/Mobile/Waste/absent_error@3x.png b/Software/Graphics/Mobile/Waste/absent_error@3x.png new file mode 100644 index 000000000..3aefa0653 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/absent_error@3x.png differ diff --git a/Software/Graphics/Mobile/Waste/absent_right.png b/Software/Graphics/Mobile/Waste/absent_right.png new file mode 100644 index 000000000..ff79eca78 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/absent_right.png differ diff --git a/Software/Graphics/Mobile/Waste/absent_right@2x.png b/Software/Graphics/Mobile/Waste/absent_right@2x.png new file mode 100644 index 000000000..fdae50c06 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/absent_right@2x.png differ diff --git a/Software/Graphics/Mobile/Waste/absent_right@3x.png b/Software/Graphics/Mobile/Waste/absent_right@3x.png new file mode 100644 index 000000000..b5c0006c4 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/absent_right@3x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_empty.png b/Software/Graphics/Mobile/Waste/present_empty.png new file mode 100644 index 000000000..dd40a5995 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_empty.png differ diff --git a/Software/Graphics/Mobile/Waste/present_empty@2x.png b/Software/Graphics/Mobile/Waste/present_empty@2x.png new file mode 100644 index 000000000..e4d72af4b Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_empty@2x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_empty@3x.png b/Software/Graphics/Mobile/Waste/present_empty@3x.png new file mode 100644 index 000000000..bea789da6 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_empty@3x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_empty_error.png b/Software/Graphics/Mobile/Waste/present_empty_error.png new file mode 100644 index 000000000..ff2411eb5 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_empty_error.png differ diff --git a/Software/Graphics/Mobile/Waste/present_empty_error@2x.png b/Software/Graphics/Mobile/Waste/present_empty_error@2x.png new file mode 100644 index 000000000..28445f2be Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_empty_error@2x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_empty_error@3x.png b/Software/Graphics/Mobile/Waste/present_empty_error@3x.png new file mode 100644 index 000000000..30904ed3a Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_empty_error@3x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_empty_right.png b/Software/Graphics/Mobile/Waste/present_empty_right.png new file mode 100644 index 000000000..08b9a7076 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_empty_right.png differ diff --git a/Software/Graphics/Mobile/Waste/present_empty_right@2x.png b/Software/Graphics/Mobile/Waste/present_empty_right@2x.png new file mode 100644 index 000000000..2b243f6c1 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_empty_right@2x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_empty_right@3x.png b/Software/Graphics/Mobile/Waste/present_empty_right@3x.png new file mode 100644 index 000000000..3c6e5b229 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_empty_right@3x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_full.png b/Software/Graphics/Mobile/Waste/present_full.png new file mode 100644 index 000000000..f671fec29 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_full.png differ diff --git a/Software/Graphics/Mobile/Waste/present_full@2x.png b/Software/Graphics/Mobile/Waste/present_full@2x.png new file mode 100644 index 000000000..ec49884e7 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_full@2x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_full@3x.png b/Software/Graphics/Mobile/Waste/present_full@3x.png new file mode 100644 index 000000000..3d81dab08 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_full@3x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_full_error.png b/Software/Graphics/Mobile/Waste/present_full_error.png new file mode 100644 index 000000000..e3cca0e8b Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_full_error.png differ diff --git a/Software/Graphics/Mobile/Waste/present_full_error@2x.png b/Software/Graphics/Mobile/Waste/present_full_error@2x.png new file mode 100644 index 000000000..f28a63c05 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_full_error@2x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_full_error@3x.png b/Software/Graphics/Mobile/Waste/present_full_error@3x.png new file mode 100644 index 000000000..a8336af03 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_full_error@3x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_full_right.png b/Software/Graphics/Mobile/Waste/present_full_right.png new file mode 100644 index 000000000..a39b6f073 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_full_right.png differ diff --git a/Software/Graphics/Mobile/Waste/present_full_right@2x.png b/Software/Graphics/Mobile/Waste/present_full_right@2x.png new file mode 100644 index 000000000..977aaa110 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_full_right@2x.png differ diff --git a/Software/Graphics/Mobile/Waste/present_full_right@3x.png b/Software/Graphics/Mobile/Waste/present_full_right@3x.png new file mode 100644 index 000000000..aecaa7880 Binary files /dev/null and b/Software/Graphics/Mobile/Waste/present_full_right@3x.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/absent.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/absent.png new file mode 100644 index 000000000..8fc4e1b33 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/absent.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_error.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_error.png new file mode 100644 index 000000000..ff2411eb5 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_error.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_right.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_right.png new file mode 100644 index 000000000..08b9a7076 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_right.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_full_right.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_full_right.png new file mode 100644 index 000000000..a39b6f073 Binary files /dev/null and b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_full_right.png differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj index 21b2eeb0a..94dc4e2cb 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj @@ -290,10 +290,20 @@ + + + + + + + + + + - + \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs index f8535ad35..9de8313f8 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs @@ -7,10 +7,13 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using Tango.BL; +using Tango.Core; using Tango.Core.Commands; using Tango.Explorer; using Tango.Integration.Operation; using Tango.Logging; +using Tango.PMR.Diagnostics; +using Tango.PMR.IFS; using Tango.PMR.MachineStatus; using Tango.PPC.Common; using Tango.PPC.Maintenance.Commands; @@ -24,6 +27,18 @@ namespace Tango.PPC.Maintenance.ViewModels { public class MaintenanceViewVM : PPCViewModel { + public class WasteStateModel : ExtendedObject + { + private CartridgeState _state; + public CartridgeState State + { + get { return _state; } + set { _state = value; RaisePropertyChangedAuto(); } + } + + public CartridgeSlot Slot { get; set; } + } + public ObservableCollection Guides { get; set; } public RelayCommand OpenGuideCommand { get; set; } @@ -70,6 +85,12 @@ namespace Tango.PPC.Maintenance.ViewModels } } + private List _wasteStates; + public List WasteStates + { + get { return _wasteStates; } + set { _wasteStates = value; RaisePropertyChangedAuto(); } + } public RelayCommand ExportLogsCommand { get; set; } @@ -97,13 +118,21 @@ namespace Tango.PPC.Maintenance.ViewModels OpenCloseLeftLeadingWheelsCommand = new OpenCloseLeftLeadingWheelsCommand(); OpenCloseRightLeadingWheelsCommand = new OpenCloseRightLeadingWheelsCommand(); ResetThreadLoadingCommand = new ResetThreadLoadingCommand(); - HeadCleaningCommand = new RelayCommand(PerformHeadCleaning,() => MachineProvider.MachineOperator.CanPrint); + HeadCleaningCommand = new RelayCommand(PerformHeadCleaning, () => MachineProvider.MachineOperator.CanPrint); StartThreadLoadingCommand = new RelayCommand(StartThreadLoading, () => MachineProvider.MachineOperator.CanPrint); + + WasteStates = new List() + { + new WasteStateModel() { Slot = CartridgeSlot.WasteMiddle, State = CartridgeState.Absent }, + new WasteStateModel() { Slot = CartridgeSlot.WasteLower, State = CartridgeState.Absent } + }; } public override void OnApplicationStarted() { - + MachineProvider.MachineOperator.InkFillingStatusChanged += MachineOperator_InkFillingStatusChanged; + MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; + MachineProvider.MachineOperator.MachineEventsStateProvider.EventsChanged += MachineEventsStateProvider_EventsChanged; } public override void OnApplicationReady() @@ -114,10 +143,7 @@ namespace Tango.PPC.Maintenance.ViewModels { Max = MachineOperator.MAX_MIDTANK_LITERS, IDSPack = x, - }).OrderBy(y=>y.IDSPack.LiquidType.Code).ToList(); - - MachineProvider.MachineOperator.MachineStatusChanged += MachineOperator_MachineStatusChanged; - MachineProvider.MachineOperator.MachineEventsStateProvider.EventsChanged += MachineEventsStateProvider_EventsChanged; + }).OrderBy(y => y.IDSPack.LiquidType.Code).ToList(); } private void MachineEventsStateProvider_EventsChanged(object sender, IEnumerable e) @@ -133,6 +159,19 @@ namespace Tango.PPC.Maintenance.ViewModels InvalidateRelayCommands(); } + private void MachineOperator_InkFillingStatusChanged(object sender, InkFillingStatusChangedEventArgs e) + { + foreach (var cartridge in e.Status.CartridgesStatuses.Where(x => x.Cartridge.Slot != CartridgeSlot.Ink)) + { + var wasteState = WasteStates.SingleOrDefault(x => x.Slot == cartridge.Cartridge.Slot); + + if (wasteState != null) + { + wasteState.State = cartridge.State; + } + } + } + public async void OpenGuide(GuideBase guide) { await NavigationManager.NavigateWithObject(guide); @@ -180,7 +219,7 @@ namespace Tango.PPC.Maintenance.ViewModels var appFileLogger = LogManager.RegisteredLoggers.FirstOrDefault(x => x is FileLogger) as FileLogger; - await Task.Factory.StartNew(() => + await Task.Factory.StartNew(() => { using (ZipFile zip = new ZipFile(file)) { diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml index 6c48888af..188983b3f 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml @@ -5,6 +5,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:vm="clr-namespace:Tango.PPC.Maintenance.ViewModels" xmlns:global="clr-namespace:Tango.PPC.Maintenance" + xmlns:ifs="clr-namespace:Tango.PMR.IFS;assembly=Tango.PMR" xmlns:arr="clr-namespace:System.Collections;assembly=mscorlib" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" xmlns:localConverters="clr-namespace:Tango.PPC.Maintenance.Converters" @@ -111,13 +112,13 @@ Current Status - + - - - - + + + + @@ -169,9 +170,57 @@ + + + + + + + + + + + + + + + + + + + Temperature Inks Collecting Cone + Waste -- cgit v1.3.1