- fixed the Tcl command Cncjob: there was a problem reported as issue #416. The command did not work due of the dpp parameter
- modified the Tcl command Cncjob such that if some of the parameters are not used then the default values will be used (set with set_sys) - modified the Tcl command Drillcncjob to use the defaults when some of the parameters are not used
This commit is contained in:
@@ -124,16 +124,18 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
else:
|
||||
return
|
||||
|
||||
args["dia"] = args["dia"] if "dia" in args and args["dia"] else obj.options["cnctooldia"]
|
||||
args["dia"] = args["dia"] if "dia" in args and args["dia"] else self.app.defaults["geometry_cnctooldia"]
|
||||
|
||||
args["z_cut"] = args["z_cut"] if "z_cut" in args and args["z_cut"] else obj.options["cutz"]
|
||||
args["z_move"] = args["z_move"] if "z_move" in args and args["z_move"] else obj.options["travelz"]
|
||||
args["z_cut"] = args["z_cut"] if "z_cut" in args and args["z_cut"] else self.app.defaults["geometry_cutz"]
|
||||
args["z_move"] = args["z_move"] if "z_move" in args and args["z_move"] else \
|
||||
self.app.defaults["geometry_travelz"]
|
||||
|
||||
args["feedrate"] = args["feedrate"] if "feedrate" in args and args["feedrate"] else obj.options["feedrate"]
|
||||
args["feedrate"] = args["feedrate"] if "feedrate" in args and args["feedrate"] else \
|
||||
self.app.defaults["geometry_feedrate"]
|
||||
args["feedrate_z"] = args["feedrate_z"] if "feedrate_z" in args and args["feedrate_z"] else \
|
||||
obj.options["feedrate_z"]
|
||||
self.app.defaults["geometry_feedrate_z"]
|
||||
args["feedrate_rapid"] = args["feedrate_rapid"] if "feedrate_rapid" in args and args["feedrate_rapid"] else \
|
||||
obj.options["feedrate_rapid"]
|
||||
self.app.defaults["geometry_feedrate_rapid"]
|
||||
|
||||
if "extracut_length" in args:
|
||||
args["extracut"] = True
|
||||
@@ -142,20 +144,22 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
else:
|
||||
args["extracut_length"] = float(args["extracut_length"])
|
||||
else:
|
||||
args["extracut"] = False
|
||||
args["extracut"] = self.app.defaults["geometry_extracut"]
|
||||
args["extracut_length"] = self.app.defaults["geometry_extracut_length"]
|
||||
|
||||
if "dpp" in args:
|
||||
args["multidepth"] = True
|
||||
if args["dpp"] is None:
|
||||
args["dpp"] = obj.options["dpp"]
|
||||
args["dpp"] =self.app.defaults["geometry_depthperpass"]
|
||||
else:
|
||||
args["dpp"] = float(args["dpp"])
|
||||
else:
|
||||
args["multidepth"] = False
|
||||
args["multidepth"] = self.app.defaults["geometry_multidepth"]
|
||||
args["dpp"] = self.app.defaults["geometry_depthperpass"]
|
||||
|
||||
args["startz"] = args["startz"] if "startz" in args and args["startz"] else \
|
||||
self.app.defaults["geometry_startz"]
|
||||
args["endz"] = args["endz"] if "endz" in args and args["endz"] else obj.options["endz"]
|
||||
args["endz"] = args["endz"] if "endz" in args and args["endz"] else self.app.defaults["geometry_endz"]
|
||||
|
||||
args["spindlespeed"] = args["spindlespeed"] if "spindlespeed" in args and args["spindlespeed"] != 0 else None
|
||||
|
||||
@@ -166,10 +170,10 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
else:
|
||||
args["dwelltime"] = float(args['dwelltime'])
|
||||
else:
|
||||
args["dwell"] = False
|
||||
args["dwelltime"] = 0.0
|
||||
args["dwell"] = self.app.defaults["geometry_dwell"]
|
||||
args["dwelltime"] = self.app.defaults["geometry_dwelltime"]
|
||||
|
||||
args["pp"] = args["pp"] if "pp" in args and args["pp"] else obj.options["ppname_g"]
|
||||
args["pp"] = args["pp"] if "pp" in args and args["pp"] else self.app.defaults["geometry_ppname_g"]
|
||||
|
||||
if "toolchangez" in args:
|
||||
args["toolchange"] = True
|
||||
@@ -178,8 +182,8 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
else:
|
||||
args["toolchangez"] = obj.options["toolchangez"]
|
||||
else:
|
||||
args["toolchange"] = False
|
||||
args["toolchangez"] = 0.0
|
||||
args["toolchange"] = self.app.defaults["geometry_toolchange"]
|
||||
args["toolchangez"] = self.app.defaults["geometry_toolchangez"]
|
||||
|
||||
args["toolchangexy"] = args["toolchangexy"] if "toolchangexy" in args and args["toolchangexy"] else \
|
||||
self.app.defaults["geometry_toolchangexy"]
|
||||
@@ -201,7 +205,7 @@ class TclCommandCncjob(TclCommandSignaled):
|
||||
|
||||
# HACK !!! Should be solved elsewhere!!!
|
||||
# default option for multidepth is False
|
||||
obj.options['multidepth'] = False
|
||||
# obj.options['multidepth'] = False
|
||||
|
||||
if not obj.multigeo:
|
||||
obj.generatecncjob(use_thread=False, plot=False, **args)
|
||||
|
||||
Reference in New Issue
Block a user