diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-10 18:28:41 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-10 18:28:41 +0200 |
| commit | a65868d1d77b1929b855abd0c19bdc08bc9cee9d (patch) | |
| tree | 09486bed718fb096914780f33313fb82a0207c87 /Software/Visual_Studio/Tango.Integration/Operation/MachineOperator.cs | |
| parent | 82179e1b69b62b971a04af571979e7d10c60fd7a (diff) | |
| parent | ac9678197fc6142595089155d98442239a64e6d7 (diff) | |
| download | Tango-a65868d1d77b1929b855abd0c19bdc08bc9cee9d.tar.gz Tango-a65868d1d77b1929b855abd0c19bdc08bc9cee9d.zip | |
merge
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) => |
