- maintenance_2

This commit is contained in:
Marius Stanciu
2020-06-02 18:29:45 +03:00
committed by Marius
parent 38fa25ed3d
commit f5c84fdc49
255 changed files with 162378 additions and 152106 deletions

View File

@@ -37,9 +37,10 @@ class TclCommandCncjob(TclCommandSignaled):
('extracut_length', float),
('dpp', float),
('toolchangez', float),
('toolchangexy', tuple),
('toolchangexy', str),
('startz', float),
('endz', float),
('endxy', str),
('spindlespeed', int),
('dwelltime', float),
('pp', str),
@@ -65,9 +66,12 @@ class TclCommandCncjob(TclCommandSignaled):
('dpp', 'If present then use multidepth cnc cut. Height of one layer for multidepth.'),
('toolchangez', 'Z distance for toolchange (example: 30.0).\n'
'If used in the command then a toolchange event will be included in gcode'),
('toolchangexy', 'X, Y coordonates for toolchange in format (x, y) (example: (2.0, 3.1) ).'),
('toolchangexy', 'The X,Y coordinates at Toolchange event in format (x, y) (example: (30.0, 15.2) or '
'without parenthesis like: 0.3,1.0). WARNING: no spaces allowed in the value.'),
('startz', 'Height before the first move.'),
('endz', 'Height where the last move will park.'),
('endxy', 'The X,Y coordinates at job end in format (x, y) (example: (2.0, 1.2) or without parenthesis'
'like: 0.3,1.0). WARNING: no spaces allowed in the value.'),
('spindlespeed', 'Speed of the spindle in rpm (example: 4000).'),
('dwelltime', 'Time to pause to allow the spindle to reach the full speed.\n'
'If it is not used in command then it will not be included'),
@@ -124,16 +128,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 +148,33 @@ 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"]
if "endxy" in args and args["endxy"]:
args["endxy"] = args["endxy"]
else:
if self.app.defaults["geometry_endxy"]:
args["endxy"] = self.app.defaults["geometry_endxy"]
else:
args["endxy"] = '0, 0'
if len(eval(args["endxy"])) != 2:
self.raise_tcl_error("The entered value for 'endxy' needs to have the format x,y or "
"in format (x, y) - no spaces allowed. But always two comma separated values.")
args["spindlespeed"] = args["spindlespeed"] if "spindlespeed" in args and args["spindlespeed"] != 0 else None
@@ -166,23 +185,31 @@ 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
if args["toolchangez"] is not None:
args["toolchangez"] = args["toolchangez"]
else:
args["toolchangez"] = obj.options["toolchangez"]
args["toolchangez"] = self.app.defaults["geometry_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"]
if "toolchangexy" in args and args["toolchangexy"]:
args["toolchangexy"] = args["toolchangexy"]
else:
if self.app.defaults["geometry_toolchangexy"]:
args["toolchangexy"] = self.app.defaults["geometry_toolchangexy"]
else:
args["toolchangexy"] = '0, 0'
if len(eval(args["toolchangexy"])) != 2:
self.raise_tcl_error("The entered value for 'toolchangexy' needs to have the format x,y or "
"in format (x, y) - no spaces allowed. But always two comma separated values.")
del args['name']
@@ -191,7 +218,7 @@ class TclCommandCncjob(TclCommandSignaled):
continue
else:
if args[arg] is None:
print(arg, args[arg])
print("None parameters: %s is None" % arg)
if muted is False:
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'
@@ -201,7 +228,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)
@@ -230,6 +257,7 @@ class TclCommandCncjob(TclCommandSignaled):
local_tools_dict[tool_uid]['data']['toolchangexy'] = args["toolchangexy"]
local_tools_dict[tool_uid]['data']['startz'] = args["startz"]
local_tools_dict[tool_uid]['data']['endz'] = args["endz"]
local_tools_dict[tool_uid]['data']['endxy'] = args["endxy"]
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"]