From 1706653b596c273cf425e6758251eb0771bcef28 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Fri, 22 May 2015 17:51:53 -0400 Subject: [PATCH] Fix an issue where the UI state wasn't being updated This could happen if you pause a print within 500ms from a gcode command being executed on the serial com. The update was ignored and if we paused we may never get another callback update so the UI would never get updated. This could also happen when we just open the UI and we see the temperature values appear meaning the connection was successful, but it doesn't say Operational and the Print button is disabled for about 5 seconds (the next temperature update). --- Cura/gui/printWindow.py | 4 ++-- Cura/util/printerConnection/serialConnection.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cura/gui/printWindow.py b/Cura/gui/printWindow.py index 43552374..e3e5eadb 100644 --- a/Cura/gui/printWindow.py +++ b/Cura/gui/printWindow.py @@ -374,7 +374,7 @@ class printWindowPlugin(wx.Frame): return self._lastUpdateTime = t - if extraInfo is not None: + if extraInfo is not None and len(extraInfo) > 0: self._addTermLog('< %s\n' % (extraInfo)) self._updateButtonStates() @@ -522,7 +522,7 @@ class printWindowBasic(wx.Frame): return self._lastUpdateTime = t - if extraInfo is not None: + if extraInfo is not None and len(extraInfo) > 0: self._addTermLog('< %s\n' % (extraInfo)) self._updateButtonStates() diff --git a/Cura/util/printerConnection/serialConnection.py b/Cura/util/printerConnection/serialConnection.py index 2c8d8292..6a2c2548 100644 --- a/Cura/util/printerConnection/serialConnection.py +++ b/Cura/util/printerConnection/serialConnection.py @@ -222,7 +222,7 @@ class serialConnection(printerConnectionBase.printerConnectionBase): line = line[1].split(':', 1) self._commState = int(line[0]) self._commStateString = line[1] - self._doCallback() + self._doCallback('') elif line[0] == 'progress': self._printProgress = int(line[1]) self._doCallback() -- 2.30.2