- fixed some issues recently introduced in the TclCommands CNCJob, DrillCNCJob adn write_gcode; changed some parameters names

This commit is contained in:
Marius Stanciu
2019-09-16 17:20:56 +03:00
parent be4d4387f4
commit 727cee7aec
6 changed files with 22 additions and 14 deletions

View File

@@ -24,7 +24,7 @@ class TclCommandCncjob(TclCommandSignaled):
# dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
option_types = collections.OrderedDict([
('tooldia', float),
('dia', float),
('z_cut', float),
('z_move', float),
('feedrate', float),
@@ -54,7 +54,7 @@ class TclCommandCncjob(TclCommandSignaled):
'main': "Generates a CNC Job from a Geometry Object.",
'args': collections.OrderedDict([
('name', 'Name of the source object.'),
('tooldia', 'Tool diameter to show on screen.'),
('dia', 'Tool diameter to show on screen.'),
('z_cut', 'Z-axis cutting position.'),
('z_move', 'Z-axis moving position.'),
('feedrate', 'Moving speed on X-Y plane when cutting.'),
@@ -95,6 +95,8 @@ class TclCommandCncjob(TclCommandSignaled):
if 'muted' in args:
muted = args['muted']
else:
muted = 0
obj = self.app.collection.get_by_name(str(name), isCaseSensitive=False)
@@ -110,7 +112,7 @@ class TclCommandCncjob(TclCommandSignaled):
else:
return
args["tooldia"] = args["tooldia"] if "tooldia" in args else obj.options["cnctooldia"]
args["dia"] = args["dia"] if "dia" in args else obj.options["cnctooldia"]
args["z_cut"] = args["z_cut"] if "z_cut" in args else obj.options["cutz"]
args["z_move"] = args["z_move"] if "z_move" in args else obj.options["travelz"]
@@ -141,10 +143,11 @@ class TclCommandCncjob(TclCommandSignaled):
del args['name']
for arg in args:
if arg == "toolchange_xy" or arg == "spindlespeed":
if arg == "toolchange_xy" or arg == "spindlespeed" or arg == "startz":
continue
else:
if args[arg] is None:
print(arg, args[arg])
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'

View File

@@ -17,7 +17,6 @@ class TclCommandDrillcncjob(TclCommandSignaled):
# dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
option_types = collections.OrderedDict([
('tools', str),
('drilled_dias', str),
('drillz', float),
('travelz', float),
@@ -88,6 +87,8 @@ class TclCommandDrillcncjob(TclCommandSignaled):
if 'muted' in args:
muted = args['muted']
else:
muted = 0
obj = self.app.collection.get_by_name(name)
if obj is None:

View File

@@ -67,6 +67,8 @@ class TclCommandWriteGCode(TclCommandSignaled):
if 'muted' in args:
muted = args['muted']
else:
muted = 0
# TODO: This is not needed any more? All targets should be present.
# If there are promised objects, wait until all promises have been fulfilled.