Skip to content

Commit

Permalink
Additional fixes for post processing.
Browse files Browse the repository at this point in the history
comment diameter instead of radius for compensated profile/surface ops
opensbp improved pre processor is more explicit with XY values
cmake copies opensbp postprocessor.
Removed unnecessary file.
  • Loading branch information
sliptonic authored and yorikvanhavre committed Jul 4, 2016
1 parent d1b9277 commit bf46ea4
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 42 deletions.
1 change: 1 addition & 0 deletions src/Mod/Path/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SET(PathScripts_SRCS
PathScripts/PostUtils.py
PathScripts/example_pre.py
PathScripts/opensbp_pre.py
PathScripts/opensbp_post.py
PathScripts/example_post.py
PathScripts/linuxcnc_post.py
PathScripts/centroid_post.py
Expand Down
3 changes: 1 addition & 2 deletions src/Mod/Path/PathScripts/PathMachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ def updateData(self, vobj, prop): # optional
pass

def setEdit(self, vobj, mode=0): # optional
# this is executed when the object is double-clicked in the tree
pass
return True

def unsetEdit(self, vobj, mode=0): # optional
# this is executed when the user cancels or terminates edit mode
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/PathProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def execute(self, obj):

output += "(" + obj.Label + ")"
if obj.Side != "On":
output += "(Compensated Tool Path: " + str(self.radius) + ")"
output += "(Compensated Tool Path. Diameter: " + str(self.radius * 2) + ")"
else:
output += "(Uncompensated Tool Path)"

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/PathSurface.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def execute(self, obj):
obj.Label = obj.UserLabel + " :" + obj.ToolDescription

output += "(" + obj.Label + ")"
output += "(Compensated Tool Path: " + str(self.radius) + ")"
output += "(Compensated Tool Path. Diameter: " + str(self.radius * 2) + ")"

if obj.Base:
for b in obj.Base:
Expand Down
31 changes: 0 additions & 31 deletions src/Mod/Path/PathScripts/depth_params.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/Mod/Path/PathScripts/linuxcnc_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

# These globals will be reflected in the Machine configuration of the project
UNITS = "G21" # G21 for metric, G20 for us standard
MACHINE_NAME = "Millstone"
MACHINE_NAME = "LinuxCNC"
CORNER_MIN = {'x': 0, 'y': 0, 'z': 0}
CORNER_MAX = {'x': 500, 'y': 300, 'z': 300}

Expand Down
20 changes: 14 additions & 6 deletions src/Mod/Path/PathScripts/opensbp_pre.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,12 @@
Many other OpenSBP commands not handled
'''
import FreeCAD
import os, Path

AXIS = 'X','Y','Z','A','B' #OpenSBP always puts multiaxis move parameters in this order
SPEEDS = 'XY','Z','A','B'

import FreeCAD
import os, Path

# to distinguish python built-in open function from the one declared below
if open.__module__ == '__builtin__':
pythonopen = open
Expand Down Expand Up @@ -93,7 +92,7 @@ def parse(inputstring):
movecommand = ['G1', 'G0', 'G02', 'G03']

for l in lines:
print l
# print l
# remove any leftover trailing and preceding spaces
l = l.strip()
if not l:
Expand All @@ -115,7 +114,8 @@ def parse(inputstring):
s = "G0 "
else: #feed move
s = "G1 "
speed = lastfeedspeed["XY"]
speed = lastfeedspeed["XY"]

for i in range (1, len(words)):
if words [i] == '':
if last[AXIS[i-1]] == None:
Expand Down Expand Up @@ -144,7 +144,10 @@ def parse(inputstring):


last[words[0][1]] = words[1]
output += s + words[0][1] + str(words[1]) + " F" + speed + "\n"
output += s
for key, val in last.iteritems():
if val is not None:
output += key + str(val) + " F" + speed + "\n"

if words[0] in ["JS"]: #set jog speed
for i in range (1, len(words)):
Expand Down Expand Up @@ -187,9 +190,14 @@ def parse(inputstring):
s = "G2"
else: #CCW
s = "G3"


s += " X" + words[2] + " Y" + words[3] + " I" + words[4] + " J" + words[5] + " F" + str(lastfeedspeed["XY"])
output += s + '\n'

last["X"] = words[2]
last["Y"] = words[3]

#Make sure all appended paths have at least one move command.
if any (x in output for x in movecommand):
return_output.append(output)
Expand Down

0 comments on commit bf46ea4

Please sign in to comment.