chiark / gitweb /
Fix an issue where the UI state wasn't being updated
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Fri, 22 May 2015 21:51:53 +0000 (17:51 -0400)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Fri, 22 May 2015 21:51:53 +0000 (17:51 -0400)
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
Cura/util/printerConnection/serialConnection.py

index 435523745bd0d120158780a249c44b292bde1867..e3e5eadb13a007079071b7307884637c661ab784 100644 (file)
@@ -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()
index 2c8d8292a723ccc63ee5660ddbec3ec534bab1cd..6a2c254859090b421928eb52afe9fe80a0d8d37e 100644 (file)
@@ -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()