Allow disabling busy & autoreport support
This commit is contained in:
1 parent
8732ec9756
commit
be3907c7d1
5 files changed
+43
-5
No files matched your search
@@ -162,7 +162,9 @@ def getSettings():
|
||||
"supportResendsWithoutOk": s.getBoolean(["serial", "supportResendsWithoutOk"]),
|
||||
"maxTimeoutsIdle": s.getInt(["serial", "maxCommunicationTimeouts", "idle"]),
|
||||
"maxTimeoutsPrinting": s.getInt(["serial", "maxCommunicationTimeouts", "printing"]),
|
||||
"maxTimeoutsLong": s.getInt(["serial", "maxCommunicationTimeouts", "long"])
|
||||
"maxTimeoutsLong": s.getInt(["serial", "maxCommunicationTimeouts", "long"]),
|
||||
"capAutoreportTemp": s.getBoolean(["serial", "capabilities", "autoreport_temp"]),
|
||||
"capBusyProtocol": s.getBoolean(["serial", "capabilities", "busy_protocol"])
|
||||
},
|
||||
"folder": {
|
||||
"uploads": s.getBaseFolder("uploads"),
|
||||
@@ -389,6 +391,8 @@ def _saveSettings(data):
|
||||
if "maxTimeoutsIdle" in data["serial"]: s.setInt(["serial", "maxCommunicationTimeouts", "idle"], data["serial"]["maxTimeoutsIdle"])
|
||||
if "maxTimeoutsPrinting" in data["serial"]: s.setInt(["serial", "maxCommunicationTimeouts", "printing"], data["serial"]["maxTimeoutsPrinting"])
|
||||
if "maxTimeoutsLong" in data["serial"]: s.setInt(["serial", "maxCommunicationTimeouts", "long"], data["serial"]["maxTimeoutsLong"])
|
||||
if "capAutoreportTemp" in data["serial"]: s.setBoolean(["serial", "capabilities", "autoreport_temp"], data["serial"]["capAutoreportTemp"])
|
||||
if "capBusyProtocol" in data["serial"]: s.setBoolean(["serial", "capabilities", "busy_protocol"], data["serial"]["capBusyProtocol"])
|
||||
|
||||
oldLog = s.getBoolean(["serial", "log"])
|
||||
if "log" in data["serial"]: s.setBoolean(["serial", "log"], data["serial"]["log"])
|
||||
|
||||
@@ -119,6 +119,11 @@ default_settings = {
|
||||
"logPositionOnPause": True,
|
||||
"logPositionOnCancel": True,
|
||||
|
||||
"capabilities": {
|
||||
"autoreport_temp": True,
|
||||
"busy_protocol": True
|
||||
},
|
||||
|
||||
# command specific flags
|
||||
"triggerOkForM29": True
|
||||
},
|
||||
|
||||
@@ -181,6 +181,8 @@ $(function() {
|
||||
self.serial_maxTimeoutsIdle = ko.observable(undefined);
|
||||
self.serial_maxTimeoutsPrinting = ko.observable(undefined);
|
||||
self.serial_maxTimeoutsLong = ko.observable(undefined);
|
||||
self.serial_capAutoreportTemp = ko.observable(undefined);
|
||||
self.serial_capBusyProtocol = ko.observable(undefined);
|
||||
|
||||
self.folder_uploads = ko.observable(undefined);
|
||||
self.folder_timelapse = ko.observable(undefined);
|
||||
|
||||
@@ -128,6 +128,20 @@
|
||||
<div>
|
||||
<div><small><a href="#" class="muted" data-bind="toggleContent: { class: 'fa-caret-right fa-caret-down', container: '#settings_serialConnection .hide' }"><i class="fa fa-caret-right"></i> {{ _('Advanced options') }}</a></small></div>
|
||||
<div class="hide">
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: serial_capAutoreportTemp" id="settings-serialCapAutoreportTemp"> {{ _('Support temperature autoreporting by firmware, if detected') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" data-bind="checked: serial_capBusyProtocol" id="settings-serialCapBusyProtocol"> {{ _('Support <code>busy</code> protocol, if detected') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" title="{{ _('Command to send to the firmware on first handshake attempt.') }}">
|
||||
<label class="control-label" for="settings-serialHelloCommand">{{ _('"Hello" command') }}</label>
|
||||
<div class="controls">
|
||||
|
||||
@@ -333,6 +333,11 @@ class MachineCom(object):
|
||||
STATE_TRANSFERING_FILE = 11
|
||||
|
||||
CAPABILITY_AUTOREPORT_TEMP = "AUTOREPORT_TEMP"
|
||||
CAPABILITY_BUSY_PROTOCOL = "BUSY_PROTOCOL"
|
||||
|
||||
CAPABILITY_SUPPORT_ENABLED = "enabled"
|
||||
CAPABILITY_SUPPORT_DETECTED = "detected"
|
||||
CAPABILITY_SUPPORT_DISABLED = "disabled"
|
||||
|
||||
def __init__(self, port = None, baudrate=None, callbackObject=None, printerProfileManager=None):
|
||||
self._logger = logging.getLogger(__name__)
|
||||
@@ -408,6 +413,12 @@ class MachineCom(object):
|
||||
self._currentLine = 1
|
||||
self._line_mutex = threading.RLock()
|
||||
self._resendDelta = None
|
||||
|
||||
self._capability_support = {
|
||||
self.CAPABILITY_AUTOREPORT_TEMP: settings().getBoolean(["serial", "capabilities", "autoreport_temp"]),
|
||||
self.CAPABILITY_BUSY_PROTOCOL: settings().getBoolean(["serial", "capabilities", "busy_protocol"])
|
||||
}
|
||||
|
||||
self._lastLines = deque([], 50)
|
||||
self._lastCommError = None
|
||||
self._lastResendNumber = None
|
||||
@@ -1264,7 +1275,8 @@ class MachineCom(object):
|
||||
self._ok_timeout = get_new_timeout("communicationBusy" if self._busy_protocol_detected else "communication", self._timeout_intervals)
|
||||
|
||||
# make sure the printer sends busy in a small enough interval to match our timeout
|
||||
if not self._busy_protocol_detected:
|
||||
if not self._busy_protocol_detected and self._capability_support.get(self.CAPABILITY_BUSY_PROTOCOL,
|
||||
False):
|
||||
self._log("Printer seems to support the busy protocol, adjusting timeouts and setting busy "
|
||||
"interval accordingly")
|
||||
self._busy_protocol_detected = True
|
||||
@@ -1528,9 +1540,10 @@ class MachineCom(object):
|
||||
capability, enabled = parsed
|
||||
self._firmware_capabilities[capability] = enabled
|
||||
|
||||
if capability == self.CAPABILITY_AUTOREPORT_TEMP and enabled:
|
||||
self._logger.info("Firmware states that it supports temperature autoreporting")
|
||||
self._set_autoreport_temperature_interval()
|
||||
if self._capability_support.get(capability, False):
|
||||
if capability == self.CAPABILITY_AUTOREPORT_TEMP and enabled:
|
||||
self._logger.info("Firmware states that it supports temperature autoreporting")
|
||||
self._set_autoreport_temperature_interval()
|
||||
|
||||
##~~ SD Card handling
|
||||
elif 'SD init fail' in line or 'volume.init failed' in line or 'openRoot failed' in line:
|
||||
|
||||
Reference in new issue
Block a user