From 105b68c8077d3fea3828cb1dc576a6e59c7c7236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 31 Oct 2014 21:45:08 +0100 Subject: [PATCH] Move the OK processing at the end of the message receiver for now to make temperature reporting outside of heatup work on Marlin again --- .../comm/protocol/reprap/__init__.py | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/octoprint/comm/protocol/reprap/__init__.py b/src/octoprint/comm/protocol/reprap/__init__.py index 1de456393..6b11bdcb4 100644 --- a/src/octoprint/comm/protocol/reprap/__init__.py +++ b/src/octoprint/comm/protocol/reprap/__init__.py @@ -345,27 +345,6 @@ class RepRapProtocol(Protocol): self._handle_resend_request(message) return - if self._resend_delta is None and not self.is_streaming(): - if time.time() > self._lastTemperatureUpdate + 5: - self._send_temperature_query(withType=True) - elif self.is_sd_printing() and time.time() > self._lastSdProgressUpdate + 5: - self._send_sd_progress_query(withType=True) - - # ok == go ahead with sending - if RepRapProtocol.MESSAGE_OK(message): - if self._state == State.CONNECTED and self._startSeen: - # if we are currently connected, have seen start and just gotten an "ok" we are now operational - self._changeState(State.OPERATIONAL) - if self.is_heating_up(): - self._heatupDone() - - # lower cache fill count since the command went through - with self._nack_lock: - if len(self._nack_lines) > 0: - self._nack_lines.popleft() - self._clear_for_send.set() - return - if RepRapProtocol.MESSAGE_WAIT(message): with self._nack_lock: self._clear_for_send.set() @@ -451,6 +430,27 @@ class RepRapProtocol(Protocol): self._startSeen = True self._clear_for_send.set() + if self._resend_delta is None and not self.is_streaming(): + if time.time() > self._lastTemperatureUpdate + 5: + self._send_temperature_query(withType=True) + elif self.is_sd_printing() and time.time() > self._lastSdProgressUpdate + 5: + self._send_sd_progress_query(withType=True) + + # ok == go ahead with sending + if RepRapProtocol.MESSAGE_OK(message): + if self._state == State.CONNECTED and self._startSeen: + # if we are currently connected, have seen start and just gotten an "ok" we are now operational + self._changeState(State.OPERATIONAL) + if self.is_heating_up(): + self._heatupDone() + + # lower cache fill count since the command went through + with self._nack_lock: + if len(self._nack_lines) > 0: + self._nack_lines.popleft() + self._clear_for_send.set() + return + def onTimeoutReceived(self, source): if self._transport != source: return