From 62298c55b8df9543922d40e8a80e3bcac626ed45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 24 Jul 2019 17:04:12 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Remove=20redundancy=20for=20trig?= =?UTF-8?q?ger=5Fok=5Fafter=5Fresend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/comm/protocol/reprap/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/octoprint/comm/protocol/reprap/__init__.py b/src/octoprint/comm/protocol/reprap/__init__.py index d0bb9647d..2b7e97eb4 100644 --- a/src/octoprint/comm/protocol/reprap/__init__.py +++ b/src/octoprint/comm/protocol/reprap/__init__.py @@ -348,7 +348,6 @@ class ReprapGcodeProtocol(Protocol, ThreeDPrinterProtocolMixin, MotorControlProt printing=kwargs.get("timeouts", dict()).get("max_consecutive_printing", 5), long=kwargs.get("timeouts", dict()).get("max_consecutive_long", 5), ) - self._trigger_ok_after_resend = FallbackValue(self.flavor.trigger_ok_after_resend) flavor_comm_attrs = self.get_flavor_attributes_starting_with(self.flavor, "comm_") flavor_message_attrs = self.get_flavor_attributes_starting_with(self.flavor, "message_") @@ -1398,9 +1397,9 @@ class ReprapGcodeProtocol(Protocol, ThreeDPrinterProtocolMixin, MotorControlProt self._send_queue.resend_active = True finally: - if self._trigger_ok_after_resend.effective == "always": + if self.flavor.trigger_ok_after_resend == "always": self._on_comm_ok() - elif self._trigger_ok_after_resend.effective == "detect": + elif self.flavor.trigger_ok_after_resend == "detect": self._resend_ok_timer = threading.Timer(self.timeouts.get("resendOk", 1.0), self._resend_simulate_ok) self._resend_ok_timer.start() @@ -2516,8 +2515,6 @@ class ReprapGcodeProtocol(Protocol, ThreeDPrinterProtocolMixin, MotorControlProt def _switch_flavor(self, new_flavor): self.flavor = new_flavor.with_overrides(self.flavor_overrides) - self._trigger_ok_after_resend = FallbackValue(self._trigger_ok_after_resend.value, fallback=self.flavor.trigger_ok_after_resend) - flavor_comm_attrs = self.get_flavor_attributes_starting_with(self.flavor, "comm_") flavor_message_attrs = self.get_flavor_attributes_starting_with(self.flavor, "message_") flavor_error_attrs = self.get_flavor_attributes_starting_with(self.flavor, "error_")