- trying to optimize Gerber Editor selection with the mouse
- optimized some of the strings
This commit is contained in:
parent
b6d4d5e85f
commit
5170505f53
|
@ -13,6 +13,8 @@ CHANGELOG for FlatCAM beta
|
|||
- updated the Tools Database to include all the Geometry keys in the every tool from database
|
||||
- made sure that the Operation Type values ('Iso', 'Rough' and 'Finish') are not translated as this may create issues all over the application
|
||||
- fix an older issue that made that only the Custom choice created an effect when changing the Offset in the Geometry Object Tool Table
|
||||
- trying to optimize Gerber Editor selection with the mouse
|
||||
- optimized some of the strings
|
||||
|
||||
2.11.2020
|
||||
|
||||
|
|
|
@ -2709,7 +2709,7 @@ class FCMove(FCShapeTool):
|
|||
return "Done."
|
||||
|
||||
def make(self):
|
||||
with self.draw_app.app.proc_container.new("Moving Geometry ..."):
|
||||
with self.draw_app.app.proc_container.new(_("Working ...")):
|
||||
# Create new geometry
|
||||
dx = self.destination[0] - self.origin[0]
|
||||
dy = self.destination[1] - self.origin[1]
|
||||
|
|
|
@ -2378,6 +2378,18 @@ class FCApertureSelect(DrawTool):
|
|||
except Exception as e:
|
||||
log.debug("AppGerberEditor.FCApertureSelect --> %s" % str(e))
|
||||
|
||||
try:
|
||||
self.grb_editor_app.selection_triggered.disconnect()
|
||||
except (TypeError, AttributeError):
|
||||
pass
|
||||
self.grb_editor_app.selection_triggered.connect(self.selection_worker)
|
||||
|
||||
try:
|
||||
self.grb_editor_app.plot_object.disconnect()
|
||||
except (TypeError, AttributeError):
|
||||
pass
|
||||
self.grb_editor_app.plot_object.connect(self.clean_up)
|
||||
|
||||
def set_origin(self, origin):
|
||||
self.origin = origin
|
||||
|
||||
|
@ -2411,46 +2423,63 @@ class FCApertureSelect(DrawTool):
|
|||
self.grb_editor_app.selected.clear()
|
||||
self.sel_aperture.clear()
|
||||
|
||||
for storage in self.grb_editor_app.storage_dict:
|
||||
try:
|
||||
for shape_stored in self.grb_editor_app.storage_dict[storage]['geometry']:
|
||||
if 'solid' in shape_stored.geo:
|
||||
geometric_data = shape_stored.geo['solid']
|
||||
if Point(point).within(geometric_data):
|
||||
if shape_stored in self.grb_editor_app.selected:
|
||||
self.grb_editor_app.selected.remove(shape_stored)
|
||||
else:
|
||||
# add the object to the selected shapes
|
||||
self.grb_editor_app.selected.append(shape_stored)
|
||||
except KeyError:
|
||||
pass
|
||||
self.grb_editor_app.selection_triggered.emit(point)
|
||||
|
||||
# select the aperture in the Apertures Table that is associated with the selected shape
|
||||
self.sel_aperture.clear()
|
||||
def selection_worker(self, point):
|
||||
def job_thread(editor_obj):
|
||||
with editor_obj.app.proc_container.new('%s' % _("Working ...")):
|
||||
brake_flag = False
|
||||
for storage_key, storage_val in editor_obj.storage_dict.items():
|
||||
for shape_stored in storage_val['geometry']:
|
||||
if 'solid' in shape_stored.geo:
|
||||
geometric_data = shape_stored.geo['solid']
|
||||
if Point(point).intersects(geometric_data):
|
||||
if shape_stored in editor_obj.selected:
|
||||
editor_obj.selected.remove(shape_stored)
|
||||
else:
|
||||
# add the object to the selected shapes
|
||||
editor_obj.selected.append(shape_stored)
|
||||
brake_flag = True
|
||||
break
|
||||
if brake_flag is True:
|
||||
break
|
||||
|
||||
self.grb_editor_app.apertures_table.clearSelection()
|
||||
try:
|
||||
self.grb_editor_app.apertures_table.cellPressed.disconnect()
|
||||
except Exception as e:
|
||||
log.debug("AppGerberEditor.FCApertureSelect.click_release() --> %s" % str(e))
|
||||
# #############################################################################################################
|
||||
# select the aperture in the Apertures Table that is associated with the selected shape
|
||||
# #############################################################################################################
|
||||
self.sel_aperture.clear()
|
||||
editor_obj.apertures_table.clearSelection()
|
||||
|
||||
for shape_s in self.grb_editor_app.selected:
|
||||
for storage in self.grb_editor_app.storage_dict:
|
||||
if shape_s in self.grb_editor_app.storage_dict[storage]['geometry']:
|
||||
self.sel_aperture.append(storage)
|
||||
# disconnect signal when clicking in the table
|
||||
try:
|
||||
editor_obj.apertures_table.cellPressed.disconnect()
|
||||
except Exception as e:
|
||||
log.debug("AppGerberEditor.FCApertureSelect.click_release() --> %s" % str(e))
|
||||
|
||||
# self.grb_editor_app.apertures_table.setSelectionMode(QtWidgets.QAbstractItemView.MultiSelection)
|
||||
for aper in self.sel_aperture:
|
||||
for row in range(self.grb_editor_app.apertures_table.rowCount()):
|
||||
if str(aper) == self.grb_editor_app.apertures_table.item(row, 1).text():
|
||||
if not self.grb_editor_app.apertures_table.item(row, 0).isSelected():
|
||||
self.grb_editor_app.apertures_table.selectRow(row)
|
||||
self.grb_editor_app.last_aperture_selected = aper
|
||||
# self.grb_editor_app.apertures_table.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
|
||||
brake_flag = False
|
||||
for shape_s in editor_obj.selected:
|
||||
for storage in editor_obj.storage_dict:
|
||||
if shape_s in editor_obj.storage_dict[storage]['geometry']:
|
||||
self.sel_aperture.append(storage)
|
||||
brake_flag = True
|
||||
break
|
||||
if brake_flag is True:
|
||||
break
|
||||
|
||||
self.grb_editor_app.apertures_table.cellPressed.connect(self.grb_editor_app.on_row_selected)
|
||||
# actual row selection is done here
|
||||
for aper in self.sel_aperture:
|
||||
for row in range(editor_obj.apertures_table.rowCount()):
|
||||
if str(aper) == editor_obj.apertures_table.item(row, 1).text():
|
||||
if not editor_obj.apertures_table.item(row, 0).isSelected():
|
||||
editor_obj.apertures_table.selectRow(row)
|
||||
editor_obj.last_aperture_selected = aper
|
||||
|
||||
return ""
|
||||
# reconnect signal when clicking in the table
|
||||
editor_obj.apertures_table.cellPressed.connect(editor_obj.on_row_selected)
|
||||
|
||||
editor_obj.plot_object.emit(None)
|
||||
|
||||
self.grb_editor_app.app.worker_task.emit({'fcn': job_thread, 'params': [self.grb_editor_app]})
|
||||
|
||||
def clean_up(self):
|
||||
self.grb_editor_app.plot_all()
|
||||
|
@ -2481,6 +2510,9 @@ class AppGerberEditor(QtCore.QObject):
|
|||
# plot_finished = QtCore.pyqtSignal()
|
||||
mp_finished = QtCore.pyqtSignal(list)
|
||||
|
||||
selection_triggered = QtCore.pyqtSignal(object)
|
||||
plot_object = QtCore.pyqtSignal(object)
|
||||
|
||||
def __init__(self, app):
|
||||
# assert isinstance(app, FlatCAMApp.App), \
|
||||
# "Expected the app to be a FlatCAMApp.App, got %s" % type(app)
|
||||
|
@ -4113,7 +4145,7 @@ class AppGerberEditor(QtCore.QObject):
|
|||
|
||||
@staticmethod
|
||||
def worker_job(app_obj):
|
||||
with app_obj.app.proc_container.new('%s ...' % _("Loading Gerber into Editor")):
|
||||
with app_obj.app.proc_container.new('%s ...' % _("Loading")):
|
||||
# ###############################################################
|
||||
# APPLY CLEAR_GEOMETRY on the SOLID_GEOMETRY
|
||||
# ###############################################################
|
||||
|
@ -4400,7 +4432,7 @@ class AppGerberEditor(QtCore.QObject):
|
|||
grb_obj.source_file = self.app.f_handlers.export_gerber(obj_name=out_name, filename=None,
|
||||
local_use=grb_obj, use_thread=False)
|
||||
|
||||
with self.app.proc_container.new(_("Creating Gerber.")):
|
||||
with self.app.proc_container.new(_("Working ...")):
|
||||
try:
|
||||
self.app.app_obj.new_object("gerber", outname, obj_init)
|
||||
except Exception as e:
|
||||
|
@ -4615,8 +4647,8 @@ class AppGerberEditor(QtCore.QObject):
|
|||
self.select_tool("select")
|
||||
return
|
||||
|
||||
if isinstance(self.active_tool, FCApertureSelect):
|
||||
self.plot_all()
|
||||
# if isinstance(self.active_tool, FCApertureSelect):
|
||||
# self.plot_all()
|
||||
else:
|
||||
self.app.log.debug("No active tool to respond to click!")
|
||||
|
||||
|
@ -4702,9 +4734,9 @@ class AppGerberEditor(QtCore.QObject):
|
|||
elif isinstance(self.active_tool, FCApertureSelect):
|
||||
self.active_tool.click_release((self.pos[0], self.pos[1]))
|
||||
|
||||
# if there are selected objects then plot them
|
||||
if self.selected:
|
||||
self.plot_all()
|
||||
# # if there are selected objects then plot them
|
||||
# if self.selected:
|
||||
# self.plot_all()
|
||||
except Exception as e:
|
||||
log.warning("AppGerberEditor.on_grb_click_release() LMB click --> Error: %s" % str(e))
|
||||
raise
|
||||
|
@ -4888,11 +4920,11 @@ class AppGerberEditor(QtCore.QObject):
|
|||
:return: None
|
||||
:rtype: None
|
||||
"""
|
||||
with self.app.proc_container.new("Plotting"):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
self.shapes.clear(update=True)
|
||||
|
||||
for storage in self.storage_dict:
|
||||
# fix for apertures with now geometry inside
|
||||
# fix for apertures with no geometry inside
|
||||
if 'geometry' in self.storage_dict[storage]:
|
||||
for elem in self.storage_dict[storage]['geometry']:
|
||||
if 'solid' in elem.geo:
|
||||
|
|
|
@ -449,7 +449,7 @@ class AppObject(QtCore.QObject):
|
|||
|
||||
# here it is done the object plotting
|
||||
def plotting_task(t_obj):
|
||||
with self.app.proc_container.new(_("Plotting")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
if t_obj.kind == 'cncjob':
|
||||
t_obj.plot(kind=self.app.defaults["cncjob_plot_kind"])
|
||||
if t_obj.kind == 'gerber':
|
||||
|
|
|
@ -1891,7 +1891,7 @@ class CNCJobObject(FlatCAMObj, CNCjob):
|
|||
kind = self.ui.cncplot_method_combo.get_value()
|
||||
|
||||
def worker_task():
|
||||
with self.app.proc_container.new(_("Plotting...")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
self.plot(kind=kind)
|
||||
|
||||
self.app.worker_task.emit({'fcn': worker_task, 'params': []})
|
||||
|
|
|
@ -2561,7 +2561,7 @@ class GeometryObject(FlatCAMObj, Geometry):
|
|||
def on_polish(self):
|
||||
|
||||
def job_thread(obj):
|
||||
with obj.app.proc_container.new(_("Working...")):
|
||||
with obj.app.proc_container.new(_("Working ...")):
|
||||
tooldia = obj.ui.polish_dia_entry.get_value()
|
||||
depth = obj.ui.polish_pressure_entry.get_value()
|
||||
travelz = obj.ui.polish_travelz_entry.get_value()
|
||||
|
|
|
@ -365,7 +365,7 @@ class GerberObject(FlatCAMObj, Gerber):
|
|||
self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Buffering solid geometry"))
|
||||
|
||||
def buffer_task():
|
||||
with self.app.proc_container.new('%s...' % _("Buffering")):
|
||||
with self.app.proc_container.new('%s ...' % _("Buffering")):
|
||||
output = self.app.pool.apply_async(self.buffer_handler, args=([self.solid_geometry]))
|
||||
self.solid_geometry = output.get()
|
||||
|
||||
|
@ -992,7 +992,7 @@ class GerberObject(FlatCAMObj, Gerber):
|
|||
visibility = kwargs['visible']
|
||||
|
||||
def job_thread(app_obj):
|
||||
with self.app.proc_container.new(_("Plotting Apertures")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
try:
|
||||
if aperture_to_plot_mark in self.apertures:
|
||||
for elem in app_obj.apertures[aperture_to_plot_mark]['geometry']:
|
||||
|
|
|
@ -263,7 +263,7 @@ class FlatCAMObj(QtCore.QObject):
|
|||
with self.app.proc_container.new(_("Offsetting...")):
|
||||
self.offset(vector_val)
|
||||
self.app.proc_container.update_view_text('')
|
||||
with self.app.proc_container.new('%s...' % _("Plotting")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
self.plot()
|
||||
self.app.app_obj.object_changed.emit(self)
|
||||
|
||||
|
@ -294,7 +294,7 @@ class FlatCAMObj(QtCore.QObject):
|
|||
self.app.inform.emit('[success] %s' % _("Scale done."))
|
||||
|
||||
self.app.proc_container.update_view_text('')
|
||||
with self.app.proc_container.new('%s...' % _("Plotting")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
self.plot()
|
||||
self.app.app_obj.object_changed.emit(self)
|
||||
|
||||
|
@ -310,7 +310,7 @@ class FlatCAMObj(QtCore.QObject):
|
|||
with self.app.proc_container.new(_("Skewing...")):
|
||||
self.skew(x_angle, y_angle)
|
||||
self.app.proc_container.update_view_text('')
|
||||
with self.app.proc_container.new('%s...' % _("Plotting")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
self.plot()
|
||||
self.app.app_obj.object_changed.emit(self)
|
||||
|
||||
|
@ -390,7 +390,7 @@ class FlatCAMObj(QtCore.QObject):
|
|||
|
||||
def single_object_plot(self):
|
||||
def plot_task():
|
||||
with self.app.proc_container.new('%s...' % _("Plotting")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
self.plot()
|
||||
self.app.app_obj.object_changed.emit(self)
|
||||
|
||||
|
|
|
@ -416,7 +416,7 @@ class ToolCorners(AppTool):
|
|||
|
||||
def replot(self, obj, run_thread=True):
|
||||
def worker_task():
|
||||
with self.app.proc_container.new('%s...' % _("Plotting")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
obj.plot()
|
||||
self.app.app_obj.object_plotted.emit(obj)
|
||||
|
||||
|
|
|
@ -560,7 +560,7 @@ class ToolFiducials(AppTool):
|
|||
|
||||
def replot(self, obj, run_thread=True):
|
||||
def worker_task():
|
||||
with self.app.proc_container.new('%s...' % _("Plotting")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
obj.plot()
|
||||
self.app.app_obj.object_plotted.emit(obj)
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ class ToolImage(AppTool):
|
|||
geo_obj.import_image(filename, units=units, dpi=dpi, mode=mode, mask=mask)
|
||||
geo_obj.multigeo = False
|
||||
|
||||
with self.app.proc_container.new(_("Importing Image")):
|
||||
with self.app.proc_container.new('%s ...' % _("Importing")):
|
||||
|
||||
# Object name
|
||||
name = outname or filename.split('/')[-1].split('\\')[-1]
|
||||
|
|
|
@ -927,7 +927,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||
return
|
||||
|
||||
def job_thread(app_obj, is_display):
|
||||
with self.app.proc_container.new(_("Working...")):
|
||||
with self.app.proc_container.new(_("Working ...")):
|
||||
try:
|
||||
old_disp_number = 0
|
||||
pol_nr = 0
|
||||
|
@ -1387,7 +1387,7 @@ class ToolIsolation(AppTool, Gerber):
|
|||
self.find_safe_tooldia_worker(is_displayed=False)
|
||||
|
||||
def worker_task(iso_obj):
|
||||
with self.app.proc_container.new(_("Isolating...")):
|
||||
with self.app.proc_container.new(_("Isolating ...")):
|
||||
self.isolate_handler(iso_obj)
|
||||
|
||||
self.app.worker_task.emit({'fcn': worker_task, 'params': [self.grb_obj]})
|
||||
|
|
|
@ -160,7 +160,7 @@ class ToolMove(AppTool):
|
|||
if obj.options['plot'] and obj.visible is True]
|
||||
|
||||
def job_move(app_obj):
|
||||
with self.app.proc_container.new(_("Moving...")):
|
||||
with self.app.proc_container.new(_("Moving ...")):
|
||||
|
||||
if not obj_list:
|
||||
app_obj.app.inform.emit('[WARNING_NOTCL] %s' % _("No object(s) selected."))
|
||||
|
@ -226,7 +226,7 @@ class ToolMove(AppTool):
|
|||
def replot(self, obj_list):
|
||||
|
||||
def worker_task():
|
||||
with self.app.proc_container.new('%s...' % _("Plotting")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
for sel_obj in obj_list:
|
||||
sel_obj.plot()
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ class ToolOptimal(AppTool):
|
|||
self.app.inform.emit('[ERROR_NOTCL] %s' % _("Only Gerber objects can be evaluated."))
|
||||
return
|
||||
|
||||
proc = self.app.proc_container.new(_("Working..."))
|
||||
proc = self.app.proc_container.new(_("Working ..."))
|
||||
|
||||
def job_thread(app_obj):
|
||||
app_obj.inform.emit(_("Optimal Tool. Started to search for the minimum distance between copper features."))
|
||||
|
|
|
@ -120,7 +120,7 @@ class ToolPDF(AppTool):
|
|||
# graceful abort requested by the user
|
||||
raise grace
|
||||
|
||||
with self.app.proc_container.new(_("Parsing PDF file ...")):
|
||||
with self.app.proc_container.new(_("Parsing ...")):
|
||||
with open(filename, "rb") as f:
|
||||
pdf = f.read()
|
||||
|
||||
|
|
|
@ -2193,7 +2193,7 @@ class ToolPaint(AppTool, Gerber):
|
|||
# Promise object with the new name
|
||||
self.app.collection.promise(name)
|
||||
|
||||
proc = self.app.proc_container.new(_("Painting..."))
|
||||
proc = self.app.proc_container.new(_("Painting ..."))
|
||||
|
||||
if run_threaded:
|
||||
# Background
|
||||
|
|
|
@ -610,7 +610,7 @@ class Panelize(AppTool):
|
|||
"Final panel has {col} columns and {row} rows").format(
|
||||
text='[WARNING] ', col=columns, row=rows))
|
||||
|
||||
proc = self.app.proc_container.new(_("Working..."))
|
||||
proc = self.app.proc_container.new(_("Working ..."))
|
||||
|
||||
def job_thread(app_obj):
|
||||
try:
|
||||
|
|
|
@ -333,7 +333,7 @@ class PcbWizard(AppTool):
|
|||
|
||||
if excellon_fileobj is not None and excellon_fileobj != '':
|
||||
if self.process_finished:
|
||||
with self.app.proc_container.new(_("Importing Excellon.")):
|
||||
with self.app.proc_container.new('%s ...' % _("Importing")):
|
||||
|
||||
# Object name
|
||||
name = self.outname
|
||||
|
|
|
@ -192,7 +192,7 @@ class Properties(AppTool):
|
|||
self.treeWidget.addChild(obj_name, [obj.options['name']])
|
||||
|
||||
def job_thread(obj_prop):
|
||||
self.app.proc_container.new(_("Calculating dimensions ... Please wait."))
|
||||
self.app.proc_container.new(_("Working ..."))
|
||||
|
||||
length = 0.0
|
||||
width = 0.0
|
||||
|
|
|
@ -163,47 +163,47 @@ class QRCode(AppTool):
|
|||
self.mr = self.app.plotcanvas.graph_event_connect('mouse_release', self.on_mouse_release)
|
||||
self.kr = self.app.plotcanvas.graph_event_connect('key_release', self.on_key_release)
|
||||
|
||||
self.proc = self.app.proc_container.new('%s...' % _("Generating QRCode geometry"))
|
||||
|
||||
def job_thread_qr(app_obj):
|
||||
error_code = {
|
||||
'L': qrcode.constants.ERROR_CORRECT_L,
|
||||
'M': qrcode.constants.ERROR_CORRECT_M,
|
||||
'Q': qrcode.constants.ERROR_CORRECT_Q,
|
||||
'H': qrcode.constants.ERROR_CORRECT_H
|
||||
}[self.ui.error_radio.get_value()]
|
||||
with self.app.proc_container.new('%s' % _("Working ...")) as self.proc:
|
||||
|
||||
qr = qrcode.QRCode(
|
||||
version=self.ui.version_entry.get_value(),
|
||||
error_correction=error_code,
|
||||
box_size=self.ui.bsize_entry.get_value(),
|
||||
border=self.ui.border_size_entry.get_value(),
|
||||
image_factory=qrcode.image.svg.SvgFragmentImage
|
||||
)
|
||||
qr.add_data(text_data)
|
||||
qr.make()
|
||||
error_code = {
|
||||
'L': qrcode.constants.ERROR_CORRECT_L,
|
||||
'M': qrcode.constants.ERROR_CORRECT_M,
|
||||
'Q': qrcode.constants.ERROR_CORRECT_Q,
|
||||
'H': qrcode.constants.ERROR_CORRECT_H
|
||||
}[self.ui.error_radio.get_value()]
|
||||
|
||||
svg_file = BytesIO()
|
||||
img = qr.make_image()
|
||||
img.save(svg_file)
|
||||
qr = qrcode.QRCode(
|
||||
version=self.ui.version_entry.get_value(),
|
||||
error_correction=error_code,
|
||||
box_size=self.ui.bsize_entry.get_value(),
|
||||
border=self.ui.border_size_entry.get_value(),
|
||||
image_factory=qrcode.image.svg.SvgFragmentImage
|
||||
)
|
||||
qr.add_data(text_data)
|
||||
qr.make()
|
||||
|
||||
svg_text = StringIO(svg_file.getvalue().decode('UTF-8'))
|
||||
svg_geometry = self.convert_svg_to_geo(svg_text, units=self.units)
|
||||
self.qrcode_geometry = deepcopy(svg_geometry)
|
||||
svg_file = BytesIO()
|
||||
img = qr.make_image()
|
||||
img.save(svg_file)
|
||||
|
||||
svg_geometry = unary_union(svg_geometry).buffer(0.0000001).buffer(-0.0000001)
|
||||
self.qrcode_utility_geometry = svg_geometry
|
||||
svg_text = StringIO(svg_file.getvalue().decode('UTF-8'))
|
||||
svg_geometry = self.convert_svg_to_geo(svg_text, units=self.units)
|
||||
self.qrcode_geometry = deepcopy(svg_geometry)
|
||||
|
||||
# make a bounding box of the QRCode geometry to help drawing the utility geometry in case it is too
|
||||
# complicated
|
||||
try:
|
||||
a, b, c, d = self.qrcode_utility_geometry.bounds
|
||||
self.box_poly = box(minx=a, miny=b, maxx=c, maxy=d)
|
||||
except Exception as ee:
|
||||
log.debug("QRCode.make() bounds error --> %s" % str(ee))
|
||||
svg_geometry = unary_union(svg_geometry).buffer(0.0000001).buffer(-0.0000001)
|
||||
self.qrcode_utility_geometry = svg_geometry
|
||||
|
||||
app_obj.call_source = 'qrcode_tool'
|
||||
app_obj.inform.emit(_("Click on the Destination point ..."))
|
||||
# make a bounding box of the QRCode geometry to help drawing the utility geometry in case it is too
|
||||
# complicated
|
||||
try:
|
||||
a, b, c, d = self.qrcode_utility_geometry.bounds
|
||||
self.box_poly = box(minx=a, miny=b, maxx=c, maxy=d)
|
||||
except Exception as ee:
|
||||
log.debug("QRCode.make() bounds error --> %s" % str(ee))
|
||||
|
||||
app_obj.call_source = 'qrcode_tool'
|
||||
app_obj.inform.emit(_("Click on the Destination point ..."))
|
||||
|
||||
self.app.worker_task.emit({'fcn': job_thread_qr, 'params': [self.app]})
|
||||
|
||||
|
@ -463,7 +463,7 @@ class QRCode(AppTool):
|
|||
|
||||
def replot(self, obj):
|
||||
def worker_task():
|
||||
with self.app.proc_container.new('%s...' % _("Plotting")):
|
||||
with self.app.proc_container.new('%s ...' % _("Plotting")):
|
||||
obj.plot()
|
||||
|
||||
self.app.worker_task.emit({'fcn': worker_task, 'params': []})
|
||||
|
|
|
@ -667,7 +667,7 @@ class SolderPaste(AppTool):
|
|||
:param use_thread: use thread, True or False
|
||||
:return: a Geometry type object
|
||||
"""
|
||||
proc = self.app.proc_container.new(_("Creating Solder Paste dispensing geometry."))
|
||||
proc = self.app.proc_container.new(_("Working ..."))
|
||||
obj = work_object
|
||||
|
||||
# Sort tools in descending order
|
||||
|
@ -956,7 +956,7 @@ class SolderPaste(AppTool):
|
|||
if use_thread:
|
||||
# To be run in separate thread
|
||||
def job_thread(app_obj):
|
||||
with self.app.proc_container.new("Generating CNC Code"):
|
||||
with self.app.proc_container.new('%s' % _("Working ...")):
|
||||
if app_obj.app_obj.new_object("cncjob", name, job_init) != 'fail':
|
||||
app_obj.inform.emit('[success] [success] %s: %s' %
|
||||
(_("ToolSolderPaste CNCjob created"), name))
|
||||
|
|
|
@ -194,35 +194,36 @@ class ToolSub(AppTool):
|
|||
self.new_apertures[apid][key] = self.target_grb_obj.apertures[apid][key]
|
||||
|
||||
def worker_job(app_obj):
|
||||
# SUBTRACTOR geometry (always the same)
|
||||
sub_geometry = {'solid': [], 'clear': []}
|
||||
# iterate over SUBTRACTOR geometry and load it in the sub_geometry dict
|
||||
for s_apid in app_obj.sub_grb_obj.apertures:
|
||||
for s_el in app_obj.sub_grb_obj.apertures[s_apid]['geometry']:
|
||||
if "solid" in s_el:
|
||||
sub_geometry['solid'].append(s_el["solid"])
|
||||
if "clear" in s_el:
|
||||
sub_geometry['clear'].append(s_el["clear"])
|
||||
with app_obj.app.proc_container.new('%s' % _("Working ...")):
|
||||
# SUBTRACTOR geometry (always the same)
|
||||
sub_geometry = {'solid': [], 'clear': []}
|
||||
# iterate over SUBTRACTOR geometry and load it in the sub_geometry dict
|
||||
for s_apid in app_obj.sub_grb_obj.apertures:
|
||||
for s_el in app_obj.sub_grb_obj.apertures[s_apid]['geometry']:
|
||||
if "solid" in s_el:
|
||||
sub_geometry['solid'].append(s_el["solid"])
|
||||
if "clear" in s_el:
|
||||
sub_geometry['clear'].append(s_el["clear"])
|
||||
|
||||
for ap_id in app_obj.target_grb_obj.apertures:
|
||||
# TARGET geometry
|
||||
target_geo = [geo for geo in app_obj.target_grb_obj.apertures[ap_id]['geometry']]
|
||||
for ap_id in app_obj.target_grb_obj.apertures:
|
||||
# TARGET geometry
|
||||
target_geo = [geo for geo in app_obj.target_grb_obj.apertures[ap_id]['geometry']]
|
||||
|
||||
# send the job to the multiprocessing JOB
|
||||
app_obj.results.append(
|
||||
app_obj.pool.apply_async(app_obj.aperture_intersection, args=(ap_id, target_geo, sub_geometry))
|
||||
)
|
||||
# send the job to the multiprocessing JOB
|
||||
app_obj.results.append(
|
||||
app_obj.pool.apply_async(app_obj.aperture_intersection, args=(ap_id, target_geo, sub_geometry))
|
||||
)
|
||||
|
||||
output = []
|
||||
for p in app_obj.results:
|
||||
res = p.get()
|
||||
output.append(res)
|
||||
app_obj.app.inform.emit('%s: %s...' % (_("Finished parsing geometry for aperture"), str(res[0])))
|
||||
output = []
|
||||
for p in app_obj.results:
|
||||
res = p.get()
|
||||
output.append(res)
|
||||
app_obj.app.inform.emit('%s: %s...' % (_("Finished parsing geometry for aperture"), str(res[0])))
|
||||
|
||||
app_obj.app.inform.emit("%s" % _("Subtraction aperture processing finished."))
|
||||
app_obj.app.inform.emit("%s" % _("Subtraction aperture processing finished."))
|
||||
|
||||
outname = app_obj.ui.target_gerber_combo.currentText() + '_sub'
|
||||
app_obj.aperture_processing_finished.emit(outname, output)
|
||||
outname = app_obj.ui.target_gerber_combo.currentText() + '_sub'
|
||||
app_obj.aperture_processing_finished.emit(outname, output)
|
||||
|
||||
self.app.worker_task.emit({'fcn': worker_job, 'params': [self]})
|
||||
|
||||
|
@ -349,7 +350,7 @@ class ToolSub(AppTool):
|
|||
grb_obj.source_file = app_obj.f_handlers.export_gerber(obj_name=outname, filename=None,
|
||||
local_use=grb_obj, use_thread=False)
|
||||
|
||||
with self.app.proc_container.new(_("Generating new object ...")):
|
||||
with self.app.proc_container.new(_("New object ...")):
|
||||
ret = self.app.app_obj.new_object('gerber', outname, obj_init, autoselected=False)
|
||||
if ret == 'fail':
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' % _('Generating new object failed.'))
|
||||
|
@ -543,7 +544,7 @@ class ToolSub(AppTool):
|
|||
app_obj.log.debug("ToolSub.new_geo_object() --> %s" % str(e))
|
||||
geo_obj.multigeo = False
|
||||
|
||||
with self.app.proc_container.new(_("Generating new object ...")):
|
||||
with self.app.proc_container.new(_("New object ...")):
|
||||
ret = self.app.app_obj.new_object('geometry', outname, obj_init, autoselected=False)
|
||||
if ret == 'fail':
|
||||
self.app.inform.emit('[ERROR_NOTCL] %s' % _('Generating new object failed.'))
|
||||
|
|
26
app_Main.py
26
app_Main.py
|
@ -9358,7 +9358,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
return
|
||||
|
||||
if use_thread is True:
|
||||
self.app.proc_container.new(_("Printing PDF ... Please wait."))
|
||||
self.app.proc_container.new(_("Printing PDF ..."))
|
||||
self.worker_task.emit({'fcn': self.save_pdf, 'params': [filename, obj_selection]})
|
||||
else:
|
||||
self.save_pdf(filename, obj_selection)
|
||||
|
@ -9555,7 +9555,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
except Exception:
|
||||
return 'fail'
|
||||
|
||||
with self.app.proc_container.new(_("Exporting SVG")):
|
||||
with self.app.proc_container.new(_("Exporting ...")):
|
||||
exported_svg = obj.export_svg(scale_stroke_factor=scale_stroke_factor)
|
||||
|
||||
# Determine bounding area for svg export
|
||||
|
@ -9815,7 +9815,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
|
||||
if use_thread is True:
|
||||
|
||||
with self.app.proc_container.new(_("Exporting Excellon")):
|
||||
with self.app.proc_container.new(_("Exporting ...")):
|
||||
|
||||
def job_thread_exc(app_obj):
|
||||
ret = make_excellon()
|
||||
|
@ -9949,7 +9949,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
return 'fail'
|
||||
|
||||
if use_thread is True:
|
||||
with self.app.proc_container.new(_("Exporting Gerber")):
|
||||
with self.app.proc_container.new(_("Exporting ...")):
|
||||
|
||||
def job_thread_grb(app_obj):
|
||||
ret = make_gerber()
|
||||
|
@ -10016,7 +10016,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
|
||||
if use_thread is True:
|
||||
|
||||
with self.app.proc_container.new(_("Exporting DXF")):
|
||||
with self.app.proc_container.new(_("Exporting ...")):
|
||||
|
||||
def job_thread_exc(app_obj):
|
||||
ret_dxf_val = make_dxf()
|
||||
|
@ -10069,7 +10069,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
# appGUI feedback
|
||||
app_obj.inform.emit('[success] %s: %s' % (_("Opened"), filename))
|
||||
|
||||
with self.app.proc_container.new(_("Importing SVG")):
|
||||
with self.app.proc_container.new(_("Importing ...")):
|
||||
|
||||
# Object name
|
||||
name = outname or filename.split('/')[-1].split('\\')[-1]
|
||||
|
@ -10124,7 +10124,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
# appGUI feedback
|
||||
app_obj.inform.emit('[success] %s: %s' % (_("Opened"), filename))
|
||||
|
||||
with self.app.proc_container.new(_("Importing DXF")):
|
||||
with self.app.proc_container.new(_("Importing ...")):
|
||||
|
||||
# Object name
|
||||
name = outname or filename.split('/')[-1].split('\\')[-1]
|
||||
|
@ -10182,7 +10182,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
|
||||
self.app.log.debug("open_gerber()")
|
||||
|
||||
with self.app.proc_container.new(_("Opening Gerber")):
|
||||
with self.app.proc_container.new(_("Opening ...")):
|
||||
# Object name
|
||||
name = outname or filename.split('/')[-1].split('\\')[-1]
|
||||
|
||||
|
@ -10246,7 +10246,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
app_obj.inform.emit('[ERROR_NOTCL] %s: %s' % (_("No geometry found in file"), filename))
|
||||
return "fail"
|
||||
|
||||
with self.app.proc_container.new(_("Opening Excellon.")):
|
||||
with self.app.proc_container.new(_("Opening ...")):
|
||||
# Object name
|
||||
name = outname or filename.split('/')[-1].split('\\')[-1]
|
||||
ret_val = self.app.app_obj.new_object("excellon", name, obj_init, autoselected=False, plot=plot)
|
||||
|
@ -10306,7 +10306,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
|
||||
job_obj.create_geometry()
|
||||
|
||||
with self.app.proc_container.new(_("Opening G-Code.")):
|
||||
with self.app.proc_container.new(_("Opening ...")):
|
||||
|
||||
# Object name
|
||||
name = outname or filename.split('/')[-1].split('\\')[-1]
|
||||
|
@ -10380,7 +10380,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
|
||||
self.app.log.debug("open_hpgl2()")
|
||||
|
||||
with self.app.proc_container.new(_("Opening HPGL2")):
|
||||
with self.app.proc_container.new(_("Opening ...")):
|
||||
# Object name
|
||||
name = outname or filename.split('/')[-1].split('\\')[-1]
|
||||
|
||||
|
@ -10433,7 +10433,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
|
||||
self.app.log.debug("open_script()")
|
||||
|
||||
with self.app.proc_container.new(_("Opening TCL Script...")):
|
||||
with self.app.proc_container.new(_("Opening ...")):
|
||||
|
||||
# Object name
|
||||
script_name = outname or filename.split('/')[-1].split('\\')[-1]
|
||||
|
@ -10642,7 +10642,7 @@ class MenuFileHandlers(QtCore.QObject):
|
|||
if from_tcl:
|
||||
log.debug("MenuFileHandlers.save_project() -> Project saved from TCL command.")
|
||||
|
||||
with self.app.proc_container.new(_("Saving FlatCAM Project")):
|
||||
with self.app.proc_container.new(_("Saving Project ...")):
|
||||
# Capture the latest changes
|
||||
# Current object
|
||||
try:
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -73,7 +73,7 @@ class TclCommandImportSvg(TclCommandSignaled):
|
|||
if obj_type != "geometry" and obj_type != "gerber":
|
||||
self.raise_tcl_error("Option type can be 'geometry' or 'gerber' only, got '%s'." % obj_type)
|
||||
|
||||
with self.app.proc_container.new("Import SVG"):
|
||||
with self.app.proc_container.new('%s' % _("Importing ...")):
|
||||
|
||||
# Object creation
|
||||
self.app.app_obj.new_object(obj_type, outname, obj_init, plot=False)
|
||||
|
|
|
@ -78,7 +78,7 @@ class TclCommandOpenDXF(TclCommandSignaled):
|
|||
|
||||
units = self.app.defaults['units'].upper()
|
||||
|
||||
with self.app.proc_container.new("Open DXF"):
|
||||
with self.app.proc_container.new('%s' % _("Opening ...")):
|
||||
|
||||
# Object creation
|
||||
ret_val = self.app.app_obj.new_object(obj_type, outname, obj_init, plot=False)
|
||||
|
|
|
@ -74,7 +74,7 @@ class TclCommandOpenSVG(TclCommandSignaled):
|
|||
|
||||
units = self.app.defaults['units'].upper()
|
||||
|
||||
with self.app.proc_container.new("Import SVG"):
|
||||
with self.app.proc_container.new(_("Working ...")):
|
||||
|
||||
# Object creation
|
||||
ret_val = self.app.app_obj.new_object(obj_type, outname, obj_init, plot=False)
|
||||
|
|
|
@ -288,12 +288,12 @@ class TclCommandPanelize(TclCommand):
|
|||
self.app.app_obj.new_object("geometry", outname, job_init_geometry, plot=False, autoselected=True)
|
||||
|
||||
if threaded is True:
|
||||
self.app.proc_container.new("Generating panel ... Please wait.")
|
||||
self.app.proc_container.new(_("Working ..."))
|
||||
|
||||
def job_thread(app_obj):
|
||||
try:
|
||||
panelize_2()
|
||||
app_obj.inform.emit("[success] Panel created successfully.")
|
||||
app_obj.inform.emit('[success]' % _("Done."))
|
||||
except Exception as ee:
|
||||
log.debug(str(ee))
|
||||
return
|
||||
|
@ -302,4 +302,4 @@ class TclCommandPanelize(TclCommand):
|
|||
self.app.worker_task.emit({'fcn': job_thread, 'params': [self.app]})
|
||||
else:
|
||||
panelize_2()
|
||||
self.app.inform.emit("[success] Panel created successfully.")
|
||||
self.app.inform.emit('[success]' % _("Done."))
|
||||
|
|
Loading…
Reference in New Issue