diff --git a/docs/configuration/config_yaml.rst b/docs/configuration/config_yaml.rst index c5df5727f..d3d76de2b 100644 --- a/docs/configuration/config_yaml.rst +++ b/docs/configuration/config_yaml.rst @@ -533,52 +533,16 @@ Use the following settings to enable or disable OctoPrint features: .. code-block:: yaml feature: + # Whether to enable the gcode viewer in the UI or not gCodeVisualizer: true # Whether to enable the temperature graph in the UI or not temperatureGraph: true - # Specifies whether OctoPrint should wait for the start response from the printer before trying to send commands - # during connect. - waitForStartOnConnect: false - - # Specifies whether OctoPrint should send linenumber + checksum with every printer command. Needed for - # successful communication with Repetier firmware - alwaysSendChecksum: false - - # Specifies whether OctoPrint should also send linenumber + checksum with commands that are *not* - # detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)"). - sendChecksumWithUnknownCommands: false - - # Specifies whether OctoPrint should also use up acknowledgments ("ok") for commands that are *not* - # detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)"). - unknownCommandsNeedAck: false - - # Whether to ignore the first ok after a resend response. Needed for successful communication with - # Repetier firmware - swallowOkAfterResend: false - # Specifies whether support for SD printing and file management should be enabled sdSupport: true - # Specifies whether firmware expects relative paths for selecting SD files - sdRelativePath: false - - # Whether to always assume that an SD card is present in the printer. - # Needed by some firmwares which don't report the SD card status properly. - sdAlwaysAvailable: false - - # Whether the printer sends repetier style target temperatures in the format - # TargetExtr0: - # instead of attaching that information to the regular M105 responses - repetierTargetTemp: false - - # Whether to enable external heatup detection (to detect heatup triggered e.g. through the printer's LCD panel or - # while printing from SD) or not. Causes issues with Repetier's "first ok then response" approach to - # communication, so disable for printers running Repetier firmware. - externalHeatupDetection: true - # Whether to enable the keyboard control feature in the control tab keyboardControl: true @@ -586,28 +550,16 @@ Use the following settings to enable or disable OctoPrint features: # notifications instead (false) pollWatched: false - # Whether to ignore identical resends from the printer (true, repetier) or not (false) - ignoreIdenticalResends: false - - # If ignoredIdenticalResends is true, how many consecutive identical resends to ignore - identicalResendsCount: 7 - - # Whether to support F on its own as a valid GCODE command (true) or not (false) - supportFAsCommand: false - # Whether to enable model size detection and warning (true) or not (false) modelSizeDetection: true - # Whether to attempt to auto detect the firmware of the printer and adjust settings - # accordingly (true) or not and rely on manual configuration (false) - firmwareDetection: true - # Whether to show a confirmation on print cancelling (true) or not (false) printCancelConfirmation: true - # Whether to block all sending to the printer while a G4 (dwell) command is active (true, repetier) - # or not (false) - blockWhileDwelling: false + # Commands that should never be auto-uppercased when sent to the printer through the Terminal tab. + # Defaults to only M117. + autoUppercaseBlacklist: + - M117 .. _sec-configuration-config_yaml-folder: @@ -835,7 +787,7 @@ Use the following settings to configure the serial connection to the printer: # Maximum number of write attempts to serial during which nothing can be written before the communication # with the printer is considered dead and OctoPrint will disconnect with an error - maxWritePasses: + maxWritePasses: 5 # Use this to define additional patterns to consider for serial port listing. Must be a valid # "glob" pattern (see http://docs.python.org/2/library/glob.html). Defaults to not set. @@ -869,10 +821,6 @@ Use the following settings to configure the serial connection to the printer: helloCommand: - M110 N0 - # Commands that should never be auto-uppercased when sent to the printer. Defaults to only M117. - autoUppercaseBlacklist: - - M117 - # Whether to disconnect on errors or not disconnectOnErrors: true @@ -883,6 +831,60 @@ Use the following settings to configure the serial connection to the printer: # impact, leave on if possible please logResends: true + # Specifies whether OctoPrint should wait for the start response from the printer before trying to send commands + # during connect. + waitForStartOnConnect: false + + # Specifies whether OctoPrint should send linenumber + checksum with every printer command. Needed for + # successful communication with Repetier firmware + alwaysSendChecksum: false + + # Specifies whether OctoPrint should also send linenumber + checksum with commands that are *not* + # detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)"). + sendChecksumWithUnknownCommands: false + + # Specifies whether OctoPrint should also use up acknowledgments ("ok") for commands that are *not* + # detected as valid GCODE (as in, they do not match the regular expression "^\s*([GM]\d+|T)"). + unknownCommandsNeedAck: false + + # Whether to ignore the first ok after a resend response. Needed for successful communication with + # Repetier firmware + swallowOkAfterResend: false + + # Specifies whether firmware expects relative paths for selecting SD files + sdRelativePath: false + + # Whether to always assume that an SD card is present in the printer. + # Needed by some firmwares which don't report the SD card status properly. + sdAlwaysAvailable: false + + # Whether the printer sends repetier style target temperatures in the format + # TargetExtr0: + # instead of attaching that information to the regular M105 responses + repetierTargetTemp: false + + # Whether to enable external heatup detection (to detect heatup triggered e.g. through the printer's LCD panel or + # while printing from SD) or not. Causes issues with Repetier's "first ok then response" approach to + # communication, so disable for printers running Repetier firmware. + externalHeatupDetection: true + + # Whether to ignore identical resends from the printer (true, repetier) or not (false) + ignoreIdenticalResends: false + + # If ignoredIdenticalResends is true, how many consecutive identical resends to ignore + identicalResendsCount: 7 + + # Whether to support F on its own as a valid GCODE command (true) or not (false) + supportFAsCommand: false + + # Whether to attempt to auto detect the firmware of the printer and adjust settings + # accordingly (true) or not and rely on manual configuration (false) + firmwareDetection: true + + # Whether to block all sending to the printer while a G4 (dwell) command is active (true, repetier) + # or not (false) + blockWhileDwelling: false + # Whether to support resends without follow-up ok or not supportResendsWithoutOk: false diff --git a/src/octoprint/server/api/settings.py b/src/octoprint/server/api/settings.py index 3f035f22e..0ea189907 100644 --- a/src/octoprint/server/api/settings.py +++ b/src/octoprint/server/api/settings.py @@ -114,23 +114,13 @@ def getSettings(): "sizeThreshold": s.getInt(["gcodeViewer", "sizeThreshold"]), "mobileSizeThreshold": s.getInt(["gcodeViewer", "mobileSizeThreshold"]), "temperatureGraph": s.getBoolean(["feature", "temperatureGraph"]), - "waitForStart": s.getBoolean(["feature", "waitForStartOnConnect"]), - "alwaysSendChecksum": s.getBoolean(["feature", "alwaysSendChecksum"]), - "neverSendChecksum": s.getBoolean(["feature", "neverSendChecksum"]), "sdSupport": s.getBoolean(["feature", "sdSupport"]), - "sdRelativePath": s.getBoolean(["feature", "sdRelativePath"]), - "sdAlwaysAvailable": s.getBoolean(["feature", "sdAlwaysAvailable"]), - "swallowOkAfterResend": s.getBoolean(["feature", "swallowOkAfterResend"]), - "repetierTargetTemp": s.getBoolean(["feature", "repetierTargetTemp"]), - "externalHeatupDetection": s.getBoolean(["feature", "externalHeatupDetection"]), "keyboardControl": s.getBoolean(["feature", "keyboardControl"]), "pollWatched": s.getBoolean(["feature", "pollWatched"]), - "ignoreIdenticalResends": s.getBoolean(["feature", "ignoreIdenticalResends"]), "modelSizeDetection": s.getBoolean(["feature", "modelSizeDetection"]), - "firmwareDetection": s.getBoolean(["feature", "firmwareDetection"]), "printCancelConfirmation": s.getBoolean(["feature", "printCancelConfirmation"]), - "blockWhileDwelling": s.getBoolean(["feature", "blockWhileDwelling"]), "g90InfluencesExtruder": s.getBoolean(["feature", "g90InfluencesExtruder"]), + "autoUppercaseBlacklist": s.get(["feature", "autoUppercaseBlacklist"]), "legacyPluginAssets": s.getBoolean(["feature", "legacyPluginAssets"]) }, "serial": { @@ -156,10 +146,20 @@ def getSettings(): "ignoreErrorsFromFirmware": s.getBoolean(["serial", "ignoreErrorsFromFirmware"]), "disconnectOnErrors": s.getBoolean(["serial", "disconnectOnErrors"]), "triggerOkForM29": s.getBoolean(["serial", "triggerOkForM29"]), - "autoUppercaseBlacklist": s.get(["serial", "autoUppercaseBlacklist"]), "logPositionOnPause": s.getBoolean(["serial", "logPositionOnPause"]), "logPositionOnCancel": s.getBoolean(["serial", "logPositionOnCancel"]), "supportResendsWithoutOk": s.getBoolean(["serial", "supportResendsWithoutOk"]), + "waitForStart": s.getBoolean(["serial", "waitForStartOnConnect"]), + "alwaysSendChecksum": s.getBoolean(["serial", "alwaysSendChecksum"]), + "neverSendChecksum": s.getBoolean(["serial", "neverSendChecksum"]), + "sdRelativePath": s.getBoolean(["serial", "sdRelativePath"]), + "sdAlwaysAvailable": s.getBoolean(["serial", "sdAlwaysAvailable"]), + "swallowOkAfterResend": s.getBoolean(["serial", "swallowOkAfterResend"]), + "repetierTargetTemp": s.getBoolean(["serial", "repetierTargetTemp"]), + "externalHeatupDetection": s.getBoolean(["serial", "externalHeatupDetection"]), + "ignoreIdenticalResends": s.getBoolean(["serial", "ignoreIdenticalResends"]), + "firmwareDetection": s.getBoolean(["serial", "firmwareDetection"]), + "blockWhileDwelling": s.getBoolean(["serial", "blockWhileDwelling"]), "maxTimeoutsIdle": s.getInt(["serial", "maxCommunicationTimeouts", "idle"]), "maxTimeoutsPrinting": s.getInt(["serial", "maxCommunicationTimeouts", "printing"]), "maxTimeoutsLong": s.getInt(["serial", "maxCommunicationTimeouts", "long"]), @@ -345,24 +345,14 @@ def _saveSettings(data): if "sizeThreshold" in data["feature"]: s.setInt(["gcodeViewer", "sizeThreshold"], data["feature"]["sizeThreshold"]) if "mobileSizeThreshold" in data["feature"]: s.setInt(["gcodeViewer", "mobileSizeThreshold"], data["feature"]["mobileSizeThreshold"]) if "temperatureGraph" in data["feature"]: s.setBoolean(["feature", "temperatureGraph"], data["feature"]["temperatureGraph"]) - if "waitForStart" in data["feature"]: s.setBoolean(["feature", "waitForStartOnConnect"], data["feature"]["waitForStart"]) - if "alwaysSendChecksum" in data["feature"]: s.setBoolean(["feature", "alwaysSendChecksum"], data["feature"]["alwaysSendChecksum"]) - if "neverSendChecksum" in data["feature"]: s.setBoolean(["feature", "neverSendChecksum"], data["feature"]["neverSendChecksum"]) if "sdSupport" in data["feature"]: s.setBoolean(["feature", "sdSupport"], data["feature"]["sdSupport"]) - if "sdRelativePath" in data["feature"]: s.setBoolean(["feature", "sdRelativePath"], data["feature"]["sdRelativePath"]) - if "sdAlwaysAvailable" in data["feature"]: s.setBoolean(["feature", "sdAlwaysAvailable"], data["feature"]["sdAlwaysAvailable"]) - if "swallowOkAfterResend" in data["feature"]: s.setBoolean(["feature", "swallowOkAfterResend"], data["feature"]["swallowOkAfterResend"]) - if "repetierTargetTemp" in data["feature"]: s.setBoolean(["feature", "repetierTargetTemp"], data["feature"]["repetierTargetTemp"]) - if "externalHeatupDetection" in data["feature"]: s.setBoolean(["feature", "externalHeatupDetection"], data["feature"]["externalHeatupDetection"]) if "keyboardControl" in data["feature"]: s.setBoolean(["feature", "keyboardControl"], data["feature"]["keyboardControl"]) if "pollWatched" in data["feature"]: s.setBoolean(["feature", "pollWatched"], data["feature"]["pollWatched"]) - if "ignoreIdenticalResends" in data["feature"]: s.setBoolean(["feature", "ignoreIdenticalResends"], data["feature"]["ignoreIdenticalResends"]) if "modelSizeDetection" in data["feature"]: s.setBoolean(["feature", "modelSizeDetection"], data["feature"]["modelSizeDetection"]) - if "firmwareDetection" in data["feature"]: s.setBoolean(["feature", "firmwareDetection"], data["feature"]["firmwareDetection"]) if "printCancelConfirmation" in data["feature"]: s.setBoolean(["feature", "printCancelConfirmation"], data["feature"]["printCancelConfirmation"]) - if "blockWhileDwelling" in data["feature"]: s.setBoolean(["feature", "blockWhileDwelling"], data["feature"]["blockWhileDwelling"]) if "g90InfluencesExtruder" in data["feature"]: s.setBoolean(["feature", "g90InfluencesExtruder"], data["feature"]["g90InfluencesExtruder"]) if "legacyPluginAssets" in data["feature"]: s.setBoolean(["feature", "legacyPluginAssets"], data["feature"]["legacyPluginAssets"]) + if "autoUppercaseBlacklist" in data["feature"] and isinstance(data["feature"]["autoUppercaseBlacklist"], (list, tuple)): s.set(["feature", "autoUppercaseBlacklist"], data["feature"]["autoUppercaseBlacklist"]) if "serial" in data.keys(): if "autoconnect" in data["serial"]: s.setBoolean(["serial", "autoconnect"], data["serial"]["autoconnect"]) @@ -384,8 +374,18 @@ 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 "autoUppercaseBlacklist" in data["serial"] and isinstance(data["serial"]["autoUppercaseBlacklist"], (list, tuple)): s.set(["serial", "autoUppercaseBlacklist"], data["serial"]["autoUppercaseBlacklist"]) if "supportResendsWithoutOk" in data["serial"]: s.setBoolean(["serial", "supportResendsWithoutOk"], data["serial"]["supportResendsWithoutOk"]) + if "waitForStart" in data["serial"]: s.setBoolean(["serial", "waitForStartOnConnect"], data["serial"]["waitForStart"]) + if "alwaysSendChecksum" in data["serial"]: s.setBoolean(["serial", "alwaysSendChecksum"], data["serial"]["alwaysSendChecksum"]) + if "neverSendChecksum" in data["serial"]: s.setBoolean(["serial", "neverSendChecksum"], data["serial"]["neverSendChecksum"]) + if "sdRelativePath" in data["serial"]: s.setBoolean(["serial", "sdRelativePath"], data["serial"]["sdRelativePath"]) + if "sdAlwaysAvailable" in data["serial"]: s.setBoolean(["serial", "sdAlwaysAvailable"], data["serial"]["sdAlwaysAvailable"]) + if "swallowOkAfterResend" in data["serial"]: s.setBoolean(["serial", "swallowOkAfterResend"], data["serial"]["swallowOkAfterResend"]) + if "repetierTargetTemp" in data["serial"]: s.setBoolean(["serial", "repetierTargetTemp"], data["serial"]["repetierTargetTemp"]) + if "externalHeatupDetection" in data["serial"]: s.setBoolean(["serial", "externalHeatupDetection"], data["serial"]["externalHeatupDetection"]) + if "ignoreIdenticalResends" in data["serial"]: s.setBoolean(["serial", "ignoreIdenticalResends"], data["serial"]["ignoreIdenticalResends"]) + if "firmwareDetection" in data["serial"]: s.setBoolean(["serial", "firmwareDetection"], data["serial"]["firmwareDetection"]) + if "blockWhileDwelling" in data["serial"]: s.setBoolean(["serial", "blockWhileDwelling"], data["serial"]["blockWhileDwelling"]) if "logPositionOnPause" in data["serial"]: s.setBoolean(["serial", "logPositionOnPause"], data["serial"]["logPositionOnPause"]) if "logPositionOnCancel" in data["serial"]: s.setBoolean(["serial", "logPositionOnCancel"], data["serial"]["logPositionOnCancel"]) if "maxTimeoutsIdle" in data["serial"]: s.setInt(["serial", "maxCommunicationTimeouts", "idle"], data["serial"]["maxTimeoutsIdle"]) diff --git a/src/octoprint/settings.py b/src/octoprint/settings.py index 4b9301705..64eb8e829 100644 --- a/src/octoprint/settings.py +++ b/src/octoprint/settings.py @@ -114,10 +114,25 @@ default_settings = { "disconnectOnErrors": True, "ignoreErrorsFromFirmware": False, "logResends": True, - "autoUppercaseBlacklist": ["M117"], "supportResendsWithoutOk": False, "logPositionOnPause": True, "logPositionOnCancel": True, + "waitForStartOnConnect": False, + "alwaysSendChecksum": False, + "neverSendChecksum": False, + "sendChecksumWithUnknownCommands": False, + "unknownCommandsNeedAck": False, + "sdRelativePath": False, + "sdAlwaysAvailable": False, + "swallowOkAfterResend": True, + "repetierTargetTemp": False, + "externalHeatupDetection": True, + "supportWait": True, + "ignoreIdenticalResends": False, + "identicalResendsCountdown": 7, + "supportFAsCommand": False, + "firmwareDetection": True, + "blockWhileDwelling": False, "capabilities": { "autoreport_temp": True, @@ -210,27 +225,12 @@ default_settings = { }, "feature": { "temperatureGraph": True, - "waitForStartOnConnect": False, - "alwaysSendChecksum": False, - "neverSendChecksum": False, - "sendChecksumWithUnknownCommands": False, - "unknownCommandsNeedAck": False, "sdSupport": True, - "sdRelativePath": False, - "sdAlwaysAvailable": False, - "swallowOkAfterResend": True, - "repetierTargetTemp": False, - "externalHeatupDetection": True, - "supportWait": True, "keyboardControl": True, "pollWatched": False, - "ignoreIdenticalResends": False, - "identicalResendsCountdown": 7, - "supportFAsCommand": False, "modelSizeDetection": True, - "firmwareDetection": True, "printCancelConfirmation": True, - "blockWhileDwelling": False, + "autoUppercaseBlacklist": ["M117"], "g90InfluencesExtruder": False, "legacyPluginAssets": False # TODO remove again in 1.3.8 }, @@ -908,7 +908,8 @@ class Settings(object): self._migrate_reverse_proxy_config, self._migrate_printer_parameters, self._migrate_gcode_scripts, - self._migrate_core_system_commands + self._migrate_core_system_commands, + self._migrate_serial_features ) for migrate in migrators: @@ -1172,6 +1173,49 @@ class Settings(object): return changed + def _migrate_serial_features(self, config): + """ + Migrates feature flags identified as serial specific from the feature to the serial config tree and vice versa. + + If a flag already exists in the target tree, only deletes the copy in the source tree. + """ + changed = False + + FEATURE_TO_SERIAL = ("waitForStartOnConnect", "alwaysSendChecksum", "neverSendChecksum", + "sendChecksumWithUnknownCommands", "unknownCommandsNeedAck", "sdRelativePath", + "sdAlwaysAvailable", "swallowOkAfterResend", "repetierTargetTemp", + "externalHeatupDetection", "supportWait", "ignoreIdenticalResends", + "identicalResendsCountdown", "supportFAsCommand", "firmwareDetection", + "blockWhileDwelling") + SERIAL_TO_FEATURE = ("autoUppercaseBlacklist",) + + def migrate_key(key, source, target): + if source in config and key in config[source]: + if config.get(target) is None: + # make sure we have a serial tree + config[target] = dict() + if key not in config[target]: + # only copy over if it's not there yet + config[target][key] = config[source][key] + # delete feature flag + del config[source][key] + return True + return False + + for key in FEATURE_TO_SERIAL: + changed = migrate_key(key, "feature", "serial") or changed + + for key in SERIAL_TO_FEATURE: + changed = migrate_key(key, "serial", "feature") or changed + + if changed: + # let's make a backup of our current config, in case someone wants to roll back to an + # earlier version and needs a backup of their flags + backup_path = self.backup("serial_feature_migration") + self._logger.info("Made a copy of the current config at {} to allow recovery of serial feature flags".format(backup_path)) + + return changed + def backup(self, suffix, path=None): import shutil diff --git a/src/octoprint/static/js/app/viewmodels/settings.js b/src/octoprint/static/js/app/viewmodels/settings.js index 6997b94d1..08e315943 100644 --- a/src/octoprint/static/js/app/viewmodels/settings.js +++ b/src/octoprint/static/js/app/viewmodels/settings.js @@ -134,22 +134,13 @@ $(function() { self.feature_sizeThreshold_str = sizeObservable(self.feature_sizeThreshold); self.feature_mobileSizeThreshold_str = sizeObservable(self.feature_mobileSizeThreshold); self.feature_temperatureGraph = ko.observable(undefined); - self.feature_waitForStart = ko.observable(undefined); - self.feature_sendChecksum = ko.observable("print"); self.feature_sdSupport = ko.observable(undefined); - self.feature_sdRelativePath = ko.observable(undefined); - self.feature_sdAlwaysAvailable = ko.observable(undefined); - self.feature_swallowOkAfterResend = ko.observable(undefined); - self.feature_repetierTargetTemp = ko.observable(undefined); - self.feature_disableExternalHeatupDetection = ko.observable(undefined); self.feature_keyboardControl = ko.observable(undefined); self.feature_pollWatched = ko.observable(undefined); - self.feature_ignoreIdenticalResends = ko.observable(undefined); self.feature_modelSizeDetection = ko.observable(undefined); - self.feature_firmwareDetection = ko.observable(undefined); self.feature_printCancelConfirmation = ko.observable(undefined); - self.feature_blockWhileDwelling = ko.observable(undefined); self.feature_g90InfluencesExtruder = ko.observable(undefined); + self.feature_autoUppercaseBlacklist = ko.observable(undefined); self.feature_legacyPluginAssets = ko.observable(undefined); self.serial_port = ko.observable(); @@ -174,7 +165,16 @@ $(function() { self.serial_ignoreErrorsFromFirmware = ko.observable(undefined); self.serial_disconnectOnErrors = ko.observable(undefined); self.serial_triggerOkForM29 = ko.observable(undefined); - self.serial_autoUppercaseBlacklist = ko.observable(undefined); + self.serial_waitForStart = ko.observable(undefined); + self.serial_sendChecksum = ko.observable("print"); + self.serial_sdRelativePath = ko.observable(undefined); + self.serial_sdAlwaysAvailable = ko.observable(undefined); + self.serial_swallowOkAfterResend = ko.observable(undefined); + self.serial_repetierTargetTemp = ko.observable(undefined); + self.serial_disableExternalHeatupDetection = ko.observable(undefined); + self.serial_ignoreIdenticalResends = ko.observable(undefined); + self.serial_firmwareDetection = ko.observable(undefined); + self.serial_blockWhileDwelling = ko.observable(undefined); self.serial_supportResendsWithoutOk = ko.observable(undefined); self.serial_logPositionOnPause = ko.observable(undefined); self.serial_logPositionOnCancel = ko.observable(undefined); @@ -248,6 +248,25 @@ $(function() { self.server_onlineCheckBroken(false); }; + self.observableCopies = { + "feature_waitForStart": "serial_waitForStart", + "feature_sendChecksum": "serial_sendChecksum", + "feature_sdRelativePath": "serial_sdRelativePath", + "feature_sdAlwaysAvailable": "serial_sdAlwaysAvailable", + "feature_swallowOkAfterResend": "serial_swallowOkAfterResend", + "feature_repetierTargetTemp": "serial_repetierTargetTemp", + "feature_disableExternalHeatupDetection": "serial_disableExternalHeatupDetection", + "feature_ignoreIdenticalResends": "serial_ignoreIdenticalResends", + "feature_firmwareDetection": "serial_firmwareDetection", + "feature_blockWhileDwelling": "serial_blockWhileDwelling", + "serial_": "feature_" + }; + _.each(self.observableCopies, function(value, key) { + if (self.hasOwnProperty(value)) { + self[key] = self[value]; + } + }); + self.addTemperatureProfile = function() { self.temperature_profiles.push({name: "New", extruder:0, bed:0}); }; @@ -667,16 +686,16 @@ $(function() { // some special read functions for various observables var specialMappings = { feature: { - externalHeatupDetection: function() { return !self.feature_disableExternalHeatupDetection()}, - alwaysSendChecksum: function() { return self.feature_sendChecksum() == "always"}, - neverSendChecksum: function() { return self.feature_sendChecksum() == "never"} + autoUppercaseBlacklist: function() { return splitTextToArray(self.feature_autoUppercaseBlacklist(), ",", true) } }, serial: { additionalPorts : function() { return commentableLinesToArray(self.serial_additionalPorts()) }, additionalBaudrates: function() { return _.map(splitTextToArray(self.serial_additionalBaudrates(), ",", true, function(item) { return !isNaN(parseInt(item)); }), function(item) { return parseInt(item); }) }, longRunningCommands: function() { return splitTextToArray(self.serial_longRunningCommands(), ",", true) }, checksumRequiringCommands: function() { return splitTextToArray(self.serial_checksumRequiringCommands(), ",", true) }, - autoUppercaseBlacklist: function() { return splitTextToArray(self.serial_autoUppercaseBlacklist(), ",", true) } + externalHeatupDetection: function() { return !self.serial_disableExternalHeatupDetection()}, + alwaysSendChecksum: function() { return self.serial_sendChecksum() == "always"}, + neverSendChecksum: function() { return self.serial_sendChecksum() == "never"} }, scripts: { gcode: function() { @@ -714,6 +733,11 @@ $(function() { observable = keyPrefix + "_" + observable; } + if (self.observableCopies.hasOwnProperty(observable)) { + // only a copy, skip + return; + } + if (mapping && mapping[key] && _.isFunction(mapping[key])) { result[key] = mapping[key](); flag = true; @@ -779,16 +803,16 @@ $(function() { } }, feature: { - externalHeatupDetection: function(value) { self.feature_disableExternalHeatupDetection(!value) }, - alwaysSendChecksum: function(value) { if (value) { self.feature_sendChecksum("always")}}, - neverSendChecksum: function(value) { if (value) { self.feature_sendChecksum("never")}} + autoUppercaseBlacklist: function(value) { self.feature_autoUppercaseBlacklist(value.join(", "))} }, serial: { additionalPorts : function(value) { self.serial_additionalPorts(value.join("\n"))}, additionalBaudrates: function(value) { self.serial_additionalBaudrates(value.join(", "))}, longRunningCommands: function(value) { self.serial_longRunningCommands(value.join(", "))}, checksumRequiringCommands: function(value) { self.serial_checksumRequiringCommands(value.join(", "))}, - autoUppercaseBlacklist: function(value) { self.serial_autoUppercaseBlacklist(value.join(", "))} + externalHeatupDetection: function(value) { self.serial_disableExternalHeatupDetection(!value) }, + alwaysSendChecksum: function(value) { if (value) { self.serial_sendChecksum("always")}}, + neverSendChecksum: function(value) { if (value) { self.serial_sendChecksum("never")}} }, terminalFilters: function(value) { self.terminalFilters($.extend(true, [], value)) }, temperature: { @@ -808,6 +832,11 @@ $(function() { observable = keyPrefix + "_" + observable; } + if (self.observableCopies.hasOwnProperty(observable)) { + // only a copy, skip + return; + } + var haveLocalVersion = local && local.hasOwnProperty(key); if (mapping && mapping[key] && _.isFunction(mapping[key]) && !haveLocalVersion) { @@ -920,6 +949,11 @@ $(function() { self._resetScrollPosition = function() { $('#settings_dialog_content', self.settingsDialog).scrollTop(0); + + // also reset any contained tabs/pills/lists to first pane + $('#settings_dialog_content ul.nav-pills a[data-toggle="tab"]:first', self.settingsDialog).tab("show"); + $('#settings_dialog_content ul.nav-list a[data-toggle="tab"]:first', self.settingsDialog).tab("show"); + $('#settings_dialog_content ul.nav-tabs a[data-toggle="tab"]:first', self.settingsDialog).tab("show"); }; self.selectTab = function(tab) { @@ -929,7 +963,7 @@ $(function() { } $('ul.nav-list a[href="' + tab + '"]', self.settingsDialog).tab("show"); } else { - $('ul.nav-list a:first', self.settingsDialog).tab("show"); + $('ul.nav-list a[data-toggle="tab"]:first', self.settingsDialog).tab("show"); } }; diff --git a/src/octoprint/static/js/app/viewmodels/terminal.js b/src/octoprint/static/js/app/viewmodels/terminal.js index 6ee6586ce..6d4dd3ea3 100644 --- a/src/octoprint/static/js/app/viewmodels/terminal.js +++ b/src/octoprint/static/js/app/viewmodels/terminal.js @@ -125,7 +125,7 @@ $(function() { }); self.blacklist=[]; - self.settings.serial_autoUppercaseBlacklist.subscribe(function(newValue) { + self.settings.feature_autoUppercaseBlacklist.subscribe(function(newValue) { self.blacklist = splitTextToArray(newValue, ",", true); }); diff --git a/src/octoprint/templates/dialogs/settings/features.jinja2 b/src/octoprint/templates/dialogs/settings/features.jinja2 index f0a2019f5..1bd88c0b2 100644 --- a/src/octoprint/templates/dialogs/settings/features.jinja2 +++ b/src/octoprint/templates/dialogs/settings/features.jinja2 @@ -48,87 +48,19 @@ -
-
- -
-
-
+
+
- -
-
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
-
- -
-
-
- -
- - - -
+ + {{ _('Use this to specify the commands that should not have their parameters automatically uppercased in the terminal tab. Just the G or M code, comma separated.') }}
diff --git a/src/octoprint/templates/dialogs/settings/serialconnection.jinja2 b/src/octoprint/templates/dialogs/settings/serialconnection.jinja2 index 626244265..5b40eaab8 100644 --- a/src/octoprint/templates/dialogs/settings/serialconnection.jinja2 +++ b/src/octoprint/templates/dialogs/settings/serialconnection.jinja2 @@ -1,219 +1,341 @@
-
- -
- -
-
-
- -
- -
-
-
-
- -
-
-
- -
-
- - s -
- {{ _('When printing or idle')}} -
-
-
- - s -
- {{ _('When a target temperature is set')}} -
-
-
- -
-
- - s -
- {{ _('Autoreport interval to request from firmware')}} -
-
-
- -
-
- - s -
-
-
-
- -
-
- - s -
- {{ _('busy protocol support not detected')}} -
-
-
- - s -
- {{ _('busy protocol support detected')}} -
-
-
- -
-
- - s -
-
-
-
- -
-
- - s -
-
-
-
-
- -
-
-
- -
- - {{ _('Use this to define additional glob patterns matching serial ports to list for connecting against, e.g. /dev/ttyAMA*. One entry per line.')|format(glob_url="http://docs.python.org/2/library/glob.html") }} -
-
-
- -
- - {{ _('Use this to define additional serial port baud rates to list for connecting with, e.g. 123456. Comma separated.')|format(glob_url="http://docs.python.org/2/library/glob.html") }} -
-
-
-
- -
-
-
-
- -
-
+ -
- -
-
+
+
+
+ {{ _('Connection') }} +
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+
+ +
+ + {{ _('Use this to define additional glob patterns matching serial ports to list for connecting against, e.g. /dev/ttyAMA*. One entry per line.')|format(glob_url="http://docs.python.org/2/library/glob.html") }} +
+
+
+ +
+ + {{ _('Use this to define additional serial port baud rates to list for connecting with, e.g. 123456. Comma separated.')|format(glob_url="http://docs.python.org/2/library/glob.html") }} +
+
+
+
+ {{ _('Serial logging') }} +
+
+ +
+
+
+
+
+
+ {{ _('Query intervals') }} +
+ +
+
+ + s +
+ {{ _('When printing or idle')}} +
+
+
+ + s +
+ {{ _('When a target temperature is set')}} +
+
+
+ +
+
+ + s +
+ {{ _('Autoreport interval to request from firmware')}} +
+
+
+ +
+
+ + s +
+
+
+
+
+ {{ _('Timeouts') }} +
+ +
+
+ + s +
+ {{ _('busy protocol support not detected')}} +
+
+
+ + s +
+ {{ _('busy protocol support detected')}} +
+
+
+ +
+
+ + s +
+
+
+
+ +
+
+ + s +
+
+
+
+ +
+
+ +
+ + {{ _('Set to 0 to disable consecutive timeout detection and handling.') }} +
+
+
+ +
+ + {{ _('Set to 0 to disable consecutive timeout detection and handling.') }} +
+
+
+ +
+ + {{ _('Set to 0 to disable consecutive timeout detection and handling.') }} +
+
+
+
+
+
+
+
+ {{ _('Firmware specific settings') }} +
+
+ +
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+ +
+ + + +
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+ {{ _('Protocol fine tuning') }} +
+
+ +
+
+
+ +
+
+ +
+ + {{ _('Use this to specify a different command than the default M110 to send to the printer on initial connection to trigger a communication handshake.') }} +
+
+
+ +
+ + {{ _('Use this to specify the commands known to take a long time to complete without output from your printer and hence might cause timeout issues. Just the G or M code, comma separated.') }} +
+
+
+ +
+ + {{ _('Use this to specify which commands always need to be sent with a checksum. Comma separated list.') }} +
+
+
+
+
+
+
+
+ {{ _('Error handling') }} +
+
+ +
+
+
+
+ +
+
+
+
+ {{ _('Event based position logging') }}
-
-
-
-
- -
- - {{ _('Use this to specify a different command than the default M110 to send to the printer on initial connection to trigger a communication handshake.') }} -
-
-
- -
- - {{ _('Use this to specify the commands known to take a long time to complete without output from your printer and hence might cause timeout issues. Just the G or M code, comma separated.') }} -
-
-
- -
- - {{ _('Use this to specify which commands always need to be sent with a checksum. Comma separated list.') }} -
-
-
- -
- - {{ _('Use this to specify the commands that should not have their parameters automatically uppercased in the terminal tab. Just the G or M code, comma separated.') }} -
-
-
- -
-
- -
-
- -
-
- -
-
- -
- - {{ _('Set to 0 to disable consecutive timeout detection and handling.') }} -
-
-
- -
- - {{ _('Set to 0 to disable consecutive timeout detection and handling.') }} -
-
-
- -
- - {{ _('Set to 0 to disable consecutive timeout detection and handling.') }} -
-
+
-