- removed the Open Gerber with 'follow' menu entry and also the open_gerber Tcl Command attribute 'follow'. This is no longer required because now the follow_geometry is stored by default in a Gerber object attribute gerber_obj.follow_geometry

- added a new parameter for the Tcl CommandIsolate, named: 'follow'. When follow = 1 (True) the resulting geometry will follow the Gerber paths.
This commit is contained in:
Marius Stanciu
2019-02-19 14:53:55 +02:00
committed by Marius
parent d998b87601
commit 9d0bcf477a
9 changed files with 176 additions and 154 deletions

View File

@@ -225,7 +225,7 @@ class TclCommandGeoCutout(TclCommandSignaled):
def geo_init(geo_obj, app_obj):
try:
geo = cutout_obj.isolation_geometry((dia / 2), iso_type=0, corner=2)
geo = cutout_obj.isolation_geometry((dia / 2), iso_type=0, corner=2, follow=None)
except Exception as e:
log.debug("TclCommandGeoCutout.execute() --> %s" % str(e))
return 'fail'

View File

@@ -28,7 +28,9 @@ class TclCommandIsolate(TclCommandSignaled):
('passes', int),
('overlap', float),
('combine', int),
('outname', str)
('outname', str),
('follow', str)
])
# array of mandatory options for current Tcl command: required = {'name','outname'}
@@ -43,7 +45,8 @@ class TclCommandIsolate(TclCommandSignaled):
('passes', 'Passes of tool width.'),
('overlap', 'Fraction of tool diameter to overlap passes.'),
('combine', 'Combine all passes into one geometry.'),
('outname', 'Name of the resulting Geometry object.')
('outname', 'Name of the resulting Geometry object.'),
('follow', 'Create a Geometry that follows the Gerber path.')
]),
'examples': []
}
@@ -68,6 +71,9 @@ class TclCommandIsolate(TclCommandSignaled):
else:
timeout = 10000
if 'follow' not in args:
args['follow'] = None
obj = self.app.collection.get_by_name(name)
if obj is None:
self.raise_tcl_error("Object not found: %s" % name)

View File

@@ -17,7 +17,6 @@ class TclCommandOpenGerber(TclCommandSignaled):
# dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
option_types = collections.OrderedDict([
('follow', str),
('outname', str)
])
@@ -29,7 +28,6 @@ class TclCommandOpenGerber(TclCommandSignaled):
'main': "Opens a Gerber file.",
'args': collections.OrderedDict([
('filename', 'Path to file to open.'),
('follow', 'N If 1, does not create polygons, just follows the gerber path.'),
('outname', 'Name of the resulting Gerber object.')
]),
'examples': []
@@ -54,7 +52,7 @@ class TclCommandOpenGerber(TclCommandSignaled):
# Opening the file happens here
self.app.progress.emit(30)
try:
gerber_obj.parse_file(filename, follow=follow)
gerber_obj.parse_file(filename)
except IOError:
app_obj.inform.emit("[ERROR_NOTCL] Failed to open file: %s " % filename)
@@ -77,9 +75,8 @@ class TclCommandOpenGerber(TclCommandSignaled):
else:
outname = filename.split('/')[-1].split('\\')[-1]
follow = None
if 'follow' in args:
follow = args['follow']
self.raise_tcl_error("The 'follow' parameter is obsolete. To create 'follow' geometry use the 'follow' parameter for the Tcl Command isolate()")
with self.app.proc_container.new("Opening Gerber"):