diff options
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/Commands')
6 files changed, 0 insertions, 353 deletions
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<object> - { - 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<OpenCloseMotorCommand.MotorState> - { - 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.") - { - - } - } -} |
