diff --git a/octoprint_CalibrationTools/EStepsApi.py b/octoprint_CalibrationTools/EStepsApi.py index 7b5f4be..a8e0fa4 100644 --- a/octoprint_CalibrationTools/EStepsApi.py +++ b/octoprint_CalibrationTools/EStepsApi.py @@ -52,13 +52,14 @@ class API(octoprint.plugin.SimpleApiPlugin): # Register event to be trigger when temp is achieved self.registerEventTemp("T0", int(data["extrudeTemp"]), self.startExtrusion, data["extrudeLength"], data["extrudeSpeed"]) - # Heating the tool + # Heating HotEnd self._printer.commands("M104 S%(extrudeTemp)s" % data) if command == CMD_ESTEPS_SAVE: eStepsSettings = self._settings.get(['eSteps']) userControlsTemp = eStepsSettings.get("userControlsTemp") turnOffHotend = eStepsSettings.get("turnOffHotend") + #save data to EEPROM and cool-down self._printer.commands(["M92 E%(newESteps)s" % data, "M500"] + ["M104 S0"] if turnOffHotend and not userControlsTemp else []) return diff --git a/octoprint_CalibrationTools/hooks.py b/octoprint_CalibrationTools/hooks.py index 1272b99..dc47385 100644 --- a/octoprint_CalibrationTools/hooks.py +++ b/octoprint_CalibrationTools/hooks.py @@ -27,9 +27,9 @@ class Hooks(): threading.Thread(target=waiter["func"], args=args).start() waiter["dead"] = True break - if waiter["callCount"] >= 3: - self._logger.warning("Hanging thread: Removing waiter regex: %(regex)s" % waiter) - waiter["dead"] = True + # if waiter["callCount"] >= 3: + # self._logger.warning("Hanging thread: Removing waiter regex: %(regex)s" % waiter) + # waiter["dead"] = True self.gCodeWaiters = [w for w in self.gCodeWaiters if "dead" not in w or not w["dead"]] except Exception as e: self._logger.error(traceback.format_exc()) @@ -53,7 +53,7 @@ class Hooks(): self._logger.error(traceback.format_exc()) return parsed_temperatures - # Check if the current message contains changes concerning registered tool + # Check if the current message contains changes concerning registered extruder # if the criteria is meat then the execution function is called def checkAndTriggerEvent(self, temps): for tool, values in temps.items(): diff --git a/octoprint_CalibrationTools/static/js/CalibrationTools.js b/octoprint_CalibrationTools/static/js/CalibrationTools.js index 2f7e4cc..9fc19bc 100644 --- a/octoprint_CalibrationTools/static/js/CalibrationTools.js +++ b/octoprint_CalibrationTools/static/js/CalibrationTools.js @@ -48,13 +48,18 @@ $(function () { self.steps["E"](response.data.E); } + self.loadEStepsActive = ko.observable(true) self.loadESteps = function () { + self.loadEStepsActive(false); OctoPrint.simpleApiCommand("CalibrationTools", "eSteps_load").done(function (response) { self.from_json(response); + }).always(function (response) { + self.loadEStepsActive(true); }) } - + self.startExtrusionActive = ko.observable(true) self.startExtrusion = function () { + self.startExtrusionActive(true); OctoPrint.simpleApiCommand("CalibrationTools", "eSteps_startExtrusion", { "extrudeTemp": self.testParam.extrudeTemp(), "extrudeLength": self.testParam.extrudeLength(), @@ -73,7 +78,9 @@ $(function () { type: "error", hide: false }); - }) + }).always(function (response) { + self.startExtrusionActive(true); + }); } self.saveESteps = function () { diff --git a/octoprint_CalibrationTools/templates/tabs/tab-esteps.jinja2 b/octoprint_CalibrationTools/templates/tabs/tab-esteps.jinja2 index 34d58b0..485358b 100644 --- a/octoprint_CalibrationTools/templates/tabs/tab-esteps.jinja2 +++ b/octoprint_CalibrationTools/templates/tabs/tab-esteps.jinja2 @@ -42,7 +42,8 @@
-