Option to send M0/M1 to the printer
Also added a message to the serial output if M0/M1 is blocked. Closes #1513
This commit is contained in:
1 parent
99ef84788a
commit
81471df419
5 files changed
+18
-2
No files matched your search
@@ -150,6 +150,7 @@ def getSettings():
|
||||
"ignoreErrorsFromFirmware": s.getBoolean(["serial", "ignoreErrorsFromFirmware"]),
|
||||
"disconnectOnErrors": s.getBoolean(["serial", "disconnectOnErrors"]),
|
||||
"triggerOkForM29": s.getBoolean(["serial", "triggerOkForM29"]),
|
||||
"blockM0M1": s.getBoolean(["serial", "blockM0M1"]),
|
||||
"logPositionOnPause": s.getBoolean(["serial", "logPositionOnPause"]),
|
||||
"logPositionOnCancel": s.getBoolean(["serial", "logPositionOnCancel"]),
|
||||
"supportResendsWithoutOk": s.get(["serial", "supportResendsWithoutOk"]),
|
||||
@@ -395,6 +396,7 @@ def _saveSettings(data):
|
||||
if "ignoreErrorsFromFirmware" in data["serial"]: s.setBoolean(["serial", "ignoreErrorsFromFirmware"], data["serial"]["ignoreErrorsFromFirmware"])
|
||||
if "disconnectOnErrors" in data["serial"]: s.setBoolean(["serial", "disconnectOnErrors"], data["serial"]["disconnectOnErrors"])
|
||||
if "triggerOkForM29" in data["serial"]: s.setBoolean(["serial", "triggerOkForM29"], data["serial"]["triggerOkForM29"])
|
||||
if "blockM0M1" in data["serial"]: s.setBoolean(["serial", "blockM0M1"], data["serial"]["blockM0M1"])
|
||||
if "supportResendsWithoutOk" in data["serial"]:
|
||||
value = data["serial"]["supportResendsWithoutOk"]
|
||||
if value in ("always", "detect", "never"):
|
||||
|
||||
@@ -145,7 +145,8 @@ default_settings = {
|
||||
},
|
||||
|
||||
# command specific flags
|
||||
"triggerOkForM29": True
|
||||
"triggerOkForM29": True,
|
||||
"blockM0M1": True
|
||||
},
|
||||
"server": {
|
||||
"host": None,
|
||||
|
||||
@@ -168,6 +168,7 @@ $(function() {
|
||||
self.serial_helloCommand = ko.observable(undefined);
|
||||
self.serial_serialErrorBehaviour = ko.observable("cancel");
|
||||
self.serial_triggerOkForM29 = ko.observable(undefined);
|
||||
self.serial_blockM0M1 = ko.observable(undefined);
|
||||
self.serial_waitForStart = ko.observable(undefined);
|
||||
self.serial_sendChecksum = ko.observable("print");
|
||||
self.serial_sdRelativePath = ko.observable(undefined);
|
||||
|
||||
@@ -321,6 +321,12 @@
|
||||
<span class="help-block">{{ _('Try checking this if you run into connection timeouts due to your printer taking too long to respond to OctoPrint\'s handshake attempts on connect.') }}</span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: serial_blockM0M1" id="settings-serialBlockM0M1"> {{ _('Do not send <code>M0</code>/<code>M1</code> commands to the firmware, only pause') }}
|
||||
<span class="help-block">{{ _('Most firmware will block and wait for the user to press the button on the controller when an <code>M0</code> or <code>M1</code> is received. Due to that OctoPrint will normally not send those commands to the printer and only pause any ongoing prints. If you want OctoPrint to send those commands to your printer, uncheck this option.') }}</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div><small><a href="#" class="muted" data-bind="toggleContent: { class: 'fa-caret-right fa-caret-down', container: '#settings_serial_protocol_finetuning .hide' }"><i class="fa fa-caret-right"></i> {{ _('Advanced options') }}</a></small></div>
|
||||
|
||||
@@ -410,6 +410,7 @@ class MachineCom(object):
|
||||
|
||||
self._hello_command = settings().get(["serial", "helloCommand"])
|
||||
self._trigger_ok_for_m29 = settings().getBoolean(["serial", "triggerOkForM29"])
|
||||
self._block_M0_M1 = settings().getBoolean(["serial", "blockM0M1"])
|
||||
|
||||
self._hello_command = settings().get(["serial", "helloCommand"])
|
||||
|
||||
@@ -3163,7 +3164,12 @@ class MachineCom(object):
|
||||
|
||||
def _gcode_M0_queuing(self, cmd, cmd_type=None, gcode=None, subcode=None, *args, **kwargs):
|
||||
self.setPause(True)
|
||||
return None, # Don't send the M0 or M1 to the machine, as M0 and M1 are handled as an LCD menu pause.
|
||||
if self._block_M0_M1:
|
||||
if self.isPrinting():
|
||||
self._log("Not sending {} to printer since it's known to block communication, only pausing".format(cmd))
|
||||
else:
|
||||
self._log("Not sending {} to printer since it's known to block communication".format(cmd))
|
||||
return None, # Don't send the M0 or M1 to the machine, as M0 and M1 are handled as an LCD menu pause.
|
||||
_gcode_M1_queuing = _gcode_M0_queuing
|
||||
|
||||
def _gcode_M25_queuing(self, cmd, cmd_type=None, gcode=None, subcode=None, *args, **kwargs):
|
||||
|
||||
Reference in new issue
Block a user