- on Set Origin, Move to Origin and Move actions for Gerber and Excellon objects the source file will be also updated (the export functions will export an updated object)

This commit is contained in:
Marius Stanciu 2020-02-19 21:26:08 +02:00 committed by Marius
parent 6a24c8e204
commit 72ce53182d
3 changed files with 36 additions and 1 deletions

View File

@ -7307,7 +7307,9 @@ class App(QtCore.QObject):
def worker_task():
with self.proc_container.new(_("Setting Origin...")):
for obj in self.collection.get_list():
obj_list = self.collection.get_list()
for obj in obj_list:
obj.offset((x, y))
self.object_changed.emit(obj)
@ -7318,6 +7320,17 @@ class App(QtCore.QObject):
obj.options['xmax'] = c
obj.options['ymax'] = d
self.inform.emit('[success] %s...' % _('Origin set'))
for obj in obj_list:
out_name = obj.options["name"]
if obj.kind == 'gerber':
obj.source_file = self.export_gerber(
obj_name=out_name, filename=None, local_use=obj, use_thread=False)
elif obj.kind == 'excellon':
obj.source_file = self.export_excellon(
obj_name=out_name, filename=None, local_use=obj, use_thread=False)
if noplot_sig is False:
self.replot_signal.emit([])
@ -7400,6 +7413,17 @@ class App(QtCore.QObject):
for obj in obj_list:
obj.plot()
for obj in obj_list:
out_name = obj.options["name"]
if obj.kind == 'gerber':
obj.source_file = self.export_gerber(
obj_name=out_name, filename=None, local_use=obj, use_thread=False)
elif obj.kind == 'excellon':
obj.source_file = self.export_excellon(
obj_name=out_name, filename=None, local_use=obj, use_thread=False)
self.inform.emit('[success] %s...' % _('Origin set'))
if use_thread is True:

View File

@ -13,6 +13,7 @@ CAD program, and create G-Code for Isolation routing.
- fixed some issues in the Geometry Editor; the jump sigmal disconnect was failing for repeated Editor tool operation
- fixed an issue in Gerber Editor where the multiprocessing pool was reported as closed and an ValueError exception was raised in a certain scneraio
- on Set Origin, Move to Origin and Move actions for Gerber and Excellon objects the source file will be also updated (the export functions will export an updated object)
17.02.2020

View File

@ -188,6 +188,16 @@ class ToolMove(FlatCAMTool):
sel_obj.options['ymin'] = b
sel_obj.options['xmax'] = c
sel_obj.options['ymax'] = d
# update the source_file with the new positions
for sel_obj in obj_list:
out_name = sel_obj.options["name"]
if sel_obj.kind == 'gerber':
sel_obj.source_file = self.app.export_gerber(
obj_name=out_name, filename=None, local_use=sel_obj, use_thread=False)
elif sel_obj.kind == 'excellon':
sel_obj.source_file = self.app.export_excellon(
obj_name=out_name, filename=None, local_use=sel_obj, use_thread=False)
except Exception as e:
log.debug('[ERROR_NOTCL] %s --> %s' % ('ToolMove.on_left_click()', str(e)))
return "fail"