Skip to content

Commit f561bfc

Browse files
committed
v2.2.1rc1
1 parent ea23c31 commit f561bfc

File tree

3 files changed

+26
-16
lines changed

3 files changed

+26
-16
lines changed

octoprint_bettergrblsupport/__init__.py

+20-13
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,10 @@ def __init__(self):
130130
self.invertZ = 1
131131

132132
self.settingsVersion = 5
133-
self.wizardVersion = 7
133+
self.wizardVersion = 8
134134

135135
self.connectionState = None
136+
self.pausedPower = 0
136137

137138
# load up our item/value pairs for errors, warnings, and settings
138139
_bgs.load_grbl_descriptions(self)
@@ -515,7 +516,9 @@ def on_event(self, event, payload):
515516

516517
# 'PrintStarted'
517518
if event == Events.PRINT_STARTED:
518-
if not self.grblState in ("Idle", "Check"):
519+
if "HOLD" in self.grblState.upper():
520+
self._printer.commands(["~", "M999", "$G"], force=True)
521+
elif not self.grblState.upper() in ("IDLE", "CHECK"):
519522
# we have to stop This
520523
self._printer.cancel_print()
521524
return
@@ -540,20 +543,23 @@ def on_event(self, event, payload):
540543

541544
# Print Cancelling
542545
if event == Events.PRINT_CANCELLING:
543-
self._logger.debug("canceling job")
544-
self._printer.commands(["!", "M999", "?", "?", "?"], force=True)
546+
self._logger.debug("cancelling job")
547+
548+
if "HOLD" in self.grblState.upper():
549+
self._printer.commands(["~", "M999", "$G"], force=True)
550+
else:
551+
self._printer.commands(["M400", "M999", "$G"], force=True)
545552

546553
# Print Paused
547554
if event == Events.PRINT_PAUSED:
548555
self._logger.debug("pausing job")
549-
self._printer.commands(["!", "?", "?", "?"], force=True)
556+
self.pausedPower = self.grblPowerLevel
557+
self._printer.commands(["S0", "!", "?"], force=True)
550558

551559
# Print Resumed
552560
if event == Events.PRINT_RESUMED:
553561
self._logger.debug("resuming job")
554-
self._printer.commands(["~", "?", "?", "?"], force=True)
555-
556-
_bgs.queue_cmds_and_send(self, ["?"])
562+
self._printer.commands(["~", "S{}".format(self.pausedPower), "$G"], force=True)
557563

558564
self.grblState = "Run"
559565
self._plugin_manager.send_plugin_message(self._identifier, dict(type="grbl_state", state="Run"))
@@ -676,7 +682,7 @@ def hook_gcode_sending(self, comm_instance, phase, cmd, cmd_type, gcode, *args,
676682
# cancel jog -- doesn't appear to work
677683
if cmd.upper().strip() == "SYN1":
678684
self._logger.debug("Cancelling Jog")
679-
return ("\x85",)
685+
return ("? " + chr(133) + " ?",)
680686

681687
# rewrite M115 firmware as $$ (hello)
682688
if self.suppressM115 and cmd.upper().startswith('M115'):
@@ -895,8 +901,8 @@ def hook_gcode_received(self, comm_instance, line, *args, **kwargs):
895901
speed=self.grblSpeed,
896902
power=self.grblPowerLevel))
897903

898-
# odd edge case where a machine could be asleep while connecting
899-
if not self._printer.is_operational() and "SLEEP" in self.grblState.upper():
904+
# odd edge case where a machine could be asleep or holding while connecting
905+
if not self._printer.is_operational() and ("SLEEP" in self.grblState.upper() or "HOLD" in self.grblState.upper()):
900906
self._printer.commands("M999", force=True)
901907

902908
# pop any queued commands if state is IDLE or HOLD:0 or Check
@@ -1064,8 +1070,9 @@ def hook_gcode_received(self, comm_instance, line, *args, **kwargs):
10641070
line = line.replace("[","").replace("]","").replace("MSG:","")
10651071
line = line.replace("\n", "").replace("\r", "")
10661072

1067-
_bgs.add_to_notify_queue(self, [line])
1068-
self._printer.commands("?", force=True)
1073+
if len(line.strip()) > 0:
1074+
_bgs.add_to_notify_queue(self, [line])
1075+
self._printer.commands("?", force=True)
10691076

10701077
return
10711078

octoprint_bettergrblsupport/templates/bettergrblsupport_wizard.jinja2

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
If this is your first time using Better Grbl Support or it has been a while since you've used it, be sure to visit the
1313
<a href="https://github.com/synman/Octoprint-Bettergrblsupport/wiki" target="_blank">Better Grbl Support Wiki</a> to learn about its features and how they work.
1414
<br>
15-
<h4>Release Notes - 2.2.0</h4>
15+
<h4>Release Notes - 2.2.1 & 2.2.0</h4>
1616
<ul>
17+
<li>User selectable coordinate systems (G54 thru G59) (2.2.1)</li>
18+
<li>Store calculated job dimensions in file manager metadata (2.2.1)</li>
19+
<li>Bug fixes for pause / resume / cancel / restart job (2.2.1)</li>
1720
<li>X/Y Probing and the settings necessary to run it in Plugin Properties</li>
1821
<li>X/Y Probing corresponds to Material Framing Start Position (corners only)</li>
1922
<li>Chained XYZ Probing when axis selector is "ALL"</li>

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
plugin_name = "Better Grbl Support"
1515

1616
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
17-
plugin_version = "2.2.1dev0"
17+
plugin_version = "2.2.1rc1"
1818

1919
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
2020
# module
21-
plugin_description = """Support and Features for GRBL 1.1f+"""
21+
plugin_description = """Extends Octoprint to support GRBL based laser engravers and CNC machines"""
2222

2323
# The plugin's author. Can be overwritten within OctoPrint's internal data via __plugin_author__ in the plugin module
2424
plugin_author = "Shell M. Shrader"

0 commit comments

Comments
 (0)