From 00a491d93733d4625ad329b2ba8237f445364b3f Mon Sep 17 00:00:00 2001 From: Mirta Date: Wed, 30 Dec 2020 16:39:52 +0200 Subject: merge --- .../PPC/Modules/Tango.PPC.Maintenance/App.xaml | 11 - .../Commands/HomingMotorCommand.cs | 80 ----- .../Commands/OpenCloseDyeingHeadCommand.cs | 31 -- .../Commands/OpenCloseLeftLeadingWheelsCommand.cs | 30 -- .../Commands/OpenCloseMotorCommand.cs | 158 ---------- .../Commands/OpenCloseRightLeadingWheelsCommand.cs | 30 -- .../Commands/ResetThreadLoadingCommand.cs | 24 -- .../Controls/StateTouchButton.cs | 109 ------- .../Converters/LiquidTypeToBrushConverter.cs | 74 ----- .../Converters/LiquidTypeToShortNameConverter.cs | 41 --- .../MidTankLevelToElementHeightConverter.cs | 34 -- .../Converters/StringToFirstLetterConverter.cs | 30 -- .../Dialogs/CleanerDispensingView.xaml | 66 ---- .../Dialogs/CleanerDispensingView.xaml.cs | 28 -- .../Dialogs/CleanerDispensingViewVM.cs | 128 -------- .../Dialogs/HeadCleaningView.xaml | 56 ---- .../Dialogs/HeadCleaningView.xaml.cs | 28 -- .../Dialogs/HeadCleaningViewVM.cs | 150 --------- .../PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs | 35 --- .../PPC/Modules/Tango.PPC.Maintenance/GuideStep.cs | 21 -- .../Guides/HandleWasteCartridgeGuide.cs | 43 --- .../Guides/LoadInkCartridgeGuide.cs | 43 --- .../Guides/LoadNewThreadGuide.cs | 43 --- .../Guides/ReplaceAirFilterGuide.cs | 43 --- .../Guides/ReplaceThreadGuide.cs | 43 --- .../Tango.PPC.Maintenance/Helpers/GuideHelper.cs | 33 -- .../Images/Guides/Loading-New-Thread.gif | Bin 4092741 -> 0 bytes .../Images/Guides/Loading-an-Ink-Cartridge.gif | Bin 4197318 -> 0 bytes .../Images/Guides/Replacing-the-Air-Filter.gif | Bin 3500573 -> 0 bytes .../Images/Guides/Replacing-the-Thread.gif | Bin 13319358 -> 0 bytes .../Images/Guides/Residue-Cartridges-A.gif | Bin 3567850 -> 0 bytes .../Guides/handling-the-waste-cartridges.png | Bin 2174 -> 0 bytes .../Images/Guides/loading-an-ink-cartridge.png | Bin 2266 -> 0 bytes .../Images/Guides/loading-new-thread.png | Bin 2228 -> 0 bytes .../Images/Guides/machine-image.png | Bin 138220 -> 0 bytes .../Images/Guides/replacing-the-air-filter.png | Bin 2269 -> 0 bytes .../Images/Guides/replacing-the-thread.png | Bin 2175 -> 0 bytes .../Tango.PPC.Maintenance/Images/Waste/absent.png | Bin 892 -> 0 bytes .../Images/Waste/present_empty_error.png | Bin 1440 -> 0 bytes .../Images/Waste/present_empty_right.png | Bin 1497 -> 0 bytes .../Images/Waste/present_full_right.png | Bin 2035 -> 0 bytes .../Tango.PPC.Maintenance/Images/action.png | Bin 1152 -> 0 bytes .../Tango.PPC.Maintenance/Images/cl-full.png | Bin 3454 -> 0 bytes .../Tango.PPC.Maintenance/Images/cone-empty.png | Bin 4125 -> 0 bytes .../Tango.PPC.Maintenance/Images/cone-full.png | Bin 3018 -> 0 bytes .../Tango.PPC.Maintenance/Images/guides.png | Bin 2099 -> 0 bytes .../Tango.PPC.Maintenance/Images/head_cleaning.png | Bin 44260 -> 0 bytes .../Modules/Tango.PPC.Maintenance/Images/inks.png | Bin 2075 -> 0 bytes .../Tango.PPC.Maintenance/Images/l-full.png | Bin 19717 -> 0 bytes .../Tango.PPC.Maintenance/Images/lubricant2.png | Bin 194234 -> 0 bytes .../Tango.PPC.Maintenance/Images/maintenance.png | Bin 686 -> 0 bytes .../Tango.PPC.Maintenance/Images/status.png | Bin 1663 -> 0 bytes .../Images/temperature-green.png | Bin 926 -> 0 bytes .../Images/temperature-red.png | Bin 928 -> 0 bytes .../Images/temperature-yellow.png | Bin 927 -> 0 bytes .../Images/thread_loading.png | Bin 7209 -> 0 bytes .../Tango.PPC.Maintenance/MaintenanceCommand.cs | 81 ----- .../Tango.PPC.Maintenance/MaintenanceModule.cs | 84 ----- .../Models/MidTankLevelModel.cs | 35 --- .../Models/OverallTemperatureModel.cs | 30 -- .../Properties/AssemblyInfo.cs | 20 -- .../Properties/Resources.Designer.cs | 63 ---- .../Properties/Resources.resx | 117 ------- .../Properties/Settings.Designer.cs | 26 -- .../Properties/Settings.settings | 7 - .../Tango.PPC.Maintenance/Resources/Guides.xaml | 60 ---- .../Tango.PPC.Maintenance.csproj | 320 ------------------- .../Tango.PPC.Maintenance/Themes/Generic.xaml | 9 - .../Tango.PPC.Maintenance/ViewModelLocator.cs | 56 ---- .../ViewModels/GeneralGuideViewVM.cs | 40 --- .../Tango.PPC.Maintenance/ViewModels/MainViewVM.cs | 31 -- .../ViewModels/MaintenanceViewVM.cs | 324 -------------------- .../Views/GeneralGuideView.xaml | 55 ---- .../Views/GeneralGuideView.xaml.cs | 33 -- .../Tango.PPC.Maintenance/Views/MainView.xaml | 22 -- .../Tango.PPC.Maintenance/Views/MainView.xaml.cs | 28 -- .../Views/MaintenanceView.xaml | 341 --------------------- .../Views/MaintenanceView.xaml.cs | 30 -- .../PPC/Modules/Tango.PPC.Maintenance/app.config | 61 ---- .../Modules/Tango.PPC.Maintenance/packages.config | 11 - 80 files changed, 3296 deletions(-) delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/App.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/HomingMotorCommand.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseDyeingHeadCommand.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseLeftLeadingWheelsCommand.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseMotorCommand.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseRightLeadingWheelsCommand.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/ResetThreadLoadingCommand.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Controls/StateTouchButton.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToShortNameConverter.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingView.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningView.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideStep.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/HandleWasteCartridgeGuide.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadInkCartridgeGuide.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadNewThreadGuide.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceAirFilterGuide.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceThreadGuide.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Helpers/GuideHelper.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-New-Thread.gif delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-an-Ink-Cartridge.gif delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Air-Filter.gif delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Thread.gif delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Residue-Cartridges-A.gif delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/handling-the-waste-cartridges.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-an-ink-cartridge.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-new-thread.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/machine-image.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-air-filter.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-thread.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/absent.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_error.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_right.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_full_right.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/action.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/guides.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/head_cleaning.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/inks.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/maintenance.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/status.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-green.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-red.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-yellow.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/thread_loading.png delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceCommand.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceModule.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/OverallTemperatureModel.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/AssemblyInfo.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.Designer.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.resx delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.Designer.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.settings delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Resources/Guides.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Themes/Generic.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModelLocator.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MainViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml.cs delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/app.config delete mode 100644 Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance') diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/App.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/App.xaml deleted file mode 100644 index cb7592abd..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/App.xaml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/HomingMotorCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/HomingMotorCommand.cs deleted file mode 100644 index d3f44fe7e..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/HomingMotorCommand.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PMR.Diagnostics; -using Tango.PMR.Hardware; - -namespace Tango.PPC.Maintenance.Commands -{ - public abstract class HomingMotorCommand : MaintenanceCommand - { - public HardwareMotorType Motor { get; set; } - - public MotorDirection Direction { get; set; } - - public double Speed { get; set; } - - public String HomingMessage { get; set; } - - public String ErrorMessage { get; set; } - - public String SuccessMessage { get; set; } - - public HomingMotorCommand(HardwareMotorType motor, - MotorDirection direction, - double speed, - string homingMessage, - string errorMessage, - string successMessage) - { - Motor = motor; - Direction = direction; - Speed = speed; - HomingMessage = homingMessage; - ErrorMessage = errorMessage; - SuccessMessage = successMessage; - } - - protected override void OnExecute() - { - IsEnabled = false; - - try - { - NotificationProvider.SetGlobalBusyMessage(HomingMessage); - - MachineProvider.MachineOperator.StartMotorHoming(new PMR.Diagnostics.MotorHomingRequest() - { - Direction = Direction, - MotorType = Motor, - Speed = Speed, - }).Subscribe((response) => - { - //Next - }, (ex) => - { - //Error - IsEnabled = true; - NotificationProvider.ReleaseGlobalBusyMessage(); - LogManager.Log(ex, ErrorMessage); - NotificationProvider.ShowError(ex.FlattenMessage()); - }, () => - { - //Complete - IsEnabled = true; - NotificationProvider.ReleaseGlobalBusyMessage(); - NotificationProvider.ShowSuccess(SuccessMessage); - }); - } - catch (Exception ex) - { - LogManager.Log(ex, ErrorMessage); - NotificationProvider.ReleaseGlobalBusyMessage(); - NotificationProvider.ShowError(ex.FlattenMessage()); - IsEnabled = true; - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseDyeingHeadCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseDyeingHeadCommand.cs deleted file mode 100644 index 5c482e04c..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseDyeingHeadCommand.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Integration.Operation; -using Tango.PMR.Diagnostics; -using Tango.PMR.Hardware; - -namespace Tango.PPC.Maintenance.Commands -{ - public class OpenCloseDyeingHeadCommand : OpenCloseMotorCommand - { - public OpenCloseDyeingHeadCommand() : base( - HardwareMotorType.MotoDhLid, - MotorDirection.Backward, - 400, - 400, - MotorState.Closed, - "Opening dyeing head lid...", - "Closing dyeing head lid...", - "Error opening dyeing head lid.", - "Error closing dyeing head lid.", - "The dyeing head lid is now opened.", - "The dyeing head lid is now closed." - ) - { - - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseLeftLeadingWheelsCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseLeftLeadingWheelsCommand.cs deleted file mode 100644 index b0d8c1dc5..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseLeftLeadingWheelsCommand.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PMR.Diagnostics; -using Tango.PMR.Hardware; - -namespace Tango.PPC.Maintenance.Commands -{ - public class OpenCloseLeftLeadingWheelsCommand : OpenCloseMotorCommand - { - public OpenCloseLeftLeadingWheelsCommand() : base( - HardwareMotorType.MotoLloading, - MotorDirection.Backward, - 250, - 250, - MotorState.Closed, - "Opening left leading wheels...", - "Closing left leading wheels...", - "Error opening left leading wheels.", - "Error closing left leading wheels.", - "The left leading wheels are now opened.", - "The left leading wheels are now closed." - ) - { - - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseMotorCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseMotorCommand.cs deleted file mode 100644 index 149c3675d..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseMotorCommand.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PMR.Diagnostics; -using Tango.PMR.Hardware; - -namespace Tango.PPC.Maintenance.Commands -{ - public abstract class OpenCloseMotorCommand : MaintenanceCommand - { - public enum MotorState - { - Closed, - Opened, - } - - public HardwareMotorType Motor { get; set; } - - public MotorDirection OpenDirection { get; set; } - - public MotorDirection CloseDirection - { - get - { - return OpenDirection == MotorDirection.Forward ? MotorDirection.Backward : MotorDirection.Forward; - } - } - - public double OpeningSpeed { get; set; } - - public double ClosingSpeed { get; set; } - - public String OpeningMessage { get; set; } - - public String ClosingMessage { get; set; } - - public String OpeningErrorMessage { get; set; } - - public String ClosingErrorMessage { get; set; } - - public String OpeningSuccessMessage { get; set; } - - public String ClosingSuccessMessage { get; set; } - - public OpenCloseMotorCommand( - HardwareMotorType motor, - MotorDirection openDirection, - double openingSpeed, - double closingSpeed, - MotorState defaultState, - String openingMessage, - String closingMessage, - String openingErrorMessage, - String closingErrorMessage, - String openingSuccessMessage, - String closingSuccessMessage) - { - - Motor = motor; - OpenDirection = openDirection; - OpeningSpeed = openingSpeed; - ClosingSpeed = closingSpeed; - State = defaultState; - OpeningMessage = openingMessage; - ClosingMessage = closingMessage; - OpeningErrorMessage = openingErrorMessage; - ClosingErrorMessage = closingErrorMessage; - OpeningSuccessMessage = openingSuccessMessage; - ClosingSuccessMessage = closingSuccessMessage; - } - - protected override void OnExecute() - { - if (State == MotorState.Closed) - { - IsEnabled = false; - - try - { - NotificationProvider.SetGlobalBusyMessage(OpeningMessage); - - MachineProvider.MachineOperator.StartMotorHoming(new PMR.Diagnostics.MotorHomingRequest() - { - Direction = OpenDirection, - MotorType = Motor, - Speed = OpeningSpeed, - }).Subscribe((response) => - { - //Next - }, (ex) => - { - //Error - IsEnabled = true; - NotificationProvider.ReleaseGlobalBusyMessage(); - LogManager.Log(ex, OpeningErrorMessage); - NotificationProvider.ShowError(ex.FlattenMessage()); - }, () => - { - //Complete - IsEnabled = true; - State = MotorState.Opened; - NotificationProvider.ReleaseGlobalBusyMessage(); - NotificationProvider.ShowSuccess(OpeningSuccessMessage); - }); - } - catch (Exception ex) - { - LogManager.Log(ex, OpeningErrorMessage); - NotificationProvider.ReleaseGlobalBusyMessage(); - NotificationProvider.ShowError(ex.FlattenMessage()); - IsEnabled = true; - } - } - else - { - IsEnabled = false; - - try - { - NotificationProvider.SetGlobalBusyMessage(ClosingMessage); - - MachineProvider.MachineOperator.StartMotorHoming(new PMR.Diagnostics.MotorHomingRequest() - { - Direction = CloseDirection, - MotorType = Motor, - Speed = ClosingSpeed, - }).Subscribe((response) => - { - //Next - }, (ex) => - { - //Error - IsEnabled = true; - NotificationProvider.ReleaseGlobalBusyMessage(); - LogManager.Log(ex, ClosingErrorMessage); - NotificationProvider.ShowError(ex.FlattenMessage()); - }, () => - { - //Complete - IsEnabled = true; - State = MotorState.Closed; - NotificationProvider.ReleaseGlobalBusyMessage(); - NotificationProvider.ShowSuccess(ClosingSuccessMessage); - }); - } - catch (Exception ex) - { - LogManager.Log(ex, ClosingErrorMessage); - NotificationProvider.ReleaseGlobalBusyMessage(); - NotificationProvider.ShowError(ex.FlattenMessage()); - IsEnabled = true; - } - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseRightLeadingWheelsCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseRightLeadingWheelsCommand.cs deleted file mode 100644 index ced9eea60..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/OpenCloseRightLeadingWheelsCommand.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PMR.Diagnostics; -using Tango.PMR.Hardware; - -namespace Tango.PPC.Maintenance.Commands -{ - public class OpenCloseRightLeadingWheelsCommand : OpenCloseMotorCommand - { - public OpenCloseRightLeadingWheelsCommand() : base( - HardwareMotorType.MotoRloading, - MotorDirection.Backward, - 250, - 250, - MotorState.Closed, - "Opening right leading wheels...", - "Closing right leading wheels...", - "Error opening right leading wheels.", - "Error closing right leading wheels.", - "The right leading wheels are now opened.", - "The right leading wheels are now closed." - ) - { - - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/ResetThreadLoadingCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/ResetThreadLoadingCommand.cs deleted file mode 100644 index 0078cd546..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands/ResetThreadLoadingCommand.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PMR.Diagnostics; -using Tango.PMR.Hardware; - -namespace Tango.PPC.Maintenance.Commands -{ - public class ResetThreadLoadingCommand : HomingMotorCommand - { - public ResetThreadLoadingCommand() : base( - HardwareMotorType.MotoDryerLoadarm, - MotorDirection.Backward, - 200, - "Resetting thread loading arm...", - "Error resetting thread loading arm.", - "Thread loading arm in now in place.") - { - - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Controls/StateTouchButton.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Controls/StateTouchButton.cs deleted file mode 100644 index 9a259482b..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Controls/StateTouchButton.cs +++ /dev/null @@ -1,109 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -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.Markup; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; -using Tango.Touch.Controls; - -namespace Tango.PPC.Maintenance.Controls -{ - public class ButtonState : DependencyObject - { - public Object Value - { - get { return (Object)GetValue(ValueProperty); } - set { SetValue(ValueProperty, value); } - } - public static readonly DependencyProperty ValueProperty = - DependencyProperty.Register("Value", typeof(Object), typeof(ButtonState), new PropertyMetadata(null)); - - public Object Content - { - get { return (Object)GetValue(ContentProperty); } - set { SetValue(ContentProperty, value); } - } - public static readonly DependencyProperty ContentProperty = - DependencyProperty.Register("Content", typeof(Object), typeof(ButtonState), new PropertyMetadata(null)); - } - - [ContentProperty(nameof(States))] - public class StateTouchButton : TouchButton - { - public ObservableCollection States - { - get { return (ObservableCollection)GetValue(StatesProperty); } - set { SetValue(StatesProperty, value); } - } - public static readonly DependencyProperty StatesProperty = - DependencyProperty.Register("States", typeof(ObservableCollection), typeof(StateTouchButton), new PropertyMetadata(null, (d, e) => (d as StateTouchButton).OnStatesChanged())); - - public Object SelectedState - { - get { return (Object)GetValue(SelectedStateProperty); } - set { SetValue(SelectedStateProperty, value); } - } - public static readonly DependencyProperty SelectedStateProperty = - DependencyProperty.Register("SelectedState", typeof(Object), typeof(StateTouchButton), new PropertyMetadata(null, (d, e) => (d as StateTouchButton).OnSelectedStateChanged())); - - public StateTouchButton() - { - States = new ObservableCollection(); - } - - private void OnStatesChanged() - { - if (States != null) - { - States.CollectionChanged -= States_CollectionChanged; - States.CollectionChanged += States_CollectionChanged; - OnSelectedStateChanged(); - } - } - - private void OnSelectedStateChanged() - { - if (SelectedState == null) - { - Content = null; - return; - } - - if (States != null) - { - var converter = TypeDescriptor.GetConverter(SelectedState.GetType()); - var matchingState = States.OfType().ToList().FirstOrDefault(x => x.Value != null && converter.ConvertFrom(x.Value).Equals(SelectedState)); - if (matchingState != null) - { - Content = matchingState.Content; - } - else - { - Content = null; - } - } - else - { - Content = null; - } - } - - private void States_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - OnSelectedStateChanged(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs deleted file mode 100644 index c33efdca6..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToBrushConverter.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Data; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using Tango.BL.Entities; -using Tango.SharedUI.Helpers; - -namespace Tango.PPC.Maintenance.Converters -{ - public class LiquidTypeToBrushConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is LiquidType) - { - LiquidType type = value as LiquidType; - switch (type.Type) - { - case BL.Enumerations.LiquidTypes.Lubricant: - { - - ImageBrush lubricantBrush = new ImageBrush() { Stretch = Stretch.None, TileMode = TileMode.Tile, ViewportUnits = BrushMappingMode.Absolute }; - - BitmapSource bit_source = ResourceHelper.GetImageFromResources(@"Images/lubricant2.png"); - var targetBitmap = new WriteableBitmap(new TransformedBitmap(bit_source, new ScaleTransform(0.2, 0.2))); - lubricantBrush.ImageSource = targetBitmap; - lubricantBrush.Viewport = new System.Windows.Rect(2, 2, targetBitmap.Width, targetBitmap.Height); - return lubricantBrush; - } - case BL.Enumerations.LiquidTypes.Cleaner: - { - ImageBrush cleanerBrush = new ImageBrush() { Stretch = Stretch.None, TileMode = TileMode.Tile, ViewportUnits = BrushMappingMode.Absolute }; - BitmapSource bit_source = ResourceHelper.GetImageFromResources(@"Images/cl-full.png"); - var targetBitmap = new WriteableBitmap(new TransformedBitmap(bit_source, new ScaleTransform(0.3, 0.3))); - - cleanerBrush.ImageSource = targetBitmap; - cleanerBrush.Viewport = new System.Windows.Rect(0, 0, targetBitmap.Width, targetBitmap.Height); - return cleanerBrush; - } - case BL.Enumerations.LiquidTypes.Yellow: - { - return new SolidColorBrush(Color.FromRgb(232, 225, 12)); - } - case BL.Enumerations.LiquidTypes.Cyan: - { - return new SolidColorBrush(Color.FromRgb(22, 98, 235)); - } - case BL.Enumerations.LiquidTypes.Magenta: - { - return new SolidColorBrush(Color.FromRgb(237, 0, 140)); - } - } - - - return new SolidColorBrush(type.LiquidTypeColor); - } - return null; - - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - - } -} - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToShortNameConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToShortNameConverter.cs deleted file mode 100644 index 15041bf17..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/LiquidTypeToShortNameConverter.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; -using Tango.BL.Entities; - -namespace Tango.PPC.Maintenance.Converters -{ - class LiquidTypeToShortNameConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value is LiquidType) - { - LiquidType type = value as LiquidType; - switch (type.Type) - { - case BL.Enumerations.LiquidTypes.Cleaner: - return "CL"; - case BL.Enumerations.LiquidTypes.TransparentInk: - return "TI"; - case BL.Enumerations.LiquidTypes.Black: - return "K"; - } - return type.Name.First().ToString(); - } - else - { - return value; - } - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs deleted file mode 100644 index 94d1ed8b8..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/MidTankLevelToElementHeightConverter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; -using Tango.Integration.Operation; - -namespace Tango.PPC.Maintenance.Converters -{ - public class MidTankLevelToElementHeightConverter : IMultiValueConverter - { - public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) - { - try - { - double parentActualHeight = (double)values[0]; - double midTankLevel = Math.Min((double)values[1], MachineOperator.MAX_MIDTANK_LITERS); - //var test = (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight); - return (parentActualHeight - (midTankLevel / MachineOperator.MAX_MIDTANK_LITERS) * parentActualHeight); - } - catch - { - return 0d; - } - } - - public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs deleted file mode 100644 index 0922af78d..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Converters/StringToFirstLetterConverter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Data; - -namespace Tango.PPC.Maintenance.Converters -{ - public class StringToFirstLetterConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, CultureInfo culture) - { - if (value != null && value.ToString().Length > 1) - { - return value.ToString().First().ToString(); - } - else - { - return value; - } - } - - public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) - { - throw new NotImplementedException(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingView.xaml deleted file mode 100644 index 98be45608..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingView.xaml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - Dispense Cleaning Liquid - - - - - Please put on safety glasses - - - - - - START - - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingView.xaml.cs deleted file mode 100644 index 6f1ebb4ed..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.Maintenance.Dialogs -{ - /// - /// Interaction logic for PowerUpView.xaml - /// - public partial class CleanerDispensingView : UserControl - { - public CleanerDispensingView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingViewVM.cs deleted file mode 100644 index e37be417f..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/CleanerDispensingViewVM.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Timers; -using Tango.BL.Entities; -using Tango.Core.Commands; -using Tango.Core.DI; -using Tango.Integration.Operation; -using Tango.PMR.Printing; -using Tango.PPC.Common; -using Tango.PPC.Common.Connection; -using Tango.PPC.Common.Notifications; -using Tango.Settings; -using Tango.SharedUI; - -namespace Tango.PPC.Maintenance.Dialogs -{ - public class CleanerDispensingViewVM : DialogViewVM - { - private const int JOGGING_TIME_SEC = 10; - private const int JOGGING_SPEED = 400; - - [TangoInject] - public IMachineProvider MachineProvider { get; set; } - - [TangoInject] - private INotificationProvider NotificationProvider { get; set; } - - private bool _isStarted; - public bool IsStarted - { - get { return _isStarted; } - set { _isStarted = value; RaisePropertyChangedAuto(); } - } - - private bool _isCompleted; - public bool IsCompleted - { - get { return _isCompleted; } - set { _isCompleted = value; RaisePropertyChangedAuto(); } - } - - private bool _isFailed; - public bool IsFailed - { - get { return _isFailed; } - set { _isFailed = value; RaisePropertyChangedAuto(); } - } - - private String _status; - public String Status - { - get { return _status; } - set { _status = value; RaisePropertyChangedAuto(); } - } - - public RelayCommand StartCommand { get; set; } - - public CleanerDispensingViewVM() - { - Status = "Ready..."; - CanClose = true; - TangoIOC.Default.Inject(this); - StartCommand = new RelayCommand(Start, () => !IsStarted); - } - - private async void Start() - { - try - { - CanClose = false; - IsStarted = true; - IsCompleted = false; - IsFailed = false; - InvalidateRelayCommands(); - - Status = "Dispensing cleaner liquid..."; - - var cleanerPack = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.FirstOrDefault(x => x.LiquidType.Type == BL.Enumerations.LiquidTypes.Cleaner); - - if (cleanerPack == null) - { - throw new InvalidOperationException("'Cleaner' liquid type was not found on the machine configuration."); - } - - var cleanerIndex = cleanerPack.PackIndex; - - await MachineProvider.MachineOperator.StartDispenserJogging(new PMR.Diagnostics.DispenserJoggingRequest() - { - Direction = PMR.Diagnostics.MotorDirection.Forward, - Speed = JOGGING_SPEED, - Index = cleanerIndex - }); - - await Task.Delay(TimeSpan.FromSeconds(JOGGING_TIME_SEC)); - - await MachineProvider.MachineOperator.StopDispenserJogging(new PMR.Diagnostics.DispenserAbortJoggingRequest() - { - Index = cleanerIndex - }); - - IsCompleted = true; - Status = "Cleaner liquid dispensing completed."; - } - catch (Exception ex) - { - Status = "Cleaner liquid dispensing failed."; - IsFailed = true; - await NotificationProvider.ShowError($"Error occurred while trying to perform the cleaner liquid dispensing.\n{ex.FlattenMessage()}"); - } - finally - { - CanClose = true; - IsStarted = false; - } - } - - protected override void Cancel() - { - if (CanClose) - { - base.Cancel(); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningView.xaml deleted file mode 100644 index f640d5cec..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningView.xaml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Head Cleaning - - - - - - - - - START - ABORT - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningView.xaml.cs deleted file mode 100644 index c715bf5cf..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.Maintenance.Dialogs -{ - /// - /// Interaction logic for PowerUpView.xaml - /// - public partial class HeadCleaningView : UserControl - { - public HeadCleaningView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningViewVM.cs deleted file mode 100644 index 59d119f21..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Dialogs/HeadCleaningViewVM.cs +++ /dev/null @@ -1,150 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Timers; -using Tango.BL.Entities; -using Tango.Core.Commands; -using Tango.Core.DI; -using Tango.Integration.Operation; -using Tango.PMR.Printing; -using Tango.PPC.Common; -using Tango.PPC.Common.Connection; -using Tango.PPC.Common.Notifications; -using Tango.Settings; -using Tango.SharedUI; - -namespace Tango.PPC.Maintenance.Dialogs -{ - public class HeadCleaningViewVM : DialogViewVM - { - private HeadCleaningHandler _handler; - - [TangoInject] - private IMachineProvider MachineProvider { get; set; } - - [TangoInject] - private INotificationProvider NotificationProvider { get; set; } - - private bool _isStarted; - public bool IsStarted - { - get { return _isStarted; } - set { _isStarted = value; RaisePropertyChangedAuto(); } - } - - private bool _isCompleted; - public bool IsCompleted - { - get { return _isCompleted; } - set { _isCompleted = value; RaisePropertyChangedAuto(); } - } - - private bool _isAborting; - public bool IsAborting - { - get { return _isAborting; } - set { _isAborting = value; RaisePropertyChangedAuto(); } - } - - private bool _isFailed; - public bool IsFailed - { - get { return _isFailed; } - set { _isFailed = value; RaisePropertyChangedAuto(); } - } - - private StartHeadCleaningResponse _status; - public StartHeadCleaningResponse Status - { - get { return _status; } - set { _status = value; RaisePropertyChangedAuto(); } - } - - public RelayCommand StartCommand { get; set; } - public RelayCommand AbortCommand { get; set; } - - public HeadCleaningViewVM() - { - CanClose = true; - TangoIOC.Default.Inject(this); - StartCommand = new RelayCommand(Start); - AbortCommand = new RelayCommand(Abort); - } - - private async void Start() - { - try - { - CanClose = false; - IsStarted = true; - _handler = await MachineProvider.MachineOperator.PerformHeadCleaning(); - _handler.Completed += _handler_Completed; - _handler.Failed += _handler_Failed; - _handler.StatusChanged += _handler_StatusChanged; - } - catch (Exception ex) - { - _handler_Failed(this, ex); - } - } - - private void _handler_StatusChanged(object sender, HeadCleaningStatusChangedEventArgs e) - { - Status = e.Status; - } - - private void _handler_Failed(object sender, Exception e) - { - IsStarted = false; - IsFailed = true; - InvokeUI(() => - { - CanClose = true; - Cancel(); - NotificationProvider.ShowError($"Error occurred while trying to perform the head cleaning.\n{e.FlattenMessage()}"); - }); - } - - private void _handler_Completed(object sender, EventArgs e) - { - IsStarted = false; - IsCompleted = true; - InvokeUI(() => - { - Accept(); - NotificationProvider.ShowSuccess("Head cleaning completed successfully."); - }); - } - - protected override void Cancel() - { - if (CanClose) - { - base.Cancel(); - } - } - - private async void Abort() - { - IsAborting = true; - try - { - await _handler.Abort(); - CanClose = true; - Cancel(); - await NotificationProvider.ShowInfo("Head cleaning aborted."); - } - catch (Exception ex) - { - if (!IsCompleted) - { - CanClose = true; - IsAborting = false; - await NotificationProvider.ShowError($"Error occurred while trying to abort the head cleaning.\n{ex.FlattenMessage()}"); - } - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs deleted file mode 100644 index 438375c72..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideBase.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media.Imaging; - -namespace Tango.PPC.Maintenance -{ - public abstract class GuideBase - { - public abstract String Name { get; } - public abstract BitmapSource Icon { get; } - public abstract String Image { get; } - public abstract List Steps { get; } - - protected virtual List GetStepsFromResource(String key) - { - List list = new List(); - - var arr = (Application.Current.Resources[key] as Array); - - foreach (var item in arr) - { - list.Add(new GuideStep() - { - Text = item - }); - } - - return list; - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideStep.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideStep.cs deleted file mode 100644 index 71a70d9db..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/GuideStep.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core; - -namespace Tango.PPC.Maintenance -{ - public class GuideStep : ExtendedObject - { - public Object Text { get; set; } - - private bool _isChecked; - public bool IsChecked - { - get { return _isChecked; } - set { _isChecked = value; RaisePropertyChangedAuto(); } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/HandleWasteCartridgeGuide.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/HandleWasteCartridgeGuide.cs deleted file mode 100644 index a4820e349..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/HandleWasteCartridgeGuide.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media.Imaging; -using Tango.SharedUI.Helpers; - -namespace Tango.PPC.Maintenance.Guides -{ - public class HandleWasteCartridgeGuide : GuideBase - { - public override string Name => "Handling the Waste Cartridges"; - public override String Image => "../Images/Guides/Residue-Cartridges-A.gif"; - - private BitmapSource _icon; - public override BitmapSource Icon - { - get - { - if (_icon == null) - { - _icon = ResourceHelper.GetImageFromResources("Images/Guides/handling-the-waste-cartridges.png"); - } - return _icon; - } - } - - private List _steps; - public override List Steps - { - get - { - if (_steps == null) - { - _steps = GetStepsFromResource("HandleWasteCartridge"); - } - return _steps; - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadInkCartridgeGuide.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadInkCartridgeGuide.cs deleted file mode 100644 index 1a6ed8321..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadInkCartridgeGuide.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media.Imaging; -using Tango.SharedUI.Helpers; - -namespace Tango.PPC.Maintenance.Guides -{ - public class LoadInkCartridgeGuide : GuideBase - { - public override string Name => "Loading an Ink Cartridge"; - public override String Image => "../Images/Guides/Loading-an-Ink-Cartridge.gif"; - - private BitmapSource _icon; - public override BitmapSource Icon - { - get - { - if (_icon == null) - { - _icon = ResourceHelper.GetImageFromResources("Images/Guides/loading-an-ink-cartridge.png"); - } - return _icon; - } - } - - private List _steps; - public override List Steps - { - get - { - if (_steps == null) - { - _steps = GetStepsFromResource("LoadInkCartridge"); - } - return _steps; - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadNewThreadGuide.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadNewThreadGuide.cs deleted file mode 100644 index d5115a748..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/LoadNewThreadGuide.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media.Imaging; -using Tango.SharedUI.Helpers; - -namespace Tango.PPC.Maintenance.Guides -{ - public class LoadNewThreadGuide : GuideBase - { - public override string Name => "Loading New Thread"; - public override String Image => "../Images/Guides/Loading-New-Thread.gif"; - - private BitmapSource _icon; - public override BitmapSource Icon - { - get - { - if (_icon == null) - { - _icon = ResourceHelper.GetImageFromResources("Images/Guides/loading-new-thread.png"); - } - return _icon; - } - } - - private List _steps; - public override List Steps - { - get - { - if (_steps == null) - { - _steps = GetStepsFromResource("LoadNewThread"); - } - return _steps; - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceAirFilterGuide.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceAirFilterGuide.cs deleted file mode 100644 index d335867ca..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceAirFilterGuide.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media.Imaging; -using Tango.SharedUI.Helpers; - -namespace Tango.PPC.Maintenance.Guides -{ - public class ReplaceAirFilterGuide : GuideBase - { - public override string Name => "Replacing the Air Filter"; - public override String Image => "../Images/Guides/Replacing-the-Air-Filter.gif"; - - private BitmapSource _icon; - public override BitmapSource Icon - { - get - { - if (_icon == null) - { - _icon = ResourceHelper.GetImageFromResources("Images/Guides/replacing-the-air-filter.png"); - } - return _icon; - } - } - - private List _steps; - public override List Steps - { - get - { - if (_steps == null) - { - _steps = GetStepsFromResource("ReplaceAirFilter"); - } - return _steps; - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceThreadGuide.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceThreadGuide.cs deleted file mode 100644 index ecc3f6026..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Guides/ReplaceThreadGuide.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Media.Imaging; -using Tango.SharedUI.Helpers; - -namespace Tango.PPC.Maintenance.Guides -{ - public class ReplaceThreadGuide : GuideBase - { - public override string Name => "Replacing the Thread"; - public override String Image => "../Images/Guides/Replacing-the-Thread.gif"; - - private BitmapSource _icon; - public override BitmapSource Icon - { - get - { - if (_icon == null) - { - _icon = ResourceHelper.GetImageFromResources("Images/Guides/replacing-the-thread.png"); - } - return _icon; - } - } - - private List _steps; - public override List Steps - { - get - { - if (_steps == null) - { - _steps = GetStepsFromResource("ReplaceThread"); - } - return _steps; - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Helpers/GuideHelper.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Helpers/GuideHelper.cs deleted file mode 100644 index 32518974d..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Helpers/GuideHelper.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; - -namespace Tango.PPC.Maintenance.Helpers -{ - public static class GuideHelper - { - public static List CreateAllGuides() - { - var resource = new ResourceDictionary - { - Source = new Uri("/Tango.PPC.Maintenance;component/Resources/Guides.xaml", UriKind.RelativeOrAbsolute) - }; - - Application.Current.Resources.MergedDictionaries.Add(resource); - - List guides = new List(); - - var callingAssembly = typeof(GuideHelper).Assembly; - - foreach (var guideType in callingAssembly.DefinedTypes.Where(x => x.Namespace == "Tango.PPC.Maintenance.Guides")) - { - guides.Add(Activator.CreateInstance(guideType) as GuideBase); - } - - return guides; - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-New-Thread.gif b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-New-Thread.gif deleted file mode 100644 index b6a974084..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-New-Thread.gif and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-an-Ink-Cartridge.gif b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-an-Ink-Cartridge.gif deleted file mode 100644 index 7087ebc64..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Loading-an-Ink-Cartridge.gif and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Air-Filter.gif b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Air-Filter.gif deleted file mode 100644 index 023adb4a9..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Air-Filter.gif and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Thread.gif b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Thread.gif deleted file mode 100644 index 8ab544d8b..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Replacing-the-Thread.gif and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Residue-Cartridges-A.gif b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Residue-Cartridges-A.gif deleted file mode 100644 index c310820b4..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/Residue-Cartridges-A.gif and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/handling-the-waste-cartridges.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/handling-the-waste-cartridges.png deleted file mode 100644 index 188e881bb..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/handling-the-waste-cartridges.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-an-ink-cartridge.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-an-ink-cartridge.png deleted file mode 100644 index 4f4dfc375..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-an-ink-cartridge.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-new-thread.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-new-thread.png deleted file mode 100644 index 1f508261b..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/loading-new-thread.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/machine-image.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/machine-image.png deleted file mode 100644 index 277599070..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/machine-image.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-air-filter.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-air-filter.png deleted file mode 100644 index eb8f518a3..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-air-filter.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-thread.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-thread.png deleted file mode 100644 index e858c3075..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Guides/replacing-the-thread.png and /dev/null 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 deleted file mode 100644 index 8fc4e1b33..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/absent.png and /dev/null 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 deleted file mode 100644 index ff2411eb5..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_error.png and /dev/null 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 deleted file mode 100644 index 08b9a7076..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_empty_right.png and /dev/null 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 deleted file mode 100644 index a39b6f073..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/Waste/present_full_right.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/action.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/action.png deleted file mode 100644 index 6d14ec5dc..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/action.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png deleted file mode 100644 index 5aaea8e6c..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cl-full.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png deleted file mode 100644 index 17c3225ed..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-empty.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png deleted file mode 100644 index b4ed45d1e..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/cone-full.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/guides.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/guides.png deleted file mode 100644 index 13b9013d7..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/guides.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/head_cleaning.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/head_cleaning.png deleted file mode 100644 index 373cb78c1..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/head_cleaning.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/inks.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/inks.png deleted file mode 100644 index 3872a77e4..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/inks.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png deleted file mode 100644 index 2607f4a26..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/l-full.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png deleted file mode 100644 index 554c16305..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/lubricant2.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/maintenance.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/maintenance.png deleted file mode 100644 index 526284750..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/maintenance.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/status.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/status.png deleted file mode 100644 index 0cc205a6c..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/status.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-green.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-green.png deleted file mode 100644 index f67323dde..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-green.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-red.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-red.png deleted file mode 100644 index 5e6b505a3..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-red.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-yellow.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-yellow.png deleted file mode 100644 index 359e93d6d..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/temperature-yellow.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/thread_loading.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/thread_loading.png deleted file mode 100644 index 5d536e7ae..000000000 Binary files a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Images/thread_loading.png and /dev/null differ diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceCommand.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceCommand.cs deleted file mode 100644 index 5c74d92cd..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceCommand.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core; -using Tango.Core.Commands; -using Tango.Core.DI; -using Tango.Integration.Operation; -using Tango.PPC.Common.Connection; -using Tango.PPC.Common.Notifications; - -namespace Tango.PPC.Maintenance -{ - public abstract class MaintenanceCommand : ExtendedObject - { - private IMachineProvider _machineProvider; - [TangoInject(Mode = TangoInjectMode.WhenAvailable)] - protected IMachineProvider MachineProvider - { - get { return _machineProvider; } - set - { - _machineProvider = value; RaisePropertyChangedAuto(); - _machineProvider.MachineOperator.StatusChanged += MachineOperator_StatusChanged; - } - } - - [TangoInject(Mode = TangoInjectMode.WhenAvailable)] - protected INotificationProvider NotificationProvider { get; set; } - - private RelayCommand _command; - public RelayCommand Command - { - get { return _command; } - set { _command = value; RaisePropertyChangedAuto(); } - } - - private bool _isEnabled; - public bool IsEnabled - { - get { return _isEnabled; } - set { _isEnabled = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - private T _state; - public T State - { - get { return _state; } - set { _state = value; RaisePropertyChangedAuto(); InvalidateRelayCommands(); } - } - - private void MachineOperator_StatusChanged(object sender, MachineStatuses e) - { - InvalidateRelayCommands(); - } - - public MaintenanceCommand() - { - TangoIOC.Default.Inject(this); - IsEnabled = true; - Command = new RelayCommand(Execute, CanExecute); - } - - protected virtual bool CanExecute() - { - if (!IsEnabled) return false; - if (MachineProvider == null) return false; - if (!MachineProvider.MachineOperator.CanPrint) return false; - - return true; - } - - private void Execute() - { - OnExecute(); - } - - protected abstract void OnExecute(); - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceModule.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceModule.cs deleted file mode 100644 index 18871ac78..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/MaintenanceModule.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Media.Imaging; -using Tango.BL.Enumerations; -using Tango.PPC.Common; -using Tango.PPC.Maintenance.Views; -using Tango.SharedUI.Helpers; - -namespace Tango.PPC.Maintenance -{ - /// - /// Represents a PPC . - /// - /// - [PPCModule(3)] - public class MaintenanceModule : PPCModuleBase - { - /// - /// Gets the module name. - /// - public override string Name - { - get - { - return "Maintenance"; - } - } - - /// - /// Gets the module description. - /// - public override string Description - { - get - { - return "PPC maintenance module."; - } - } - - /// - /// Gets the module cover image. - /// - public override BitmapSource Image - { - get - { - return ResourceHelper.GetImageFromResources("Images/maintenance.png"); - } - } - - /// - /// Gets the module entry point view type. - /// - public override Type MainViewType - { - get - { - return typeof(MainView); - } - } - - /// - /// Gets the permission required to see and load this module. - /// - public override Permissions Permission - { - get - { - return Permissions.RunPPC; - } - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - public override void Dispose() - { - //Dispose module here... - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs deleted file mode 100644 index 93af310ba..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/MidTankLevelModel.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.BL.Entities; -using Tango.Core; -using Tango.Integration.Operation; - -namespace Tango.PPC.Maintenance.Models -{ - public class MidTankLevelModel : ExtendedObject - { - public double Max { get; set; } - - private double _level; - public double Level - { - get { return _level; } - set { _level = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsLow)); RaisePropertyChanged(nameof(IsEmpty)); } - } - - public bool IsLow - { - get { return Level <= MachineOperator.LOW_MIDTANK_LITERS; } - } - - public bool IsEmpty - { - get { return Level <= MachineOperator.EMPTY_MIDTANK_LITERS; } - } - - public IdsPack IDSPack { get; set; } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/OverallTemperatureModel.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/OverallTemperatureModel.cs deleted file mode 100644 index 694071d0d..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Models/OverallTemperatureModel.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core; -using Tango.Integration.Operation; - -namespace Tango.PPC.Maintenance.Models -{ - public class OverallTemperatureModel : ExtendedObject - { - private double _temperature; - public double Temperature - { - get { return _temperature; } - set { _temperature = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(IsWarning)); RaisePropertyChanged(nameof(IsError)); } - } - - public bool IsWarning - { - get { return Temperature > MachineOperator.OVERALL_TEMPERATURE_WARNING; } - } - - public bool IsError - { - get { return Temperature >= MachineOperator.OVERALL_TEMPERATURE_ERROR; } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/AssemblyInfo.cs deleted file mode 100644 index 52774bee8..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Tango Module")] -[assembly: AssemblyVersion("2.0.1.1407")] - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located - //(used if a resource is not found in the page, - // or application resource dictionaries) - ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located - //(used if a resource is not found in the page, - // app, or any theme specific resource dictionaries) -)] diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.Designer.cs deleted file mode 100644 index 003dc17e5..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.PPC.Maintenance.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.PPC.Maintenance.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.resx b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.resx deleted file mode 100644 index af7dbebba..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.Designer.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.Designer.cs deleted file mode 100644 index 7b549e7b7..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Tango.PPC.Maintenance.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.settings b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.settings deleted file mode 100644 index 033d7a5e9..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Resources/Guides.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Resources/Guides.xaml deleted file mode 100644 index 24e1e0d71..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Resources/Guides.xaml +++ /dev/null @@ -1,60 +0,0 @@ - - - - 1. Loading New Thread - 2. Wait for a message indicating the system is ready to load the thread - 3. Place a cone with un-dyed thread into the thread feeding unit - 4. Feed the thread along the thread groove to the winder - 5. Place an empty collecting cone into the thread winder - 6. Insert the end of the thread into the empty collecting cone - 7. On the TS-1800 panel, press LOAD again - - - - 1. On the TS-1800 panel, press LOAD - 2. Wait for a message indicating the system is ready to load the thread - 3. Place a cone with un-dyed thread into the thread feeding unit - 4. Feed the tread along the feeding path up to the top cover - 5. Feed the thread along the thread groove to the winder - 6. Place an empty collecting cone into the thread winder - 7. Insert the end of the thread into the empty collecting cone - 8. On the TS-1800 panel, press LOAD again - - - - 1. Cut the current thread just after the feeding cone - 2. Remove the current feeding cone - 3. Place the new feeding cone into the thread feeding unit - 4. Tie the new thread to the current thread - 5. Cut off the ends of the thread leaving a small knot - 6. On the TS-1800 panel, press and hold the JOG button - 7. Hold the JOG button until the knot appears at the collecting cone - 8. Cut the thread at the collecting cone after the knot - 9. Remove the collecting cone - 10. Place an empty collecting cone into the winder - 11. Insert the end of the new thread into the empty collecting cone - - - - 1. Open the air filter cover - 2. Remove the old air filter - 3. Insert a new air filter - 4. Close the air filter cover - - - - 1. Open the cartridge cover - 2. Insert a full ink cartridge into the ink-loading slot - 3. Close the cartridge cover - 4. When ink loading is complete, open the cartridge cover - 5. Remove the empty ink cartridge - 6. Remove the stopper from the residue-filling opening - 7. Place the stopper into its allocated position on the top side of the empty ink cartridge - 8. Put the empty ink cartridge into storage. Optional: if an empty recycling slot is available - 9. Insert the empty ink cartridge into the slot for ink recycling - - - \ No newline at end of file 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 deleted file mode 100644 index 9dd45add4..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Tango.PPC.Maintenance.csproj +++ /dev/null @@ -1,320 +0,0 @@ - - - - - Debug - AnyCPU - {011470AC-6BD6-4366-B5F2-C82C065D4A84} - library - Tango.PPC.Maintenance - Tango.PPC.Maintenance - v4.6.1 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - - - - true - full - false - ..\..\..\Build\PPC\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - ..\..\..\Build\PPC\Release\ - TRACE - prompt - 4 - - - - ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.dll - - - ..\..\..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll - - - ..\..\..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll - - - ..\..\..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll - - - ..\..\..\packages\Ionic.Zip.1.9.1.8\lib\Ionic.Zip.dll - - - - - - ..\..\..\packages\System.Reactive.Core.3.1.1\lib\net46\System.Reactive.Core.dll - - - ..\..\..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll - - - ..\..\..\packages\System.Reactive.Linq.3.1.1\lib\net46\System.Reactive.Linq.dll - - - ..\..\..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll - - - - - - - - - 4.0 - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - - - GlobalVersionInfo.cs - - - - - - - - - - - - - - CleanerDispensingView.xaml - - - HeadCleaningView.xaml - - - - - - - - - - - - - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - - - - - GeneralGuideView.xaml - - - MaintenanceView.xaml - - - MainView.xaml - - - ResXFileCodeGenerator - Resources.Designer.cs - - - Designer - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - {f441feee-322a-4943-b566-110e12fd3b72} - Tango.BL - - - {a34ee0f0-649d-41c8-8489-b6f1cc6924ee} - Tango.Core - - - {b112d89a-a106-41ae-a0c1-4abc84c477f5} - Tango.DragAndDrop - - - {4399af76-db52-4cfb-8020-6f85bdb29fd5} - Tango.Explorer - - - {4206ac58-3b57-4699-8835-90bf6db01a61} - Tango.Integration - - - {bc932dbd-7cdb-488c-99e4-f02cf441f55e} - Tango.Logging - - - {e4927038-348d-4295-aaf4-861c58cb3943} - Tango.PMR - - - {d8f1ad85-526a-4f50-b6dc-d437af63d8d8} - Tango.Settings - - - {8491d07b-c1f6-4b62-a412-41b9fd2d6538} - Tango.SharedUI - - - {fd86424c-6e84-491b-8df9-3d0f5c236a2a} - Tango.Touch - - - {74e700b0-1156-4126-be40-ee450d3c3026} - Tango.Transport - - - {0be74eee-22cb-4dba-b896-793b9e1a3ac0} - Tango.PPC.Common - - - {04febb02-f782-4b96-b47d-f6902afa43be} - Tango.PPC.Storage - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Themes/Generic.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Themes/Generic.xaml deleted file mode 100644 index a77cc2281..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Themes/Generic.xaml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModelLocator.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModelLocator.cs deleted file mode 100644 index 1db63a9e4..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModelLocator.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.Core.DI; -using Tango.PPC.Maintenance.ViewModels; - -namespace Tango.PPC.Maintenance -{ - public static class ViewModelLocator - { - /// - /// Initializes a new instance of the ViewModelLocator class. - /// - static ViewModelLocator() - { - TangoIOC.Default.Register(); - TangoIOC.Default.Register(); - TangoIOC.Default.Register(); - } - - /// - /// Gets the main view VM. - /// - public static MainViewVM MainViewVM - { - get - { - return TangoIOC.Default.GetInstance(); - } - } - - /// - /// Gets the maintenance view VM. - /// - public static MaintenanceViewVM MaintenanceViewVM - { - get - { - return TangoIOC.Default.GetInstance(); - } - } - - /// - /// Gets the general guide view VM. - /// - public static GeneralGuideViewVM GeneralGuideViewVM - { - get - { - return TangoIOC.Default.GetInstance(); - } - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs deleted file mode 100644 index fd0475817..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/GeneralGuideViewVM.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PPC.Common; -using Tango.PPC.Common.Navigation; - -namespace Tango.PPC.Maintenance.ViewModels -{ - public class GeneralGuideViewVM : PPCViewModel, INavigationObjectReceiver - { - private DateTime _lastTime; - - private GuideBase _guide; - public GuideBase Guide - { - get { return _guide; } - set { _guide = value; RaisePropertyChangedAuto(); } - } - - - public override void OnApplicationStarted() - { - _lastTime = DateTime.Now; - } - - public void OnNavigatedToWithObject(GuideBase guide) - { - if (Guide != guide || (DateTime.Now - _lastTime) > TimeSpan.FromHours(1)) - { - guide.Steps.ForEach(x => x.IsChecked = false); - } - - Guide = guide; - - _lastTime = DateTime.Now; - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MainViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MainViewVM.cs deleted file mode 100644 index a614f7be2..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MainViewVM.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Tango.PPC.Common; -using Tango.PPC.Maintenance.Views; - -namespace Tango.PPC.Maintenance.ViewModels -{ - /// - /// Represents the main view VM and entry point for . - /// - /// - public class MainViewVM : PPCViewModel - { - /// - /// Called when the application has been started - /// - public override void OnApplicationStarted() - { - //Start initializing here rather then in the constructor. - } - - public override void OnNavigatedTo() - { - base.OnNavigatedTo(); - NavigationManager.NavigateTo(nameof(MaintenanceView), false); - } - } -} 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 deleted file mode 100644 index c0dc61150..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs +++ /dev/null @@ -1,324 +0,0 @@ -using Ionic.Zip; -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Data.Entity; -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; -using Tango.PPC.Maintenance.Dialogs; -using Tango.PPC.Maintenance.Helpers; -using Tango.PPC.Maintenance.Models; -using Tango.PPC.Maintenance.Views; -using Tango.PPC.Storage; - -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; } - - private List _midTankLevels; - public List MidTankLevels - { - get { return _midTankLevels; } - set { _midTankLevels = value; RaisePropertyChangedAuto(); } - } - - private OverallTemperatureModel _overallTemperature; - public OverallTemperatureModel OverallTemperature - { - get { return _overallTemperature; } - set { _overallTemperature = value; RaisePropertyChangedAuto(); } - } - - private String _totalDyeTime; - public String TotalDyeTime - { - get { return _totalDyeTime; } - set { _totalDyeTime = value; RaisePropertyChangedAuto(); } - } - - private String _totalDyeMeters; - public String TotalDyeMeters - { - get { return _totalDyeMeters; } - set { _totalDyeMeters = value; RaisePropertyChangedAuto(); } - } - - private SpoolState _spoolState; - public SpoolState SpoolState - { - get { return _spoolState; } - set - { - if (_spoolState != value) - { - _spoolState = value; - RaisePropertyChangedAuto(); - } - } - } - - private List _wasteStates; - public List WasteStates - { - get { return _wasteStates; } - set { _wasteStates = value; RaisePropertyChangedAuto(); } - } - - public RelayCommand ExportLogsCommand { get; set; } - - public OpenCloseDyeingHeadCommand OpenCloseDyeingHeadCommand { get; set; } - - public OpenCloseLeftLeadingWheelsCommand OpenCloseLeftLeadingWheelsCommand { get; set; } - - public OpenCloseRightLeadingWheelsCommand OpenCloseRightLeadingWheelsCommand { get; set; } - - public ResetThreadLoadingCommand ResetThreadLoadingCommand { get; set; } - - public RelayCommand HeadCleaningCommand { get; set; } - - public RelayCommand StartThreadLoadingCommand { get; set; } - - public RelayCommand StartThreadBreakCommand { get; set; } - - public RelayCommand DispenseCleanerLiquidCommand { get; set; } - - public MaintenanceViewVM() - { - Guides = new ObservableCollection(GuideHelper.CreateAllGuides()); - OverallTemperature = new OverallTemperatureModel(); - - OpenGuideCommand = new RelayCommand(OpenGuide); - ExportLogsCommand = new RelayCommand(ExportLogsToStorage); - - OpenCloseDyeingHeadCommand = new OpenCloseDyeingHeadCommand(); - OpenCloseLeftLeadingWheelsCommand = new OpenCloseLeftLeadingWheelsCommand(); - OpenCloseRightLeadingWheelsCommand = new OpenCloseRightLeadingWheelsCommand(); - ResetThreadLoadingCommand = new ResetThreadLoadingCommand(); - HeadCleaningCommand = new RelayCommand(PerformHeadCleaning, () => MachineProvider.MachineOperator.CanPrint); - StartThreadLoadingCommand = new RelayCommand(StartThreadLoadingWizard, () => MachineProvider.MachineOperator.CanPrint); - StartThreadBreakCommand = new RelayCommand(StartThreadBreakWizard, () => 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; - - DispenseCleanerLiquidCommand = new RelayCommand(DispenseCleanerLiquid, () => - { - if (MachineProvider.Machine.MachineHeadType == BL.Enumerations.HeadTypes.Arc) - { - return MachineProvider.MachineOperator.MachineEventsStateProvider.Events.Any(x => x.Type == BL.Enumerations.EventTypes.DYEING_HEAD_ARC_LID_IS_OPEN); - } - else - { - return MachineProvider.MachineOperator.MachineEventsStateProvider.Events.Any(x => x.Type == BL.Enumerations.EventTypes.DYEING_HEAD_COVER_IS_OPEN); - } - }); - - RaisePropertyChanged(nameof(DispenseCleanerLiquidCommand)); - } - - public override void OnApplicationReady() - { - base.OnApplicationReady(); - - MidTankLevels = MachineProvider.Machine.Configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex).Select(x => new MidTankLevelModel() - { - Max = MachineOperator.MAX_MIDTANK_LITERS, - IDSPack = x, - }).OrderBy(y => y.IDSPack.LiquidType.Code).ToList(); - } - - private void MachineEventsStateProvider_EventsChanged(object sender, IEnumerable e) - { - OpenCloseDyeingHeadCommand.IsEnabled = !e.Any(x => x.Type == BL.Enumerations.EventTypes.DRYER_DOOR_OPEN); - - InvokeUI(() => - { - DispenseCleanerLiquidCommand.RaiseCanExecuteChanged(); - }); - } - - private void MachineOperator_MachineStatusChanged(object sender, MachineStatus status) - { - UpdateMidTankLevels(status); - OverallTemperature.Temperature = status.OverallTemperature; - SpoolState = status.SpoolState; - 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); - } - - private void UpdateMidTankLevels(MachineStatus status) - { - if (IsVisible) - { - foreach (var item in status.IDSPacksLevels) - { - var model = MidTankLevels.SingleOrDefault(x => x.IDSPack.PackIndex == item.Index); - - if (model != null) - { - model.Level = item.MidTankLevel; - } - } - } - } - - private async void ExportLogsToStorage() - { - var result = await NavigationManager. - NavigateForResult( - new Storage.Models.StorageNavigationRequest() - { - Intent = Storage.Models.StorageNavigationIntent.SaveFile, - DefaultFileName = $"Tango-Logs-{DateTime.Now.ToFileName()}", - Filter = "do not display anything", - Title = "Export System Logs", - }); - - if (result != null) - { - String file = result.Path + ".zip"; - - IsFree = false; - - try - { - NotificationProvider.SetGlobalBusyMessage("Exporting system logs..."); - - var appFileLogger = LogManager.RegisteredLoggers.FirstOrDefault(x => x is FileLogger) as FileLogger; - - await Task.Factory.StartNew(() => - { - using (ZipFile zip = new ZipFile(file)) - { - zip.Password = "1Creativity"; - - if (appFileLogger != null) - { - zip.AddDirectory(appFileLogger.Folder); - } - - zip.ParallelDeflateThreshold = -1; - zip.Save(); - } - }); - - NotificationProvider.ReleaseGlobalBusyMessage(); - - await NotificationProvider.ShowSuccess("System logs exported successfully."); - } - catch (Exception ex) - { - NotificationProvider.ReleaseGlobalBusyMessage(); - LogManager.Log(ex, "Error exporting system logs."); - await NotificationProvider.ShowError($"An error occurred while trying to export the system logs.\n{ex.FlattenMessage()}"); - } - finally - { - NotificationProvider.ReleaseGlobalBusyMessage(); - IsFree = true; - } - } - } - - public async override void OnNavigatedTo() - { - base.OnNavigatedTo(); - - try - { - using (ObservablesContext db = ObservablesContext.CreateDefault()) - { - var jobRuns = await db.JobRuns.Select(x => new { x.StartDate, x.EndDate, x.EndPosition }).ToListAsync(); - - TotalDyeTime = TimeSpan.FromHours(jobRuns.Select(x => x.EndDate - x.StartDate).Sum(x => x.TotalHours)).ToStringUnlimitedHours(); - - int meters = (int)jobRuns.Select(x => x.EndPosition).Sum(); - TotalDyeMeters = $"{meters.ToString("N0")} meters"; - } - } - catch (Exception ex) - { - LogManager.Log(ex, "Error loading machine counters."); - TotalDyeTime = "error!"; - TotalDyeMeters = "error!"; - } - } - - private async void PerformHeadCleaning() - { - await NotificationProvider.ShowDialog(); - } - - private void StartThreadLoadingWizard() - { - ThreadLoadingService.StartThreadLoadingWizard(); - } - - private void StartThreadBreakWizard() - { - ThreadLoadingService.StartThreadBreakWizard(); - } - - private async void DispenseCleanerLiquid() - { - await NotificationProvider.ShowDialog(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml deleted file mode 100644 index ecff03b58..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml.cs deleted file mode 100644 index 10b5337ce..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/GeneralGuideView.xaml.cs +++ /dev/null @@ -1,33 +0,0 @@ -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.Maintenance.Views -{ - /// - /// Interaction logic for GeneralGuideView.xaml - /// - public partial class GeneralGuideView : UserControl - { - public GeneralGuideView() - { - InitializeComponent(); - } - - private void TouchCheckBox_Loaded(object sender, RoutedEventArgs e) - { - - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml deleted file mode 100644 index be6161952..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml.cs deleted file mode 100644 index f859c9524..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MainView.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -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.Maintenance.Views -{ - /// - /// Interaction logic for MainView.xaml - /// - public partial class MainView : UserControl - { - public MainView() - { - InitializeComponent(); - } - } -} 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 deleted file mode 100644 index d00b4abb2..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml +++ /dev/null @@ -1,341 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Maintenance - - - - - - - - - - - - Current Status - - - - - - - - - - - - - - - - - - - - - - - - º - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Temperature - Inks - Collecting Cone - Waste - - - - - - - - - - - Actions - - - - - - - - - - - - - - - - - - - - - RUN HEAD CLEANING - - DISPENSE CLEANING LIQUID - - EXPORT SYSTEM LOGS - - - - - - - - - - - Thread Loading - - - - - - THREAD BREAK WIZARD - - - This wizard will help you resolve thread breaking issues - - - - - THREAD LOADING WIZARD - - - This wizard will help you load a new thread in to the system - - - - RESET THREAD LOADING - - - - - - - - - - - Guides - - - - - - - - - - - - - - - - - - - - - - - - - Total Dyeing Time: - - - - - Total Dyed Length: - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml.cs deleted file mode 100644 index 8fb9bd7ca..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Views/MaintenanceView.xaml.cs +++ /dev/null @@ -1,30 +0,0 @@ -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; -using Tango.Integration.Operation; -using Tango.PPC.Maintenance.Models; - -namespace Tango.PPC.Maintenance.Views -{ - /// - /// Interaction logic for MainView.xaml - /// - public partial class MaintenanceView : UserControl - { - public MaintenanceView() - { - InitializeComponent(); - } - } -} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/app.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/app.config deleted file mode 100644 index 1e22e6a88..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/app.config +++ /dev/null @@ -1,61 +0,0 @@ - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config deleted file mode 100644 index 468d4f366..000000000 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file -- cgit v1.3.1