✨ Expose unknown command treatment on UI & add auto detection

Prusa Firmware now has sendChecksumWithUnknownCommands and unknownCommandsNeedAck as they've decided to
add non-GCODE commands to their MMU
command subset that otherwise possibly cause
issues in the field, especially if part of a
sliced file.

Implements #4423
This commit is contained in:
Gina Häußge committed 2022-02-16 16:08:18 +01:00
1 parent 82338209df
commit 0171f2bb7d
4 files changed
+27 -2

No files matched your search

+4
View File
@@ -216,6 +216,10 @@ def getSettings():
"waitForStart": s.getBoolean(["serial", "waitForStartOnConnect"]),
"alwaysSendChecksum": s.getBoolean(["serial", "alwaysSendChecksum"]),
"neverSendChecksum": s.getBoolean(["serial", "neverSendChecksum"]),
"sendChecksumWithUnknownCommands": s.getBoolean(
["serial", "sendChecksumWithUnknownCommands"]
),
"unknownCommandsNeedAck": s.getBoolean(["serial", "unknownCommandsNeedAck"]),
"sdRelativePath": s.getBoolean(["serial", "sdRelativePath"]),
"sdAlwaysAvailable": s.getBoolean(["serial", "sdAlwaysAvailable"]),
"sdLowerCase": s.getBoolean(["serial", "sdLowerCase"]),
@@ -219,6 +219,8 @@ $(function () {
self.serial_triggerOkForM29 = ko.observable(undefined);
self.serial_waitForStart = ko.observable(undefined);
self.serial_sendChecksum = ko.observable("print");
self.serial_sendChecksumWithUnknownCommands = ko.observable(undefined);
self.serial_unknownCommandsNeedAck = ko.observable(undefined);
self.serial_sdRelativePath = ko.observable(undefined);
self.serial_sdLowerCase = ko.observable(undefined);
self.serial_sdAlwaysAvailable = ko.observable(undefined);
@@ -343,7 +343,23 @@
</label>
</div>
</div>
</div>
<div class="control-group" title="{{ _('Send line numbers & checksums for non-GCODE commands')|edq }}">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: serial_sendChecksumWithUnknownCommands" id="settings-sendChecksumWithUnknownCommands"> {{ _('Send line numbers & checksums for non-GCODE commands') }} <span class="label">{{ _('Prusa Firmware') }}</span>
<span class="help-block">{{ _('Check this if your printer supports commands outside of the GCODE format (e.g. <code>Tx</code> or similar) but requires them to be treated identical to GCODE.') }}</span>
</label>
</div>
</div>
<div class="control-group" title="{{ _('Wait for \'ok\' for non-GCODE commands')|edq }}">
<div class="controls">
<label class="checkbox">
<input type="checkbox" data-bind="checked: serial_unknownCommandsNeedAck" id="settings-unknownCommandsNeedAck"> {{ _('Wait for acknowledging <code>ok</code> for non-GCODE commands') }} <span class="label">{{ _('Prusa Firmware') }}</span>
<span class="help-block">{{ _('Check this if your printer supports commands outside of the GCODE format (e.g. <code>Tx</code> or similar) but requires them to be treated identical to GCODE.') }}</span>
</label>
</div>
</div>
</div>
<div>
<div><small><a href="#" class="muted" data-bind="toggleContent: { class: 'fa-caret-right fa-caret-down', container: '#settings_serial_protocol_firmware .hide' }"><i class="fas fa-caret-right"></i> {{ _('Advanced options') }}</a></small></div>
<div class="hide">
@@ -457,7 +473,8 @@
<label class="control-label" for="settings-serialEmergencyCommands">{{ _('Emergency commands') }}</label>
<div class="controls">
<input type="text" class="input-block-level" id="settings-serialEmergencyCommands" data-bind="value: serial_emergencyCommands">
<span class="help-inline">{{ _('Use this to specify emergency commands which should jump any queues and - if supported by the firmware - be force sent. Just the G or M code, comma separated. Defaults to <code>M112</code>, <code>M108</code> and <code>M410</code>.') }}</span> </div>
<span class="help-inline">{{ _('Use this to specify emergency commands which should jump any queues and - if supported by the firmware - be force sent. Just the G or M code, comma separated. Defaults to <code>M112</code>, <code>M108</code> and <code>M410</code>.') }}</span>
</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="fas fa-caret-right"></i> {{ _('Advanced options') }}</a></small></div>
+2
View File
@@ -2819,6 +2819,8 @@ class MachineCom:
)
self._sdLowerCase = True
self._sendChecksumWithUnknownCommands = True
self._unknownCommandsNeedAck = True
self._firmware_info_received = True
self._firmware_info = data