- 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

@ -4906,14 +4906,14 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
def generatecncjob(
self, outname=None,
tooldia=None, offset=None,
dia=None, offset=None,
z_cut=None, z_move=None,
feedrate=None, feedrate_z=None, feedrate_rapid=None,
spindlespeed=None, dwell=None, dwelltime=None,
multidepth=None, depthperpass=None,
toolchange=None, toolchangez=None, toolchangexy=None,
extracut=None, startz=None, endz=None,
ppname_g=None,
pp=None,
segx=None, segy=None,
use_thread=True,
plot=True):
@ -4928,14 +4928,14 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
:param feedrate: Feed rate while cutting on X - Y plane
:param feedrate_z: Feed rate while cutting on Z plane
:param feedrate_rapid: Feed rate while moving with rapids
:param tooldia: Tool diameter
:param dia: Tool diameter
:param outname: Name of the new object
:param spindlespeed: Spindle speed (RPM)
:param ppname_g Name of the postprocessor
:param pp Name of the postprocessor
:return: None
"""
tooldia = tooldia if tooldia else float(self.options["cnctooldia"])
tooldia = dia if dia else float(self.options["cnctooldia"])
outname = outname if outname is not None else self.options["name"]
z_cut = z_cut if z_cut is not None else float(self.options["cutz"])
@ -4966,7 +4966,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
dwell = dwell if dwell else self.options["dwell"]
dwelltime = dwelltime if dwelltime else float(self.options["dwelltime"])
ppname_g = ppname_g if ppname_g else self.options["ppname_g"]
ppname_g = pp if pp else self.options["ppname_g"]
# Object initialization function for app.new_object()
# RUNNING ON SEPARATE THREAD!

View File

@ -17,6 +17,7 @@ CAD program, and create G-Code for Isolation routing.
- some GUI optimizations
- more GUI optimizations related to being part of the Advanced category or not
- added possibility to change the positive SVG exported file color in Tool Film
- fixed some issues recently introduced in the TclCommands CNCJob, DrillCNCJob adn write_gcode; changed some parameters names
15.09.2019

View File

@ -7792,7 +7792,7 @@ class FAExcPrefGroupUI(OptionsGroupUI):
self.layout.addWidget(self.exc_list_label)
self.exc_list_text = FCTextArea()
self.exc_list_text.sizeHint(custom_sizehint=150)
# self.exc_list_text.sizeHint(custom_sizehint=150)
font = QtGui.QFont()
font.setPointSize(12)
self.exc_list_text.setFont(font)
@ -7825,7 +7825,7 @@ class FAGcoPrefGroupUI(OptionsGroupUI):
self.layout.addWidget(self.gco_list_label)
self.gco_list_text = FCTextArea()
self.gco_list_text.sizeHint(custom_sizehint=150)
# self.gco_list_text.sizeHint(custom_sizehint=150)
font = QtGui.QFont()
font.setPointSize(12)
self.gco_list_text.setFont(font)
@ -7858,7 +7858,7 @@ class FAGrbPrefGroupUI(OptionsGroupUI):
self.layout.addWidget(self.grb_list_label)
self.grb_list_text = FCTextArea()
self.grb_list_text.sizeHint(custom_sizehint=150)
# self.grb_list_text.sizeHint(custom_sizehint=150)
self.layout.addWidget(self.grb_list_text)
font = QtGui.QFont()
font.setPointSize(12)
@ -7869,6 +7869,7 @@ class FAGrbPrefGroupUI(OptionsGroupUI):
"FlatCAM and the files with above extensions.\n"
"They will be active after next logon.\n"
"This work only in Windows."))
self.layout.addWidget(self.grb_list_btn)
# self.layout.addStretch()

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.