- more refactoring class names
- moved some of the methods from the App class to the ObjectCollection class
This commit is contained in:
@@ -1239,7 +1239,7 @@ class CutOut(AppTool):
|
||||
# events out of the self.app.collection view (it's about Project Tab) are of type int
|
||||
if type(event) is int:
|
||||
key = event
|
||||
# events from the AppGUI are of type QKeyEvent
|
||||
# events from the GUI are of type QKeyEvent
|
||||
elif type(event) == QtGui.QKeyEvent:
|
||||
key = event.key()
|
||||
elif isinstance(event, mpl_key_event): # MatPlotLib key events are trickier to interpret than the rest
|
||||
|
||||
@@ -293,5 +293,5 @@ class ToolImage(AppTool):
|
||||
# Register recent file
|
||||
self.app.file_opened.emit("image", filename)
|
||||
|
||||
# AppGUI feedback
|
||||
# GUI feedback
|
||||
self.app.inform.emit('[success] %s: %s' % (_("Opened"), filename))
|
||||
|
||||
@@ -620,7 +620,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
}
|
||||
""")
|
||||
self.tools_box.addWidget(self.reset_button)
|
||||
# ############################ FINSIHED AppGUI ###################################
|
||||
# ############################ FINSIHED GUI ###################################
|
||||
# #############################################################################
|
||||
|
||||
# #############################################################################
|
||||
@@ -825,7 +825,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
def form_to_storage(self):
|
||||
if self.tools_table.rowCount() == 0:
|
||||
# there is no tool in tool table so we can't save the AppGUI elements values to storage
|
||||
# there is no tool in tool table so we can't save the GUI elements values to storage
|
||||
return
|
||||
|
||||
self.blockSignals(True)
|
||||
@@ -853,7 +853,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
def on_apply_param_to_all_clicked(self):
|
||||
if self.tools_table.rowCount() == 0:
|
||||
# there is no tool in tool table so we can't save the AppGUI elements values to storage
|
||||
# there is no tool in tool table so we can't save the GUI elements values to storage
|
||||
log.debug("NonCopperClear.on_apply_param_to_all_clicked() --> no tool in Tools Table, aborting.")
|
||||
return
|
||||
|
||||
@@ -1860,7 +1860,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
# events out of the self.app.collection view (it's about Project Tab) are of type int
|
||||
if type(event) is int:
|
||||
key = event
|
||||
# events from the AppGUI are of type QKeyEvent
|
||||
# events from the GUI are of type QKeyEvent
|
||||
elif type(event) == QtGui.QKeyEvent:
|
||||
key = event.key()
|
||||
elif isinstance(event, mpl_key_event): # MatPlotLib key events are trickier to interpret than the rest
|
||||
@@ -2102,7 +2102,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
"than isolation tool diameter."))
|
||||
try:
|
||||
for geo_elem in isolated_geo:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
if self.app.abort_flag:
|
||||
@@ -2295,7 +2295,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
Usage of the different one is related to when this function is called
|
||||
from a TcL command.
|
||||
|
||||
:param run_threaded: If True the method will be run in a threaded way suitable for AppGUI usage; if False
|
||||
:param run_threaded: If True the method will be run in a threaded way suitable for GUI usage; if False
|
||||
it will run non-threaded for TclShell usage
|
||||
:return:
|
||||
"""
|
||||
@@ -2353,7 +2353,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
log.debug("NCC Tool. Normal copper clearing task started.")
|
||||
self.app.inform.emit(_("NCC Tool. Finished non-copper polygons. Normal copper clearing task started."))
|
||||
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
if not run_threaded:
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
@@ -2397,7 +2397,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
# graceful abort requested by the user
|
||||
raise grace
|
||||
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
if not run_threaded:
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
@@ -2455,7 +2455,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
if len(area.geoms) > 0:
|
||||
pol_nr = 0
|
||||
for p in area.geoms:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
if not run_threaded:
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
@@ -2606,7 +2606,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
log.debug("NCC Tool. Rest machining copper clearing task started.")
|
||||
app_obj.inform.emit('_(NCC Tool. Rest machining copper clearing task started.')
|
||||
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
if not run_threaded:
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
@@ -2648,7 +2648,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
# graceful abort requested by the user
|
||||
raise grace
|
||||
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
app_obj.inform.emit('[success] %s = %s%s %s' % (
|
||||
@@ -2690,7 +2690,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
# Area to clear
|
||||
for poly in cleared_by_last_tool:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
if self.app.abort_flag:
|
||||
@@ -2731,7 +2731,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
p = p.buffer(0)
|
||||
|
||||
if p is not None and p.is_valid:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
if isinstance(p, Polygon):
|
||||
@@ -2763,7 +2763,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
elif isinstance(p, MultiPolygon):
|
||||
for poly in p:
|
||||
if poly is not None:
|
||||
# provide the app with a way to process the AppGUI events when
|
||||
# provide the app with a way to process the GUI events when
|
||||
# in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
@@ -2954,7 +2954,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
:param tools_storage: whether to use the current tools_storage self.ncc_tools or a different one.
|
||||
Usage of the different one is related to when this function is called from a TcL command.
|
||||
:param plot: if True after the job is finished the result will be plotted, else it will not.
|
||||
:param run_threaded: If True the method will be run in a threaded way suitable for AppGUI usage; if False it will
|
||||
:param run_threaded: If True the method will be run in a threaded way suitable for GUI usage; if False it will
|
||||
run non-threaded for TclShell usage
|
||||
:return:
|
||||
"""
|
||||
@@ -3098,7 +3098,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
assert geo_obj.kind == 'geometry', \
|
||||
"Initializer expected a GeometryObject, got %s" % type(geo_obj)
|
||||
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
if not run_threaded:
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
@@ -3187,7 +3187,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
"than isolation tool diameter."))
|
||||
try:
|
||||
for geo_elem in isolated_geo:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
if self.app.abort_flag:
|
||||
@@ -3295,7 +3295,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
# graceful abort requested by the user
|
||||
raise grace
|
||||
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
app_obj.inform.emit('[success] %s = %s%s %s' % (
|
||||
@@ -3329,7 +3329,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
if len(area.geoms) > 0:
|
||||
pol_nr = 0
|
||||
for p in area.geoms:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
if self.app.abort_flag:
|
||||
@@ -3502,7 +3502,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
log.debug("NCC Tool. Rest machining copper clearing task started.")
|
||||
app_obj.inform.emit('_(NCC Tool. Rest machining copper clearing task started.')
|
||||
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
if not run_threaded:
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
@@ -3566,7 +3566,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
try:
|
||||
for geo_elem in isolated_geo:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
if self.app.abort_flag:
|
||||
@@ -3694,7 +3694,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
|
||||
# Area to clear
|
||||
for poly_r in cleared_by_last_tool:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
if self.app.abort_flag:
|
||||
@@ -3735,7 +3735,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
p = p.buffer(0)
|
||||
|
||||
if p is not None and p.is_valid:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
if isinstance(p, Polygon):
|
||||
@@ -3764,7 +3764,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
elif isinstance(p, MultiPolygon):
|
||||
for poly_p in p:
|
||||
if poly_p is not None:
|
||||
# provide the app with a way to process the AppGUI events when
|
||||
# provide the app with a way to process the GUI events when
|
||||
# in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
|
||||
@@ -3939,7 +3939,7 @@ class NonCopperClear(AppTool, Gerber):
|
||||
except Exception:
|
||||
try:
|
||||
for el in target:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
|
||||
@@ -42,7 +42,7 @@ class ToolOptimal(AppTool):
|
||||
self.decimals = self.app.decimals
|
||||
|
||||
# ############################################################################
|
||||
# ############################ AppGUI creation ##################################
|
||||
# ############################ GUI creation ##################################
|
||||
# ## Title
|
||||
title_label = QtWidgets.QLabel("%s" % self.toolName)
|
||||
title_label.setStyleSheet(
|
||||
@@ -248,7 +248,7 @@ class ToolOptimal(AppTool):
|
||||
|
||||
self.loc_ois = OptionalHideInputSection(self.locations_cb, [self.locations_textb, self.locate_button])
|
||||
self.sec_loc_ois = OptionalHideInputSection(self.sec_locations_cb, [self.sec_locations_frame])
|
||||
# ################## Finished AppGUI creation ###################################
|
||||
# ################## Finished GUI creation ###################################
|
||||
# ############################################################################
|
||||
|
||||
# this is the line selected in the textbox with the locations of the minimum
|
||||
|
||||
@@ -211,7 +211,7 @@ class ToolPDF(AppTool):
|
||||
return
|
||||
# Register recent file
|
||||
self.app.file_opened.emit("excellon", filename)
|
||||
# AppGUI feedback
|
||||
# GUI feedback
|
||||
self.app.inform.emit('[success] %s: %s' % (_("Rendered"), outname))
|
||||
|
||||
def layer_rendering_as_gerber(self, filename, ap_dict, layer_nr):
|
||||
@@ -284,7 +284,7 @@ class ToolPDF(AppTool):
|
||||
return
|
||||
# Register recent file
|
||||
self.app.file_opened.emit('gerber', filename)
|
||||
# AppGUI feedback
|
||||
# GUI feedback
|
||||
self.app.inform.emit('[success] %s: %s' % (_("Rendered"), outname))
|
||||
|
||||
def periodic_check(self, check_period):
|
||||
|
||||
@@ -565,7 +565,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
""")
|
||||
self.tools_box.addWidget(self.reset_button)
|
||||
|
||||
# #################################### FINSIHED AppGUI ###########################
|
||||
# #################################### FINSIHED GUI ###########################
|
||||
# #############################################################################
|
||||
|
||||
# #############################################################################
|
||||
@@ -790,7 +790,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
|
||||
def form_to_storage(self):
|
||||
if self.tools_table.rowCount() == 0:
|
||||
# there is no tool in tool table so we can't save the AppGUI elements values to storage
|
||||
# there is no tool in tool table so we can't save the GUI elements values to storage
|
||||
return
|
||||
|
||||
self.blockSignals(True)
|
||||
@@ -818,7 +818,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
|
||||
def on_apply_param_to_all_clicked(self):
|
||||
if self.tools_table.rowCount() == 0:
|
||||
# there is no tool in tool table so we can't save the AppGUI elements values to storage
|
||||
# there is no tool in tool table so we can't save the GUI elements values to storage
|
||||
log.debug("NonCopperClear.on_apply_param_to_all_clicked() --> no tool in Tools Table, aborting.")
|
||||
return
|
||||
|
||||
@@ -1028,7 +1028,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
"tools_paintrest": self.app.defaults["tools_paintrest"],
|
||||
})
|
||||
|
||||
# ## Init the AppGUI interface
|
||||
# ## Init the GUI interface
|
||||
self.order_radio.set_value(self.app.defaults["tools_paintorder"])
|
||||
self.paintmargin_entry.set_value(self.app.defaults["tools_paintmargin"])
|
||||
self.paintmethod_combo.set_value(self.app.defaults["tools_paintmethod"])
|
||||
@@ -1758,7 +1758,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
# events out of the self.app.collection view (it's about Project Tab) are of type int
|
||||
if type(event) is int:
|
||||
key = event
|
||||
# events from the AppGUI are of type QKeyEvent
|
||||
# events from the GUI are of type QKeyEvent
|
||||
elif type(event) == QtGui.QKeyEvent:
|
||||
key = event.key()
|
||||
elif isinstance(event, mpl_key_event): # MatPlotLib key events are trickier to interpret than the rest
|
||||
@@ -1928,7 +1928,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
|
||||
# process the flashes found in the selected polygon with the 'lines' method for rectangular
|
||||
# flashes and with _("Seed") for oblong and circular flashes
|
||||
# and pads (flahes) need the contour therefore I override the AppGUI settings with always True
|
||||
# and pads (flahes) need the contour therefore I override the GUI settings with always True
|
||||
for ap_type in flash_el_dict:
|
||||
for elem in flash_el_dict[ap_type]:
|
||||
if 'solid' in elem:
|
||||
@@ -2206,7 +2206,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
cp = []
|
||||
try:
|
||||
for pp in poly_buf:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
@@ -2224,7 +2224,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
self.app.proc_container.update_view_text(' %d%%' % disp_number)
|
||||
old_disp_number = disp_number
|
||||
except TypeError:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
@@ -2524,7 +2524,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
cp = []
|
||||
try:
|
||||
for pp in poly_buf:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
@@ -2549,7 +2549,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
# log.debug("Polygons cleared: %d. Percentage done: %d%%" % (pol_nr, disp_number))
|
||||
|
||||
except TypeError:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
@@ -2712,7 +2712,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
cp = []
|
||||
try:
|
||||
for pp in poly_buf:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
@@ -2730,7 +2730,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
self.app.proc_container.update_view_text(' %d%%' % disp_number)
|
||||
old_disp_number = disp_number
|
||||
except TypeError:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
@@ -3022,7 +3022,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
try:
|
||||
try:
|
||||
for pp in poly_buf:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
@@ -3047,7 +3047,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
# log.debug("Polygons cleared: %d. Percentage done: %d%%" % (pol_nr, disp_number))
|
||||
|
||||
except TypeError:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
@@ -3200,7 +3200,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
try:
|
||||
try:
|
||||
for pp in poly_buf:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
@@ -3225,7 +3225,7 @@ class ToolPaint(AppTool, Gerber):
|
||||
# log.debug("Polygons cleared: %d. Percentage done: %d%%" % (pol_nr, disp_number))
|
||||
|
||||
except TypeError:
|
||||
# provide the app with a way to process the AppGUI events when in a blocking loop
|
||||
# provide the app with a way to process the GUI events when in a blocking loop
|
||||
QtWidgets.QApplication.processEvents()
|
||||
if self.app.abort_flag:
|
||||
# graceful abort requested by the user
|
||||
|
||||
@@ -460,7 +460,7 @@ class PcbWizard(AppTool):
|
||||
# Register recent file
|
||||
self.app.file_opened.emit("excellon", name)
|
||||
|
||||
# AppGUI feedback
|
||||
# GUI feedback
|
||||
self.app.inform.emit('[success] %s: %s' % (_("Imported"), name))
|
||||
self.app.ui.notebook.setCurrentWidget(self.app.ui.project_tab)
|
||||
else:
|
||||
|
||||
@@ -257,7 +257,7 @@ class TermWidget(QWidget):
|
||||
class FCShell(TermWidget):
|
||||
def __init__(self, app, version, *args):
|
||||
"""
|
||||
Initialize the TCL Shell. A dock widget that holds the AppGUI interface to the FlatCAM command line.
|
||||
Initialize the TCL Shell. A dock widget that holds the GUI interface to the FlatCAM command line.
|
||||
|
||||
:param app: When instantiated the sysShell will be actually the FlatCAMApp.App() class
|
||||
:param version: FlatCAM version string
|
||||
|
||||
@@ -462,7 +462,7 @@ class ToolSub(AppTool):
|
||||
_('Generating new object failed.'))
|
||||
return
|
||||
|
||||
# AppGUI feedback
|
||||
# GUI feedback
|
||||
self.app.inform.emit('[success] %s: %s' %
|
||||
(_("Created"), outname))
|
||||
|
||||
@@ -666,7 +666,7 @@ class ToolSub(AppTool):
|
||||
return
|
||||
# Register recent file
|
||||
self.app.file_opened.emit('geometry', outname)
|
||||
# AppGUI feedback
|
||||
# GUI feedback
|
||||
self.app.inform.emit('[success] %s: %s' %
|
||||
(_("Created"), outname))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user