Path: post processor cleanup
This commit is contained in:
@@ -28,7 +28,6 @@ import argparse
|
||||
import datetime
|
||||
import shlex
|
||||
from PathScripts import PostUtils
|
||||
from PathScripts import PathUtils
|
||||
|
||||
TOOLTIP = '''
|
||||
This is a postprocessor file for the Path workbench. It is used to
|
||||
@@ -54,7 +53,6 @@ parser.add_argument('--postamble', help='set commands to be issued after the las
|
||||
parser.add_argument('--inches', action='store_true', help='Convert output for US imperial mode (G20)')
|
||||
parser.add_argument('--modal', action='store_true', help='Output the Same G-command Name USE NonModal Mode')
|
||||
parser.add_argument('--axis-modal', action='store_true', help='Output the Same Axis Value Mode')
|
||||
#parser.add_argument('--power-max', help='set the max value for laser power default=255')
|
||||
parser.add_argument('--power-on-delay', default='255', help='milliseconds - Add a delay after laser on before moving to pre-heat material. Default=0')
|
||||
|
||||
|
||||
@@ -104,7 +102,6 @@ POST_OPERATION = ''''''
|
||||
# Tool Change commands will be inserted before a tool change
|
||||
TOOL_CHANGE = ''''''
|
||||
|
||||
#POWER_MAX = 255
|
||||
POWER_ON_DELAY = 0
|
||||
|
||||
# to distinguish python built-in open function from the one declared below
|
||||
@@ -152,9 +149,9 @@ def processArguments(argstring):
|
||||
MODAL = True
|
||||
if args.axis_modal:
|
||||
OUTPUT_DOUBLES = False
|
||||
POWER_ON_DELAY = float(args.power_on_delay) / 1000 #milliseconds
|
||||
POWER_ON_DELAY = float(args.power_on_delay) / 1000 # milliseconds
|
||||
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
return True
|
||||
@@ -290,7 +287,7 @@ def parse(pathobj):
|
||||
if command == lastcommand:
|
||||
outstring.pop(0)
|
||||
|
||||
if c.Name[0] == '(' and not OUTPUT_COMMENTS: # command is a comment
|
||||
if c.Name[0] == '(' and not OUTPUT_COMMENTS: # command is a comment
|
||||
continue
|
||||
|
||||
# Now add the remaining parameters in order
|
||||
@@ -326,10 +323,6 @@ def parse(pathobj):
|
||||
# Check for Tool Change:
|
||||
if command == 'M6':
|
||||
continue
|
||||
# if OUTPUT_COMMENTS:
|
||||
# out += linenumber() + "(begin toolchange)\n"
|
||||
for line in TOOL_CHANGE.splitlines(True):
|
||||
out += linenumber() + line
|
||||
|
||||
if command == "message":
|
||||
if OUTPUT_COMMENTS is False:
|
||||
@@ -349,4 +342,5 @@ def parse(pathobj):
|
||||
|
||||
return out
|
||||
|
||||
|
||||
print(__name__ + " gcode postprocessor loaded.")
|
||||
|
||||
Reference in New Issue
Block a user