From 86b886ede72dff8c3d96cae424ecba7464edee9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 15 Jun 2018 12:32:07 +0200 Subject: [PATCH] Remove resend repetition code It's apparently completely broken and the fact that no one noticed and reported that means it never really gets used either from the looks of it. So instead of allowing it to introduce broken resend handling, we'll rather remove it for now. --- src/octoprint/plugins/virtual_printer/virtual.py | 2 -- src/octoprint/settings.py | 1 - src/octoprint/util/comm.py | 13 ------------- 3 files changed, 16 deletions(-) diff --git a/src/octoprint/plugins/virtual_printer/virtual.py b/src/octoprint/plugins/virtual_printer/virtual.py index 7531df71e..e1aa40202 100644 --- a/src/octoprint/plugins/virtual_printer/virtual.py +++ b/src/octoprint/plugins/virtual_printer/virtual.py @@ -680,8 +680,6 @@ class VirtualPrinter(object): if not self._brokenResend: self._sendOk() - if settings().getBoolean(["devel", "virtualPrinter", "repetierStyleResends"]): - request_resend() request_resend() def _debugTrigger(self, data): diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index af433e9f4..498e4c025 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -382,7 +382,6 @@ default_settings = { "includeFilenameInOpened": True, "hasBed": True, "repetierStyleTargetTemperature": False, - "repetierStyleResends": False, "okBeforeCommandOutput": False, "smoothieTemperatureReporting": False, "reprapfwM114": False, diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 64032f1d0..62010267d 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -445,8 +445,6 @@ class MachineCom(object): self._lastCommError = None self._lastResendNumber = None self._currentResendCount = 0 - self._resendSwallowRepetitions = settings().getBoolean(["serial", "ignoreIdenticalResends"]) - self._resendSwallowRepetitionsCounter = 0 self._firmware_detection = settings().getBoolean(["serial", "firmwareDetection"]) self._firmware_info_received = not self._firmware_detection @@ -1771,7 +1769,6 @@ class MachineCom(object): self._logger.info("Detected Repetier firmware, enabling relevant features for issue free communication") self._alwaysSendChecksum = True - self._resendSwallowRepetitions = True self._blockWhileDwelling = True supportRepetierTargetTemp = True disable_external_heatup_detection = True @@ -2696,20 +2693,10 @@ class MachineCom(object): self._currentResendCount += 1 return True - # If we ignore resend repetitions (Repetier firmware...), check if we - # need to do this now. If the same line number has been requested we - # already saw and resent, we'll ignore it up to times. - if self._resendSwallowRepetitions and lineToResend == self._lastResendNumber and self._resendSwallowRepetitionsCounter > 0: - self._logger.info("Ignoring resend request for line %d, that is probably a repetition sent by the " - "firmware to ensure it arrives, not a real request" % lineToResend) - self._resendSwallowRepetitionsCounter -= 1 - return True - self._resendActive = True self._resendDelta = resendDelta self._lastResendNumber = lineToResend self._currentResendCount = 0 - self._resendSwallowRepetitionsCounter = settings().getInt(["serial", "identicalResendsCountdown"]) if self._resendDelta > len(self._lastLines) or len(self._lastLines) == 0 or self._resendDelta < 0: error_text = "Printer requested line %d but no sufficient history is available, can't resend" % lineToResend