From 2f1d519a6fb4955c782a084b926ecba03480ad4e Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Thu, 17 Aug 2017 16:17:45 -0700 Subject: [PATCH] Changed speed setting to take opensbp multiple speed rates into account - and only issues a new setting if there are any changes. From the documentation it seems we ought to use VS instead of JS and MS if we don't want the ramp-down-ramp-up procedure involved with FS and MS. Given that Path only changes these settings on a tool change it's probably OK for now. --- src/Mod/Path/PathScripts/post/opensbp_post.py | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/Mod/Path/PathScripts/post/opensbp_post.py b/src/Mod/Path/PathScripts/post/opensbp_post.py index 7a11d131da..38636cb0e0 100644 --- a/src/Mod/Path/PathScripts/post/opensbp_post.py +++ b/src/Mod/Path/PathScripts/post/opensbp_post.py @@ -194,17 +194,25 @@ def move(command): if 'F' in command.Parameters: speed = command.Parameters['F'] - if speed != CurrentState['F']: - if command.Name in ['G1', 'G01']: # move - movetype = "MS" - else: # jog - movetype = "JS" - zspeed = "" - xyspeed = "" - if 'Z' in axis: - zspeed = "{:f}".format(GetValue(speed)) - if ('X' in axis) or ('Y' in axis): - xyspeed = "{:f}".format(GetValue(speed)) + if command.Name in ['G1', 'G01']: # move + movetype = "MS" + else: # jog + movetype = "JS" + zspeed = "" + xyspeed = "" + if 'Z' in axis: + speedKey = "{}Z".format(movetype) + speedVal = GetValue(speed) + if CurrentState[speedKey] != speedVal: + CurrentState[speedKey] = speedVal + zspeed = "{:f}".format(speedVal) + if ('X' in axis) or ('Y' in axis): + speedKey = "{}XY".format(movetype) + speedVal = GetValue(speed) + if CurrentState[speedKey] != speedVal: + CurrentState[speedKey] = speedVal + xyspeed = "{:f}".format(speedVal) + if zspeed or xyspeed: txt += "{},{},{}\n".format(movetype, xyspeed, zspeed) if command.Name in ['G0', 'G00']: