diff --git a/octoprint_latheengraver/__init__.py b/octoprint_latheengraver/__init__.py index 6508c70..71b77ba 100644 --- a/octoprint_latheengraver/__init__.py +++ b/octoprint_latheengraver/__init__.py @@ -750,8 +750,8 @@ def hook_gcode_queuing(self, comm_instance, phase, cmd, cmd_type, gcode, tags, * assembly = {"X": None, "Z": None, "A": None, "B": None, "F": None, "S": None} track_plunge = False orig_cmd = cmd - #this is needed because B axis moves may not be emitted - #self.queue_B = self.grblB + #this is needed because B axis moves may not be emitted. + self.queue_B = self.grblB newcmd = '' match_cmd = self.match_cmd.match(cmd) gcommands = [] @@ -882,7 +882,7 @@ def assemble_command(self, newcmd, assembly): cmd = newcmd for key, value in assembly.items(): if value: - cmd = cmd+" {0}{1:.4f}".format(str(key), value) + cmd = cmd+"{0}{1:.4f}".format(str(key), value) return cmd def get_new_A(self, zval, aval): diff --git a/octoprint_latheengraver/_bgs.py b/octoprint_latheengraver/_bgs.py index b416558..4851240 100644 --- a/octoprint_latheengraver/_bgs.py +++ b/octoprint_latheengraver/_bgs.py @@ -287,6 +287,17 @@ def on_event(_plugin, event, payload): add_notifications(_plugin, ["Pgm Begin"]) # threading.Thread(target=send_command_now, args=(_plugin._printer, _plugin._logger, "?")).start() _plugin._printer.commands("?", force=True) + # reset our rate/position overrides + _plugin.feedRate = 0 + _plugin.plungeRate = 0 + _plugin.powerRate = 0 + _plugin.queue_X = _plugin.grblX + _plugin.queue_Z = _plugin.grblZ + _plugin.queue_A = _plugin.grblA + _plugin.queue_B = _plugin.grblB + _plugin.queue_S = 0.0 + _plugin.queue_F = 0.0 + _plugin.bypass_queuing = False return # 'PrintStarted' @@ -299,17 +310,7 @@ def on_event(_plugin, event, payload): _plugin._printer.cancel_print() return - # reset our rate/position overrides - _plugin.feedRate = 0 - _plugin.plungeRate = 0 - _plugin.powerRate = 0 - _plugin.queue_X = _plugin.grblX - _plugin.queue_Z = _plugin.grblZ - _plugin.queue_A = _plugin.grblA - _plugin.queue_B = _plugin.grblB - _plugin.queue_S = 0.0 - _plugin.queue_F = 0.0 - _plugin.bypass_queuing = False + _plugin.grblState = "Run" _plugin._plugin_manager.send_plugin_message(_plugin._identifier, dict(type="grbl_state", state="Run")) @@ -352,7 +353,7 @@ def on_event(_plugin, event, payload): _plugin.queue_X = 0.0 _plugin.queue_Z = 0.0 _plugin.queue_A = 0.0 - _plugin.queue_B = 0.0 + _plugin.queue_B = _plugin.grblB _plugin.bypass_queuing = False return diff --git a/setup.py b/setup.py index c32161e..e15017b 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_name = "LatheEngraver Support" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "1.0.12" +plugin_version = "1.0.13" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module