diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-10-27 12:09:07 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-10-27 12:09:07 +0200 |
| commit | 312e8ccad554d6d0e7d21444e069731e770db978 (patch) | |
| tree | d20a3657dab87de400675f5f8aca77c0f124b2bd /Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | |
| parent | 4954a924b8a5b8fd7a213a444027e74b936359be (diff) | |
| download | Tango-312e8ccad554d6d0e7d21444e069731e770db978.tar.gz Tango-312e8ccad554d6d0e7d21444e069731e770db978.zip | |
Added DEVICE_ID, DEVICE_NAME & IS_DEVICE_REGISTERED fields to db.
Prevent multiple machine setup from different devices.
Moved notification to inner layout on PPC.
Improved PPC notification bar.
Added more machine status support from embedded.
FIxed issue with external bridge and emergency pressed.
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index fe4e230ec..e439c4ee9 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -774,8 +774,37 @@ namespace Tango.Integration.Operation /// <param name="response">The response.</param> protected virtual void OnMachineStatusChanged(StartMachineStatusUpdateResponse response) { + bool changed = (MachineStatus == null || response.Status.State != MachineStatus.State); + MachineStatus = response.Status; MachineStatusChanged?.Invoke(this, MachineStatus); + + if (changed) + { + LogManager.Log($"Machine State Changed: {MachineStatus.State}."); + + switch (MachineStatus.State) + { + case MachineState.Initializing: + Status = MachineStatuses.Service; + break; + //case MachineState.PreparingJob: + // Status = MachineStatuses.GettingReady; + // break; + case MachineState.Ready: + Status = MachineStatuses.ReadyToDye; + break; + //case MachineState.Sleep: + // Status = MachineStatuses.Standby; + // break; + case MachineState.PowerOff: + Status = MachineStatuses.ShuttingDown; + break; + case MachineState.Error: + Status = MachineStatuses.Error; + break; + } + } } /// <summary> |
