diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs index 0edc04845..d0e03f873 100644 --- a/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs +++ b/Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs @@ -189,12 +189,15 @@ namespace Tango.Integration.Operation get { return _status; } protected set { - _status = value; - RaisePropertyChangedAuto(); - OnMachineStatusChanged(value); - RaisePropertyChanged(nameof(IsPrinting)); - RaisePropertyChanged(nameof(CanPrint)); - LogManager.Log("Machine operator status changed: " + _status); + if (_status != value) + { + _status = value; + RaisePropertyChangedAuto(); + OnMachineStatusChanged(value); + RaisePropertyChanged(nameof(IsPrinting)); + RaisePropertyChanged(nameof(CanPrint)); + LogManager.Log("Machine operator status changed: " + _status); + } } } @@ -690,11 +693,11 @@ namespace Tango.Integration.Operation { LogRequestFailed(request, ex); } + } - if (MachineEventsStateProvider != null) - { - MachineEventsStateProvider.ApplyEvents(new List<Event>()); - } + if (MachineEventsStateProvider != null) + { + MachineEventsStateProvider.Reset(); } await base.Disconnect(); @@ -724,6 +727,10 @@ namespace Tango.Integration.Operation DeviceInformation = response.Message.DeviceInformation; + _diagnosticsSent = false; + _eventsSent = false; + _debugSent = false; + OnEnableDiagnosticsChanged(EnableDiagnostics); OnEnableEmbeddedDebuggingChanged(EnableEmbeddedDebugging); OnEnableEventsNotification(EnableEventsNotification); @@ -1305,6 +1312,10 @@ namespace Tango.Integration.Operation LogRequestSent(request); bool responseLogged = false; + Status = MachineStatuses.Printing; + RunningJob = originalJob; + PrintingStarted?.Invoke(this, new PrintingEventArgs(handler, originalJob)); + SendContinuousRequest<JobRequest, JobResponse>(request, null, TimeSpan.FromSeconds(2)).Subscribe((response) => { handler.RaiseStatusReceived(response.Message.Status); @@ -1312,9 +1323,6 @@ namespace Tango.Integration.Operation if (!responseLogged) { responseLogged = true; - Status = MachineStatuses.Printing; - RunningJob = originalJob; - PrintingStarted?.Invoke(this, new PrintingEventArgs(handler, originalJob)); LogResponseReceived(response.Message); } }, (ex) => |
