Skip to content

Commit

Permalink
v2.2.1rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
synman committed Jan 31, 2022
1 parent ea23c31 commit f561bfc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 16 deletions.
33 changes: 20 additions & 13 deletions octoprint_bettergrblsupport/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ def __init__(self):
self.invertZ = 1

self.settingsVersion = 5
self.wizardVersion = 7
self.wizardVersion = 8

self.connectionState = None
self.pausedPower = 0

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

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

# Print Cancelling
if event == Events.PRINT_CANCELLING:
self._logger.debug("canceling job")
self._printer.commands(["!", "M999", "?", "?", "?"], force=True)
self._logger.debug("cancelling job")

if "HOLD" in self.grblState.upper():
self._printer.commands(["~", "M999", "$G"], force=True)
else:
self._printer.commands(["M400", "M999", "$G"], force=True)

# Print Paused
if event == Events.PRINT_PAUSED:
self._logger.debug("pausing job")
self._printer.commands(["!", "?", "?", "?"], force=True)
self.pausedPower = self.grblPowerLevel
self._printer.commands(["S0", "!", "?"], force=True)

# Print Resumed
if event == Events.PRINT_RESUMED:
self._logger.debug("resuming job")
self._printer.commands(["~", "?", "?", "?"], force=True)

_bgs.queue_cmds_and_send(self, ["?"])
self._printer.commands(["~", "S{}".format(self.pausedPower), "$G"], force=True)

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

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

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

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

_bgs.add_to_notify_queue(self, [line])
self._printer.commands("?", force=True)
if len(line.strip()) > 0:
_bgs.add_to_notify_queue(self, [line])
self._printer.commands("?", force=True)

return

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
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
<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.
<br>
<h4>Release Notes - 2.2.0</h4>
<h4>Release Notes - 2.2.1 & 2.2.0</h4>
<ul>
<li>User selectable coordinate systems (G54 thru G59) (2.2.1)</li>
<li>Store calculated job dimensions in file manager metadata (2.2.1)</li>
<li>Bug fixes for pause / resume / cancel / restart job (2.2.1)</li>
<li>X/Y Probing and the settings necessary to run it in Plugin Properties</li>
<li>X/Y Probing corresponds to Material Framing Start Position (corners only)</li>
<li>Chained XYZ Probing when axis selector is "ALL"</li>
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
plugin_name = "Better Grbl Support"

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

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

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

0 comments on commit f561bfc

Please sign in to comment.