opensbp preprocessor handles float for spindle speed

This commit is contained in:
sliptonic 2016-07-01 15:16:02 -05:00 committed by Yorik van Havre
parent fd57f47e3d
commit ee5bb83a38

View File

@ -21,7 +21,6 @@
# * *
# ***************************************************************************/
'''
This is a preprocessor file for the Path workbench. Its aim is to
parse the contents of a given OpenSBP file, and transform it to make it
@ -84,7 +83,6 @@ def insert(filename,docname):
def parse(inputstring):
"parse(inputstring): returns a list of parsed output string"
print "preprocessing..."
# split the input by line
lines = inputstring.split("\n")
return_output = []
@ -95,6 +93,7 @@ def parse(inputstring):
movecommand = ['G1', 'G0', 'G02', 'G03']
for l in lines:
print l
# remove any leftover trailing and preceding spaces
l = l.strip()
if not l:
@ -171,11 +170,11 @@ def parse(inputstring):
continue
if words[0] in ["TR"]: #Setting spindle speed
if int(words[1]) < 0:
if float(words[1]) < 0:
s = "M4 S"
else:
s = "M3 S"
s += str(abs(int(words[1])))
s += str(abs(float(words[1])))
output += s + '\n'
if words[0] in ["CG"]: #Gcode circle/arc