aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-09 02:27:58 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2020-03-09 02:27:58 +0200
commiteb793f20dc078a304a423a481e5bb0eddce71471 (patch)
treeca7b60be7b2d588875017b3885ba3d3cd3f893f9 /Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs
parent1b5d452cccd3be79c226f1438c3efe7abe786017 (diff)
parentae9cdafa944db884bf878f36a7a328c53a7588a8 (diff)
downloadTango-eb793f20dc078a304a423a481e5bb0eddce71471.tar.gz
Tango-eb793f20dc078a304a423a481e5bb0eddce71471.zip
MERGE
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs99
1 files changed, 13 insertions, 86 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs
index aeb349bdc..8d221c3f3 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Maintenance/ViewModels/MaintenanceViewVM.cs
@@ -11,6 +11,7 @@ using Tango.Integration.Operation;
using Tango.Logging;
using Tango.PMR.MachineStatus;
using Tango.PPC.Common;
+using Tango.PPC.Maintenance.Commands;
using Tango.PPC.Maintenance.Helpers;
using Tango.PPC.Maintenance.Models;
using Tango.PPC.Maintenance.Views;
@@ -38,11 +39,15 @@ namespace Tango.PPC.Maintenance.ViewModels
set { _overallTemperature = value; RaisePropertyChangedAuto(); }
}
- public RelayCommand OpenDyeingHeadCommand { get; set; }
+ public RelayCommand ExportLogsCommand { get; set; }
- public RelayCommand CloseDyeingHeadCommand { get; set; }
+ public OpenCloseDyeingHeadCommand OpenCloseDyeingHeadCommand { get; set; }
- public RelayCommand ExportLogsCommand { get; set; }
+ public OpenCloseLeftLeadingWheelsCommand OpenCloseLeftLeadingWheelsCommand { get; set; }
+
+ public OpenCloseRightLeadingWheelsCommand OpenCloseRightLeadingWheelsCommand { get; set; }
+
+ public ResetThreadLoadingCommand ResetThreadLoadingCommand { get; set; }
public MaintenanceViewVM()
{
@@ -50,10 +55,12 @@ namespace Tango.PPC.Maintenance.ViewModels
OverallTemperature = new OverallTemperatureModel();
OpenGuideCommand = new RelayCommand<GuideBase>(OpenGuide);
-
- OpenDyeingHeadCommand = new RelayCommand(OpenDyeingHead);
- CloseDyeingHeadCommand = new RelayCommand(CloseDyeingHead);
ExportLogsCommand = new RelayCommand(ExportLogsToStorage);
+
+ OpenCloseDyeingHeadCommand = new OpenCloseDyeingHeadCommand();
+ OpenCloseLeftLeadingWheelsCommand = new OpenCloseLeftLeadingWheelsCommand();
+ OpenCloseRightLeadingWheelsCommand = new OpenCloseRightLeadingWheelsCommand();
+ ResetThreadLoadingCommand = new ResetThreadLoadingCommand();
}
public override void OnApplicationStarted()
@@ -101,86 +108,6 @@ namespace Tango.PPC.Maintenance.ViewModels
}
}
- private void OpenDyeingHead()
- {
- IsFree = false;
-
- try
- {
- NotificationProvider.SetGlobalBusyMessage("Opening dyeing head lead...");
-
- MachineProvider.MachineOperator.StartMotorHoming(new PMR.Diagnostics.MotorHomingRequest()
- {
- Direction = PMR.Diagnostics.MotorDirection.Backward,
- MotorType = PMR.Hardware.HardwareMotorType.MotoDhLid,
- Speed = 400,
- }).Subscribe((response) =>
- {
- //Next
- }, (ex) =>
- {
- //Error
- IsFree = true;
- NotificationProvider.ReleaseGlobalBusyMessage();
- LogManager.Log(ex, "Error opening dyeing head lead.");
- NotificationProvider.ShowError(ex.FlattenMessage());
- }, () =>
- {
- //Complete
- IsFree = true;
- NotificationProvider.ReleaseGlobalBusyMessage();
- NotificationProvider.ShowSuccess("The dyeing head lead is now opened.");
- });
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error opening dyeing head lead.");
- NotificationProvider.ReleaseGlobalBusyMessage();
- NotificationProvider.ShowError(ex.FlattenMessage());
- IsFree = true;
- }
- }
-
- private void CloseDyeingHead()
- {
- IsFree = false;
-
- try
- {
- NotificationProvider.SetGlobalBusyMessage("Closing dyeing head lead...");
-
- MachineProvider.MachineOperator.StartMotorHoming(new PMR.Diagnostics.MotorHomingRequest()
- {
- Direction = PMR.Diagnostics.MotorDirection.Forward,
- MotorType = PMR.Hardware.HardwareMotorType.MotoDhLid,
- Speed = 400,
- }).Subscribe((response) =>
- {
- //Next
- }, (ex) =>
- {
- //Error
- IsFree = true;
- NotificationProvider.ReleaseGlobalBusyMessage();
- LogManager.Log(ex, "Error closing dyeing head lead.");
- NotificationProvider.ShowError(ex.FlattenMessage());
- }, () =>
- {
- //Complete
- IsFree = true;
- NotificationProvider.ReleaseGlobalBusyMessage();
- NotificationProvider.ShowSuccess("The dyeing head lead is now closed.");
- });
- }
- catch (Exception ex)
- {
- LogManager.Log(ex, "Error closing dyeing head lead.");
- NotificationProvider.ReleaseGlobalBusyMessage();
- NotificationProvider.ShowError(ex.FlattenMessage());
- IsFree = true;
- }
- }
-
private async void ExportLogsToStorage()
{
var result = await NavigationManager.