- added a new parameter named 'muted' for the TclCommands: cncjob, drillcncjob and write_gcode. Setting it as -muted 1 will disable the error reporting in TCL Shell

This commit is contained in:
Marius Stanciu
2019-09-16 04:23:16 +03:00
committed by Marius
parent 4b28d980fd
commit e9751e41b8
4 changed files with 53 additions and 15 deletions

View File

@@ -42,6 +42,7 @@ class TclCommandCncjob(TclCommandSignaled):
('dwell', bool),
('dwelltime', float),
('pp', str),
('muted', int),
('outname', str)
])
@@ -71,7 +72,8 @@ class TclCommandCncjob(TclCommandSignaled):
('dwell', 'True or False; use (or not) the dwell'),
('dwelltime', 'Time to pause to allow the spindle to reach the full speed'),
('outname', 'Name of the resulting Geometry object.'),
('pp', 'Name of the Geometry postprocessor. No quotes, case sensitive')
('pp', 'Name of the Geometry postprocessor. No quotes, case sensitive'),
('muted', 'It will not put errors in the Shell.')
]),
'examples': ['cncjob geo_name -tooldia 0.5 -z_cut -1.7 -z_move 2 -feedrate 120 -ppname_g default']
}
@@ -91,13 +93,22 @@ class TclCommandCncjob(TclCommandSignaled):
if 'outname' not in args:
args['outname'] = str(name) + "_cnc"
if 'muted' in args:
muted = args['muted']
obj = self.app.collection.get_by_name(str(name), isCaseSensitive=False)
if obj is None:
self.raise_tcl_error("Object not found: %s" % str(name))
if not muted:
self.raise_tcl_error("Object not found: %s" % str(name))
else:
return
if not isinstance(obj, FlatCAMGeometry):
self.raise_tcl_error('Expected FlatCAMGeometry, got %s %s.' % (str(name), type(obj)))
if not muted:
self.raise_tcl_error('Expected FlatCAMGeometry, got %s %s.' % (str(name), type(obj)))
else:
return
args["tooldia"] = args["tooldia"] if "tooldia" in args else obj.options["cnctooldia"]
@@ -134,9 +145,12 @@ class TclCommandCncjob(TclCommandSignaled):
continue
else:
if args[arg] is None:
self.raise_tcl_error('One of the command parameters that have to be not None, is None.\n'
'The parameter that is None is in the default values found in the list \n'
'generated by the TclCommand "list_sys geom". or in the arguments.')
if not muted:
self.raise_tcl_error('One of the command parameters that have to be not None, is None.\n'
'The parameter that is None is in the default values found in the list \n'
'generated by the TclCommand "list_sys geom". or in the arguments.')
else:
return
# HACK !!! Should be solved elsewhere!!!
# default option for multidepth is False