- fixed isolate TclCommand to use correctly the -outname parameter

This commit is contained in:
Marius Stanciu 2019-09-15 17:21:15 +03:00 committed by Marius
parent 8b3e1b5a77
commit b0d545eb03
3 changed files with 30 additions and 20 deletions

View File

@ -1917,7 +1917,7 @@ class App(QtCore.QObject):
'use_threads', 'value', 'x', 'x0', 'x1', 'y', 'y0', 'y1', 'z_cut', 'z_move', 'use_threads', 'value', 'x', 'x0', 'x1', 'y', 'y0', 'y1', 'z_cut', 'z_move',
'default', 'feedrate_z', 'grbl_11', 'grbl_laser', 'hpgl', 'line_xyz', 'marlin', 'default', 'feedrate_z', 'grbl_11', 'grbl_laser', 'hpgl', 'line_xyz', 'marlin',
'Paste_1', 'Repetier', 'Toolchange_Custom', 'Roland_MDX_20', 'Toolchange_manual', 'Paste_1', 'Repetier', 'Toolchange_Custom', 'Roland_MDX_20', 'Toolchange_manual',
'Toolchange_Probe_MACH3', 'dwell', 'dwelltime', 'toolchange_xy' 'Toolchange_Probe_MACH3', 'dwell', 'dwelltime', 'toolchange_xy', 'iso_type'
] ]
self.tcl_keywords = [ self.tcl_keywords = [

View File

@ -923,8 +923,8 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
except Exception as e: except Exception as e:
return "Operation failed: %s" % str(e) return "Operation failed: %s" % str(e)
def isolate(self, iso_type=None, dia=None, passes=None, overlap=None, def isolate(self, iso_type=None, dia=None, passes=None, overlap=None, outname=None, combine=None,
outname=None, combine=None, milling_type=None, follow=None): milling_type=None, follow=None):
""" """
Creates an isolation routing geometry object in the project. Creates an isolation routing geometry object in the project.
@ -947,13 +947,13 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
combine = bool(combine) combine = bool(combine)
if milling_type is None: if milling_type is None:
milling_type = self.options["milling_type"] milling_type = self.options["milling_type"]
if iso_type is None: if iso_type is None:
self.iso_type = 2 self.iso_type = 2
else: else:
self.iso_type = iso_type self.iso_type = iso_type
base_name = self.options["name"] + "_iso" base_name = self.options["name"]
base_name = outname or base_name
def generate_envelope(offset, invert, envelope_iso_type=2, follow=None, passes=0): def generate_envelope(offset, invert, envelope_iso_type=2, follow=None, passes=0):
# isolation_geometry produces an envelope that is going on the left of the geometry # isolation_geometry produces an envelope that is going on the left of the geometry
@ -1061,12 +1061,15 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
return new_geometry return new_geometry
if combine: if combine:
if self.iso_type == 0: if outname is None:
iso_name = self.options["name"] + "_ext_iso" if self.iso_type == 0:
elif self.iso_type == 1: iso_name = base_name + "_ext_iso"
iso_name = self.options["name"] + "_int_iso" elif self.iso_type == 1:
iso_name = base_name + "_int_iso"
else:
iso_name = base_name + "_iso"
else: else:
iso_name = base_name iso_name = outname
# TODO: This is ugly. Create way to pass data into init function. # TODO: This is ugly. Create way to pass data into init function.
def iso_init(geo_obj, app_obj): def iso_init(geo_obj, app_obj):
@ -1167,19 +1170,25 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
offset = dia * ((2 * i + 1) / 2.0) - (i * overlap * dia) offset = dia * ((2 * i + 1) / 2.0) - (i * overlap * dia)
if passes > 1: if passes > 1:
if self.iso_type == 0: if outname is None:
iso_name = self.options["name"] + "_ext_iso" + str(i + 1) if self.iso_type == 0:
elif self.iso_type == 1: iso_name = base_name + "_ext_iso" + str(i + 1)
iso_name = self.options["name"] + "_int_iso" + str(i + 1) elif self.iso_type == 1:
iso_name = base_name + "_int_iso" + str(i + 1)
else:
iso_name = base_name + "_iso" + str(i + 1)
else: else:
iso_name = base_name + str(i + 1) iso_name = outname
else: else:
if self.iso_type == 0: if outname is None:
iso_name = self.options["name"] + "_ext_iso" if self.iso_type == 0:
elif self.iso_type == 1: iso_name = base_name + "_ext_iso"
iso_name = self.options["name"] + "_int_iso" elif self.iso_type == 1:
iso_name = base_name + "_int_iso"
else:
iso_name = base_name + "_iso"
else: else:
iso_name = base_name iso_name = outname
# TODO: This is ugly. Create way to pass data into init function. # TODO: This is ugly. Create way to pass data into init function.
def iso_init(geo_obj, app_obj): def iso_init(geo_obj, app_obj):

View File

@ -19,6 +19,7 @@ CAD program, and create G-Code for Isolation routing.
- finished updating the TclCommand cncjob to work for multi-geo Geometry objects with the parameters from the args - finished updating the TclCommand cncjob to work for multi-geo Geometry objects with the parameters from the args
- fixed the TclCommand cncjob to use the -outname parameter - fixed the TclCommand cncjob to use the -outname parameter
- added some more keywords in the data_model for auto-completer - added some more keywords in the data_model for auto-completer
- fixed isolate TclCommand to use correctly the -outname parameter
14.09.2019 14.09.2019