✨ Add setting to disable SD print detection

Some firmware variants (Ultimaker 2/2+, maybe others) send a file
selected message while just scrolling through the SD file list on the
integrated controller unit. M27 polling right after file selection might
cause issues for them. This patch allows to work around that.

Closes #3479

See also #1407
This commit is contained in:
Gina Häußge committed 2020-04-03 18:24:54 +02:00
1 parent 0da0e6cf8b
commit 8ee6b9fdf1
5 files changed
+13 -1

No files matched your search

+2
View File
@@ -187,6 +187,7 @@ def getSettings():
"blockWhileDwelling": s.getBoolean(["serial", "blockWhileDwelling"]),
"useParityWorkaround": s.get(["serial", "useParityWorkaround"]),
"sendM112OnError": s.getBoolean(["serial", "sendM112OnError"]),
"disableSdPrintingDetection": s.getBoolean(["serial", "disableSdPrintingDetection"]),
"ackMax": s.getInt(["serial", "ackMax"]),
"maxTimeoutsIdle": s.getInt(["serial", "maxCommunicationTimeouts", "idle"]),
"maxTimeoutsPrinting": s.getInt(["serial", "maxCommunicationTimeouts", "printing"]),
@@ -484,6 +485,7 @@ def _saveSettings(data):
if value in ("always", "detect", "never"):
s.set(["serial", "useParityWorkaround"], value)
if "sendM112OnError" in data["serial"]: s.setBoolean(["serial", "sendM112OnError"], data["serial"]["sendM112OnError"])
if "disableSdPrintingDetection" in data["serial"]: s.setBoolean(["serial", "disableSdPrintingDetection"], data["serial"]["disableSdPrintingDetection"])
if "ackMax" in data["serial"]: s.setInt(["serial", "ackMax"], data["serial"]["ackMax"])
if "logPositionOnPause" in data["serial"]: s.setBoolean(["serial", "logPositionOnPause"], data["serial"]["logPositionOnPause"])
if "logPositionOnCancel" in data["serial"]: s.setBoolean(["serial", "logPositionOnCancel"], data["serial"]["logPositionOnCancel"])
+1
View File
@@ -153,6 +153,7 @@ default_settings = {
"useParityWorkaround": "detect",
"maxConsecutiveResends": 10,
"sendM112OnError": True,
"disableSdPrintingDetection": False,
"ackMax": 1,
"capabilities": {
@@ -207,6 +207,7 @@ $(function() {
self.serial_capBusyProtocol = ko.observable(undefined);
self.serial_capEmergencyParser = ko.observable(undefined);
self.serial_sendM112OnError = ko.observable(undefined);
self.serial_disableSdPrintingDetection = ko.observable(undefined);
self.serial_ackMax = ko.observable(undefined);
self.folder_uploads = ko.observable(undefined);
@@ -244,6 +244,13 @@
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: serial_disableSdPrintingDetection" id="settings-disableSdPrintingDetection"> {{ _('Disable SD printing detection') }} <span class="label">{{ _('Ultimaker 2/2+') }}</span>
</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox">
+2 -1
View File
@@ -457,6 +457,7 @@ class MachineCom(object):
self._sdRelativePath = settings().getBoolean(["serial", "sdRelativePath"])
self._blockWhileDwelling = settings().getBoolean(["serial", "blockWhileDwelling"])
self._send_m112_on_error = settings().getBoolean(["serial", "sendM112OnError"])
self._disable_sd_printing_detection = settings().getBoolean(["serial", "disableSdPrintingDetection"])
self._current_line = 1
self._line_mutex = threading.RLock()
self._resendDelta = None
@@ -2444,7 +2445,7 @@ class MachineCom(object):
if self.isOperational() \
and not self._sdstatus_autoreporting \
and not self._connection_closing \
and self.isSdFileSelected() \
and (self.isSdFileSelected() and not self._disable_sd_printing_detection or self.isSdPrinting()) \
and not self._long_running_command \
and not self._dwelling_until \
and not self._heating: