Skip to content

Commit

Permalink
- add zProbeTravel Setting
Browse files Browse the repository at this point in the history
- add zProbeEndPos Setting
- increment version
  • Loading branch information
synman committed Dec 31, 2021
1 parent 55ee902 commit fd0b1ba
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
24 changes: 17 additions & 7 deletions octoprint_bettergrblsupport/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ def __init__(self):
self.neverSendChecksum = True
self.reOrderTabs = True
self.disablePrinterSafety = True
self.zProbeOffset = 15.00
self.weakLaserValue = 1
self.framingPercentOfMaxSpeed = 25

Expand Down Expand Up @@ -113,6 +112,10 @@ def __init__(self):
self.yLimit = float(0)
self.zLimit = float(0)

self.zProbeOffset = float(15.00)
self.zProbeTravel = float(0.00)
self.zProbeEndPos = float(5.00)

# load up our item/value pairs for errors, warnings, and settings
self.loadGrblDescriptions()

Expand Down Expand Up @@ -146,7 +149,9 @@ def get_settings_defaults(self):
disablePrinterSafety = True,
grblSettingsText = None,
grblSettingsBackup = "",
zProbeOffset = 15.00,
zProbeOffset = float(15.00),
zProbeTravel = float(0.00),
zProbeEndPos = float(5.00),
weakLaserValue = 1,
framingPercentOfMaxSpeed = 25,
overrideM8 = False,
Expand Down Expand Up @@ -211,7 +216,6 @@ def on_after_startup(self):
self.ignoreErrors = self._settings.get(["ignoreErrors"])
self.doSmoothie = self._settings.get(["doSmoothie"])

self.zProbeOffset = self._settings.get(["zProbeOffset"])
self.weakLaserValue = self._settings.get(["weakLaserValue"])
self.framingPercentOfMaxSpeed = self._settings.get(["framingPercentOfMaxSpeed"])

Expand All @@ -220,6 +224,10 @@ def on_after_startup(self):

self.distance = self._settings.get(["distance"])

self.zProbeOffset = self._settings.get(["zProbeOffset"])
self.zProbeTravel = self._settings.get(["zProbeTravel"])
self.zProbeEndPos = self._settings.get(["zProbeEndPos"])

# hardcoded global settings -- should revisit how I manage these
self._settings.global_set_boolean(["feature", "modelSizeDetection"], not self.disableModelSizeDetection)
self._settings.global_set_boolean(["serial", "neverSendChecksum"], self.neverSendChecksum)
Expand Down Expand Up @@ -576,8 +584,8 @@ def on_plugin_pending_uninstall(self): # this will work in some next release of

def cleanUpDueToUninstall(self, remove_profile=True):
# re-enable model size detection and send checksum
self._settings.global_set_boolean(["feature", "modelSizeDetection"], self.disableModelSizeDetection)
self._settings.global_set_boolean(["serial", "neverSendChecksum"], not self.neverSendChecksum)
self._settings.global_set_boolean(["feature", "modelSizeDetection"], True)
self._settings.global_set_boolean(["serial", "neverSendChecksum"], False)

# load maps of disabled plugins & tabs
disabledPlugins = self._settings.global_get(["plugins", "_disabled"])
Expand Down Expand Up @@ -640,13 +648,15 @@ def cleanUpDueToUninstall(self, remove_profile=True):

self._settings.save()


def get_extension_tree(self, *args, **kwargs):
return dict(
model=dict(
grbl_gcode=["gc", "nc"]
)
)


# #-- gcode sending hook
def hook_gcode_sending(self, comm_instance, phase, cmd, cmd_type, gcode, *args, **kwargs):
# let's only do stuff if our profile is selected
Expand Down Expand Up @@ -1298,10 +1308,10 @@ def on_api_command(self, command, data):

if direction == "probez":
# probe z using offset
self.queue_cmds_and_send(["G91 G21 G38.2 Z-{} F100 ?".format(self.zLimit),
self.queue_cmds_and_send(["G91 G21 G38.2 Z-{} F100 ?".format(self.zLimit if self.zProbeTravel == 0 else self.zProbeTravel),
"?",
"G92 Z{}".format(self.zProbeOffset),
"G0 Z5"])
"G0 Z{}".format(self.zProbeEndPos)])
return

# check distance against limits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,41 @@

<label class="control-label">Framing Feed Rate</label>
<div class="controls">
<input type="text" class="input-mini" data-bind="value: settings.settings.plugins.bettergrblsupport.framingPercentOfMaxSpeed">% of max
<input type="text" class="input-mini" data-bind="numeric, value: settings.settings.plugins.bettergrblsupport.framingPercentOfMaxSpeed">% of max
</div>

<br>

<label class="control-label">Weak Laser Intensity</label>
<div class="controls">
<input type="text" class="input-mini" data-bind="value: settings.settings.plugins.bettergrblsupport.weakLaserValue">
<input type="text" class="input-mini" data-bind="numeric, value: settings.settings.plugins.bettergrblsupport.weakLaserValue">
</div>

<br>
<br>

<label class="control-label" style="transform: translate(0px, -10px);">Z-Probe Touchplate Height</label>
<div class="controls">
<input type="text" class="input-mini" data-bind="value: settings.settings.plugins.bettergrblsupport.zProbeOffset">mm
<input type="text" class="input-mini" data-bind="numeric, value: settings.settings.plugins.bettergrblsupport.zProbeOffset">mm
</div>

<br>

<label class="control-label">Z-Probe Travel Distance</label>
<div class="controls">
<input type="text" class="input-mini" data-bind="numeric, value: settings.settings.plugins.bettergrblsupport.zProbeTravel">mm (0 - use machine Z limit)
</div>

<br>

<label class="control-label">Z-Probe End Position</label>
<div class="controls">
<input type="text" class="input-mini" data-bind="numeric, value: settings.settings.plugins.bettergrblsupport.zProbeEndPos">mm
</div>

<br>
<br>

<label class="control-label">Air Assist Overrides</label>
<br>
<div class="controls">
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
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.0.0rc12"
plugin_version = "2.0.0rc13"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit fd0b1ba

Please sign in to comment.