- fixed the TclCommand cncjob to use the -outname parameter
- added some more keywords in the data_model for auto-completer
This commit is contained in:
@@ -41,7 +41,7 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
('spindlespeed', int),
|
||||
('dwell', bool),
|
||||
('dwelltime', float),
|
||||
('ppname_g', str),
|
||||
('pp', str),
|
||||
('outname', str)
|
||||
])
|
||||
|
||||
@@ -71,7 +71,7 @@ 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.'),
|
||||
('ppname_g', 'Name of the Geometry postprocessor. No quotes, case sensitive')
|
||||
('pp', 'Name of the Geometry postprocessor. No quotes, case sensitive')
|
||||
]),
|
||||
'examples': ['cncjob geo_name -tooldia 0.5 -z_cut -1.7 -z_move 2 -feedrate 120 -ppname_g default']
|
||||
}
|
||||
@@ -92,6 +92,7 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
args['outname'] = str(name) + "_cnc"
|
||||
|
||||
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))
|
||||
|
||||
@@ -119,7 +120,7 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
args["dwell"] = args["dwell"] if "dwell" in args else obj.options["dwell"]
|
||||
args["dwelltime"] = args["dwelltime"] if "dwelltime" in args else obj.options["dwelltime"]
|
||||
|
||||
args["ppname_g"] = args["ppname_g"] if "ppname_g" in args else obj.options["ppname_g"]
|
||||
args["pp"] = args["pp"] if "pp" in args else obj.options["ppname_g"]
|
||||
|
||||
args["toolchange"] = True if "toolchange" in args and args["toolchange"] == 1 else False
|
||||
args["toolchangez"] = args["toolchangez"] if "toolchangez" in args else obj.options["toolchangez"]
|
||||
@@ -128,9 +129,19 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
|
||||
del args['name']
|
||||
|
||||
for arg in args:
|
||||
if arg == "toolchange_xy" or arg == "spindlespeed":
|
||||
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.')
|
||||
|
||||
# HACK !!! Should be solved elsewhere!!!
|
||||
# default option for multidepth is False
|
||||
obj.options['multidepth'] = False
|
||||
|
||||
if not obj.multigeo:
|
||||
obj.generatecncjob(use_thread=False, **args)
|
||||
else:
|
||||
@@ -155,7 +166,10 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
local_tools_dict[tool_uid]['data']['spindlespeed'] = args["spindlespeed"]
|
||||
local_tools_dict[tool_uid]['data']['dwell'] = args["dwell"]
|
||||
local_tools_dict[tool_uid]['data']['dwelltime'] = args["dwelltime"]
|
||||
local_tools_dict[tool_uid]['data']['ppname_g'] = args["ppname_g"]
|
||||
print(local_tools_dict[tool_uid]['data'])
|
||||
obj.mtool_gen_cncjob(tools_dict=local_tools_dict, tools_in_use=[], use_thread=False)
|
||||
local_tools_dict[tool_uid]['data']['ppname_g'] = args["pp"]
|
||||
obj.mtool_gen_cncjob(
|
||||
outname=args['outname'],
|
||||
tools_dict=local_tools_dict,
|
||||
tools_in_use=[],
|
||||
use_thread=False)
|
||||
# self.raise_tcl_error('The object is a multi-geo geometry which is not supported in cncjob Tcl Command')
|
||||
|
||||
Reference in New Issue
Block a user