Kaynağa Gözat

- modified Toggle Workspace function to work in the new Preferences UI configuration
- cleaned the app from progress signal usage since it is not used anymore

Marius Stanciu 6 yıl önce
ebeveyn
işleme
e090b96c7c

+ 6 - 10
FlatCAMApp.py

@@ -1846,7 +1846,7 @@ class App(QtCore.QObject):
         # signal to be called when the app is quiting
         self.app_quit.connect(self.quit_application, type=Qt.QueuedConnection)
         self.message.connect(self.message_dialog)
-        self.progress.connect(self.set_progress_bar)
+        # self.progress.connect(self.set_progress_bar)
 
         # signals that are emitted when object state changes
         self.object_created.connect(self.on_object_created)
@@ -6625,7 +6625,7 @@ class App(QtCore.QObject):
         self.plotcanvas.draw_workspace(workspace_size=self.defaults['global_workspaceT'])
 
     def on_workspace(self):
-        if self.ui.general_defaults_form.general_gui_group.workspace_cb.get_value():
+        if self.ui.general_defaults_form.general_app_set_group.workspace_cb.get_value():
             self.plotcanvas.draw_workspace(workspace_size=self.defaults['global_workspaceT'])
         else:
             self.plotcanvas.delete_workspace()
@@ -6633,13 +6633,13 @@ class App(QtCore.QObject):
         # self.save_defaults(silent=True)
 
     def on_workspace_toggle(self):
-        state = False if self.ui.general_defaults_form.general_gui_group.workspace_cb.get_value() else True
+        state = False if self.ui.general_defaults_form.general_app_set_group.workspace_cb.get_value() else True
         try:
-            self.ui.general_defaults_form.general_gui_group.workspace_cb.stateChanged.disconnect(self.on_workspace)
+            self.ui.general_defaults_form.general_app_set_group.workspace_cb.stateChanged.disconnect(self.on_workspace)
         except TypeError:
             pass
-        self.ui.general_defaults_form.general_gui_group.workspace_cb.set_value(state)
-        self.ui.general_defaults_form.general_gui_group.workspace_cb.stateChanged.connect(self.on_workspace)
+        self.ui.general_defaults_form.general_app_set_group.workspace_cb.set_value(state)
+        self.ui.general_defaults_form.general_app_set_group.workspace_cb.stateChanged.connect(self.on_workspace)
         self.on_workspace()
 
     def on_layout(self, index=None, lay=None):
@@ -10874,13 +10874,11 @@ class App(QtCore.QObject):
             name = outname or filename.split('/')[-1].split('\\')[-1]
 
             self.new_object(obj_type, name, obj_init, autoselected=False)
-            self.progress.emit(20)
             # Register recent file
             self.file_opened.emit("dxf", filename)
 
             # GUI feedback
             self.inform.emit('[success] %s: %s' % (_("Opened"), filename))
-            self.progress.emit(100)
 
     def open_gerber(self, filename, outname=None):
         """
@@ -10956,7 +10954,6 @@ class App(QtCore.QObject):
 
         # How the object should be initialized
         def obj_init(excellon_obj, app_obj):
-            # self.progress.emit(20)
 
             try:
                 ret = excellon_obj.parse_file(filename=filename)
@@ -10969,7 +10966,6 @@ class App(QtCore.QObject):
                 app_obj.inform.emit('[ERROR_NOTCL] %s: %s' %
                                     (_("Cannot open file"), filename))
                 log.debug("Could not open Excellon object.")
-                self.progress.emit(0)  # TODO: self and app_bjj mixed
                 return "fail"
             except Exception:
                 msg = '[ERROR_NOTCL] %s' % \

+ 2 - 17
FlatCAMObj.py

@@ -1811,7 +1811,6 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
             visibility = kwargs['visible']
 
         with self.app.proc_container.new(_("Plotting Apertures")):
-            self.app.progress.emit(30)
 
             def job_thread(app_obj):
                 try:
@@ -3080,7 +3079,6 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
         def geo_init(geo_obj, app_obj):
             assert isinstance(geo_obj, FlatCAMGeometry), \
                 "Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
-            app_obj.progress.emit(20)
 
             # ## Add properties to the object
 
@@ -3110,7 +3108,6 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
         if use_thread:
             def geo_thread(app_obj):
                 app_obj.new_object("geometry", outname, geo_init, plot=plot)
-                app_obj.progress.emit(100)
 
             # Create a promise with the new name
             self.app.collection.promise(outname)
@@ -3173,7 +3170,6 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
         def geo_init(geo_obj, app_obj):
             assert isinstance(geo_obj, FlatCAMGeometry), \
                 "Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
-            app_obj.progress.emit(20)
 
             # ## Add properties to the object
 
@@ -3217,7 +3213,6 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
         if use_thread:
             def geo_thread(app_obj):
                 app_obj.new_object("geometry", outname + '_slot', geo_init, plot=plot)
-                app_obj.progress.emit(100)
 
             # Create a promise with the new name
             self.app.collection.promise(outname)
@@ -3358,7 +3353,6 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
         def job_thread(app_obj):
             with self.app.proc_container.new(_("Generating CNC Code")):
                 app_obj.new_object("cncjob", job_name, job_init)
-                app_obj.progress.emit(100)
 
         # Create promise for the new name.
         self.app.collection.promise(job_name)
@@ -5425,11 +5419,8 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
             # Propagate options
             job_obj.options["tooldia"] = tooldia
 
-            app_obj.progress.emit(20)
-
             job_obj.coords_decimals = self.app.defaults["cncjob_coords_decimals"]
             job_obj.fr_decimals = self.app.defaults["cncjob_fr_decimals"]
-            app_obj.progress.emit(40)
 
             job_obj.options['type'] = 'Geometry'
             job_obj.options['tool_dia'] = tooldia
@@ -5459,24 +5450,18 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
                 pp_geometry_name=ppname_g
             )
 
-            app_obj.progress.emit(50)
             # tell gcode_parse from which point to start drawing the lines depending on what kind of object is the
             # source of gcode
             job_obj.toolchange_xy_type = "geometry"
             job_obj.gcode_parse()
-            self.app.inform.emit('[success] %s' %
-                                 _("Finished G-Code processing..."))
-
-            app_obj.progress.emit(80)
+            self.app.inform.emit('[success] %s' % _("Finished G-Code processing..."))
 
         if use_thread:
             # To be run in separate thread
             def job_thread(app_obj):
                 with self.app.proc_container.new(_("Generating CNC Code")):
                     app_obj.new_object("cncjob", outname, job_init, plot=plot)
-                    app_obj.inform.emit('[success] %s: %s' %
-                                        (_("CNCjob created")), outname)
-                    app_obj.progress.emit(100)
+                    app_obj.inform.emit('[success] %s: %s' % (_("CNCjob created")), outname)
 
             # Create a promise with the name
             self.app.collection.promise(outname)

+ 2 - 0
README.md

@@ -14,6 +14,8 @@ CAD program, and create G-Code for Isolation routing.
 - started to rework the NCC Tool GUI in preparation for adding a Tool DB feature
 - for auto-completer, now clicking an entry in the completer popup will select that entry and insert it
 - made available only for Linux and Windows (not OSX) the starting of the thread that checks if another instance of FlatCAM is already running at the launch of FLatCAM
+- modified Toggle Workspace function to work in the new Preferences UI configuration
+- cleaned the app from progress signal usage since it is not used anymore
 
 1.01.2020
 

+ 1 - 5
flatcamEditors/FlatCAMExcEditor.py

@@ -3305,7 +3305,6 @@ class FlatCAMExcEditor(QtCore.QObject):
         # How the object should be initialized
         def obj_init(excellon_obj, app_obj):
 
-            # self.progress.emit(20)
             excellon_obj.drills = deepcopy(new_drills)
             excellon_obj.tools = deepcopy(new_tools)
             excellon_obj.slots = deepcopy(new_slots)
@@ -3335,12 +3334,9 @@ class FlatCAMExcEditor(QtCore.QObject):
                                                                   use_thread=False)
             except Exception as e:
                 log.error("Error on Edited object creation: %s" % str(e))
-                self.app.progress.emit(100)
                 return
 
-            self.app.inform.emit('[success] %s' %
-                                 _("Excellon editing finished."))
-            # self.progress.emit(100)
+            self.app.inform.emit('[success] %s' % _("Excellon editing finished."))
 
     def on_tool_select(self, tool):
         """

+ 8 - 34
flatcamEditors/FlatCAMGeoEditor.py

@@ -1272,8 +1272,6 @@ class TransformEditorTool(FlatCAMTool):
                     xmaximal = max(xmaxlist)
                     ymaximal = max(ymaxlist)
 
-                    self.app.progress.emit(20)
-
                     for sel_sha in shape_list:
                         px = 0.5 * (xminimal + xmaximal)
                         py = 0.5 * (yminimal + ymaximal)
@@ -1284,11 +1282,7 @@ class TransformEditorTool(FlatCAMTool):
 
                     # self.draw_app.transform_complete.emit()
 
-                    self.app.inform.emit('[success] %s' %
-                                         _("Done. Rotate completed."))
-
-                    self.app.progress.emit(100)
-
+                    self.app.inform.emit('[success] %s' % _("Done. Rotate completed."))
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Rotation action was not executed"), str(e)))
                     return
@@ -1329,8 +1323,6 @@ class TransformEditorTool(FlatCAMTool):
                         px = 0.5 * (xminimal + xmaximal)
                         py = 0.5 * (yminimal + ymaximal)
 
-                    self.app.progress.emit(20)
-
                     # execute mirroring
                     for sha in shape_list:
                         if axis is 'X':
@@ -1347,8 +1339,6 @@ class TransformEditorTool(FlatCAMTool):
                     #
                     # self.draw_app.transform_complete.emit()
 
-                    self.app.progress.emit(100)
-
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Flip action was not executed"), str(e)))
                     return
@@ -1375,8 +1365,6 @@ class TransformEditorTool(FlatCAMTool):
                     xminimal = min(xminlist)
                     yminimal = min(yminlist)
 
-                    self.app.progress.emit(20)
-
                     for sha in shape_list:
                         if axis is 'X':
                             sha.skew(num, 0, point=(xminimal, yminimal))
@@ -1388,12 +1376,9 @@ class TransformEditorTool(FlatCAMTool):
                     #
                     # self.draw_app.transform_complete.emit()
                     if axis == 'X':
-                        self.app.inform.emit('[success] %s...' %
-                                             _('Skew on the X axis done'))
+                        self.app.inform.emit('[success] %s...' % _('Skew on the X axis done'))
                     else:
-                        self.app.inform.emit('[success] %s...' %
-                                             _('Skew on the Y axis done'))
-                    self.app.progress.emit(100)
+                        self.app.inform.emit('[success] %s...' % _('Skew on the Y axis done'))
 
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed"), str(e)))
@@ -1407,8 +1392,7 @@ class TransformEditorTool(FlatCAMTool):
         ymaxlist = []
 
         if not shape_list:
-            self.app.inform.emit('[WARNING_NOTCL] %s' %
-                                 _("No shape selected. Please Select a shape to scale!"))
+            self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected. Please Select a shape to scale!"))
             return
         else:
             with self.app.proc_container.new(_("Applying Scale")):
@@ -1427,8 +1411,6 @@ class TransformEditorTool(FlatCAMTool):
                     xmaximal = max(xmaxlist)
                     ymaximal = max(ymaxlist)
 
-                    self.app.progress.emit(20)
-
                     if point is None:
                         px = 0.5 * (xminimal + xmaximal)
                         py = 0.5 * (yminimal + ymaximal)
@@ -1445,12 +1427,9 @@ class TransformEditorTool(FlatCAMTool):
                     # self.draw_app.transform_complete.emit()
 
                     if str(axis) == 'X':
-                        self.app.inform.emit('[success] %s...' %
-                                             _('Scale on the X axis done'))
+                        self.app.inform.emit('[success] %s...' % _('Scale on the X axis done'))
                     else:
-                        self.app.inform.emit('[success] %s...' %
-                                             _('Scale on the Y axis done'))
-                    self.app.progress.emit(100)
+                        self.app.inform.emit('[success] %s...' % _('Scale on the Y axis done'))
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Scale action was not executed"), str(e)))
                     return
@@ -1467,8 +1446,6 @@ class TransformEditorTool(FlatCAMTool):
         else:
             with self.app.proc_container.new(_("Applying Offset")):
                 try:
-                    self.app.progress.emit(20)
-
                     for sha in shape_list:
                         if axis is 'X':
                             sha.offset((num, 0))
@@ -1477,12 +1454,9 @@ class TransformEditorTool(FlatCAMTool):
                         self.draw_app.replot()
 
                     if axis == 'X':
-                        self.app.inform.emit('[success] %s...' %
-                                             _('Offset on the X axis done'))
+                        self.app.inform.emit('[success] %s...' % _('Offset on the X axis done'))
                     else:
-                        self.app.inform.emit('[success] %s...' %
-                                             _('Offset on the Y axis done'))
-                    self.app.progress.emit(100)
+                        self.app.inform.emit('[success] %s...' % _('Offset on the Y axis done'))
 
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Offset action was not executed"), str(e)))

+ 2 - 16
flatcamEditors/FlatCAMGrbEditor.py

@@ -5761,7 +5761,6 @@ class TransformEditorTool(FlatCAMTool):
                 xmaximal = max(xmaxlist)
                 ymaximal = max(ymaxlist)
 
-                self.app.progress.emit(20)
                 px = 0.5 * (xminimal + xmaximal)
                 py = 0.5 * (yminimal + ymaximal)
 
@@ -5775,12 +5774,9 @@ class TransformEditorTool(FlatCAMTool):
                         sel_el['clear'] = affinity.rotate(sel_el['clear'], angle=-num, origin=(px, py))
                 self.draw_app.plot_all()
 
-                self.app.inform.emit('[success] %s' %
-                                     _("Done. Rotate completed."))
-                self.app.progress.emit(100)
+                self.app.inform.emit('[success] %s' % _("Done. Rotate completed."))
             except Exception as e:
-                self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
-                                     (_("Rotation action was not executed."), str(e)))
+                self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Rotation action was not executed."), str(e)))
                 return
 
     def on_flip(self, axis):
@@ -5827,8 +5823,6 @@ class TransformEditorTool(FlatCAMTool):
                     px = 0.5 * (xminimal + xmaximal)
                     py = 0.5 * (yminimal + ymaximal)
 
-                self.app.progress.emit(20)
-
                 # execute mirroring
                 for sel_el_shape in elem_list:
                     sel_el = sel_el_shape.geo
@@ -5851,8 +5845,6 @@ class TransformEditorTool(FlatCAMTool):
                         self.app.inform.emit('[success] %s...' %
                                              _('Flip on the X axis done'))
                 self.draw_app.plot_all()
-                self.app.progress.emit(100)
-
             except Exception as e:
                 self.app.inform.emit('[ERROR_NOTCL] %s: %s' %
                                      (_("Flip action was not executed."), str(e)))
@@ -5889,8 +5881,6 @@ class TransformEditorTool(FlatCAMTool):
                     xminimal = min(xminlist)
                     yminimal = min(yminlist)
 
-                    self.app.progress.emit(20)
-
                     for sel_el_shape in elem_list:
                         sel_el = sel_el_shape.geo
                         if axis is 'X':
@@ -5913,8 +5903,6 @@ class TransformEditorTool(FlatCAMTool):
                         self.app.inform.emit('[success] %s...' % _('Skew on the X axis done'))
                     else:
                         self.app.inform.emit('[success] %s...' % _('Skew on the Y axis done'))
-                    self.app.progress.emit(100)
-
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed."), str(e)))
                     return
@@ -5958,8 +5946,6 @@ class TransformEditorTool(FlatCAMTool):
                     xmaximal = max(xmaxlist)
                     ymaximal = max(ymaxlist)
 
-                    self.app.progress.emit(20)
-
                     if point is None:
                         px = 0.5 * (xminimal + xmaximal)
                         py = 0.5 * (yminimal + ymaximal)

+ 8 - 4
flatcamGUI/FlatCAMGUI.py

@@ -2221,9 +2221,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
         self.infobar.addWidget(self.units_label)
 
         # disabled
-        self.progress_bar = QtWidgets.QProgressBar()
-        self.progress_bar.setMinimum(0)
-        self.progress_bar.setMaximum(100)
+        # self.progress_bar = QtWidgets.QProgressBar()
+        # self.progress_bar.setMinimum(0)
+        # self.progress_bar.setMaximum(100)
         # infobar.addWidget(self.progress_bar)
 
         # ########################################################################
@@ -2262,6 +2262,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
         self.grb_editor_cmenu.menuAction().setVisible(False)
         self.e_editor_cmenu.menuAction().setVisible(False)
 
+        # ########################################################################
+        # ######################## BUILD PREFERENCES #############################
+        # ########################################################################
+
         self.general_defaults_form = GeneralPreferencesUI(decimals=self.decimals)
         self.gerber_defaults_form = GerberPreferencesUI(decimals=self.decimals)
         self.excellon_defaults_form = ExcellonPreferencesUI(decimals=self.decimals)
@@ -2358,7 +2362,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
         :param event: QT event to filter
         :return:
         """
-        if self.general_defaults_form.general_app_set_group.toggle_tooltips_cb.get_value() is False:
+        if self.app.defaults["global_toggle_tooltips"] is False:
             if event.type() == QtCore.QEvent.ToolTip:
                 return True
             else:

+ 10 - 15
flatcamGUI/PreferencesUI.py

@@ -1661,18 +1661,13 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
         separator_line = QtWidgets.QFrame()
         separator_line.setFrameShape(QtWidgets.QFrame.HLine)
         separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
-        self.layout.addWidget(separator_line)
-
-        grid1 = QtWidgets.QGridLayout()
-        self.layout.addLayout(grid1)
-        grid1.setColumnStretch(0, 0)
-        grid1.setColumnStretch(1, 1)
+        grid0.addWidget(separator_line, 31, 0, 1, 2)
 
         self.pdf_param_label = QtWidgets.QLabel('<B>%s:</b>' % _("Text to PDF parameters"))
         self.pdf_param_label.setToolTip(
             _("Used when saving text in Code Editor or in FlatCAM Document objects.")
         )
-        grid1.addWidget(self.pdf_param_label, 0, 0, 1, 2)
+        grid0.addWidget(self.pdf_param_label, 32, 0, 1, 2)
 
         # Top Margin value
         self.tmargin_entry = FCDoubleSpinner()
@@ -1684,8 +1679,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
             _("Distance between text body and the top of the PDF file.")
         )
 
-        grid1.addWidget(self.tmargin_label, 1, 0)
-        grid1.addWidget(self.tmargin_entry, 1, 1)
+        grid0.addWidget(self.tmargin_label, 33, 0)
+        grid0.addWidget(self.tmargin_entry, 33, 1)
 
         # Bottom Margin value
         self.bmargin_entry = FCDoubleSpinner()
@@ -1697,8 +1692,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
             _("Distance between text body and the bottom of the PDF file.")
         )
 
-        grid1.addWidget(self.bmargin_label, 2, 0)
-        grid1.addWidget(self.bmargin_entry, 2, 1)
+        grid0.addWidget(self.bmargin_label, 34, 0)
+        grid0.addWidget(self.bmargin_entry, 34, 1)
 
         # Left Margin value
         self.lmargin_entry = FCDoubleSpinner()
@@ -1710,8 +1705,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
             _("Distance between text body and the left of the PDF file.")
         )
 
-        grid1.addWidget(self.lmargin_label, 3, 0)
-        grid1.addWidget(self.lmargin_entry, 3, 1)
+        grid0.addWidget(self.lmargin_label, 35, 0)
+        grid0.addWidget(self.lmargin_entry, 35, 1)
 
         # Right Margin value
         self.rmargin_entry = FCDoubleSpinner()
@@ -1723,8 +1718,8 @@ class GeneralAppPrefGroupUI(OptionsGroupUI):
             _("Distance between text body and the right of the PDF file.")
         )
 
-        grid1.addWidget(self.rmargin_label, 4, 0)
-        grid1.addWidget(self.rmargin_entry, 4, 1)
+        grid0.addWidget(self.rmargin_label, 36, 0)
+        grid0.addWidget(self.rmargin_entry, 36, 1)
 
         self.layout.addStretch()
 

+ 0 - 3
flatcamTools/ToolPanelize.py

@@ -484,11 +484,8 @@ class Panelize(FlatCAMTool):
             if panel_obj is not None:
                 self.app.inform.emit(_("Generating panel ... "))
 
-                self.app.progress.emit(0)
-
                 def job_init_excellon(obj_fin, app_obj):
                     currenty = 0.0
-                    self.app.progress.emit(10)
                     obj_fin.tools = copied_tools
                     obj_fin.drills = []
                     obj_fin.slots = []

+ 2 - 6
flatcamTools/ToolPcbWizard.py

@@ -417,8 +417,6 @@ class PcbWizard(FlatCAMTool):
 
         # How the object should be initialized
         def obj_init(excellon_obj, app_obj):
-            # self.progress.emit(20)
-
             try:
                 ret = excellon_obj.parse_file(file_obj=excellon_fileobj)
                 if ret == "fail":
@@ -427,10 +425,8 @@ class PcbWizard(FlatCAMTool):
                                         _("This is not Excellon file."))
                     return "fail"
             except IOError:
-                app_obj.inform.emit('[ERROR_NOTCL] %s: %s' % (
-                        _("Cannot parse file"), self.outname))
+                app_obj.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Cannot parse file"), self.outname))
                 app_obj.log.debug("Could not import Excellon object.")
-                app_obj.progress.emit(0)
                 return "fail"
             except Exception as e:
                 app_obj.log.debug("PcbWizard.on_import_excellon().obj_init() %s" % str(e))
@@ -443,7 +439,7 @@ class PcbWizard(FlatCAMTool):
             if ret == 'fail':
                 app_obj.log.debug("Could not create geometry for Excellon object.")
                 return "fail"
-            app_obj.progress.emit(100)
+
             for tool in excellon_obj.tools:
                 if excellon_obj.tools[tool]['solid_geometry']:
                     return

+ 0 - 6
flatcamTools/ToolSolderPaste.py

@@ -1348,8 +1348,6 @@ class SolderPaste(FlatCAMTool):
             job_obj.options['ymax'] = ymax
 
             for tooluid_key, tooluid_value in obj.tools.items():
-                app_obj.progress.emit(20)
-
                 # find the tool_dia associated with the tooluid_key
                 tool_dia = tooluid_value['tooldia']
                 tool_cnc_dict = deepcopy(tooluid_value)
@@ -1380,8 +1378,6 @@ class SolderPaste(FlatCAMTool):
                 # tell gcode_parse from which point to start drawing the lines depending on what kind of
                 # object is the source of gcode
                 job_obj.toolchange_xy_type = "geometry"
-                app_obj.progress.emit(80)
-
                 job_obj.cnc_tools.update({
                     tooluid_key: deepcopy(tool_cnc_dict)
                 })
@@ -1394,8 +1390,6 @@ class SolderPaste(FlatCAMTool):
                     if app_obj.new_object("cncjob", name, job_init) != 'fail':
                         app_obj.inform.emit('[success] [success] %s: %s' %
                                             (_("ToolSolderPaste CNCjob created"), name))
-                        app_obj.progress.emit(100)
-
             # Create a promise with the name
             self.app.collection.promise(name)
             # Send to worker

+ 2 - 23
flatcamTools/ToolTransform.py

@@ -682,8 +682,6 @@ class ToolTransform(FlatCAMTool):
                     xmaximal = max(xmaxlist)
                     ymaximal = max(ymaxlist)
 
-                    self.app.progress.emit(20)
-
                     px = 0.5 * (xminimal + xmaximal)
                     py = 0.5 * (yminimal + ymaximal)
                     for sel_obj in obj_list:
@@ -697,8 +695,6 @@ class ToolTransform(FlatCAMTool):
                         sel_obj.options['rotate'] = num
                         sel_obj.plot()
                     self.app.inform.emit('[success] %s...' % _('Rotate done'))
-                    self.app.progress.emit(100)
-
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
                                          (_("Due of"), str(e), _("action was not executed.")))
@@ -743,8 +739,6 @@ class ToolTransform(FlatCAMTool):
                         px = 0.5 * (xminimal + xmaximal)
                         py = 0.5 * (yminimal + ymaximal)
 
-                    self.app.progress.emit(20)
-
                     # execute mirroring
                     for sel_obj in obj_list:
                         if isinstance(sel_obj, FlatCAMCNCjob):
@@ -768,12 +762,9 @@ class ToolTransform(FlatCAMTool):
                                     sel_obj.options['mirror_x'] = not sel_obj.options['mirror_x']
                                 else:
                                     sel_obj.options['mirror_x'] = True
-                                self.app.inform.emit('[success] %s...' %
-                                                     _('Flip on the X axis done'))
+                                self.app.inform.emit('[success] %s...' % _('Flip on the X axis done'))
                             self.app.object_changed.emit(sel_obj)
                         sel_obj.plot()
-                    self.app.progress.emit(100)
-
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
                                          (_("Due of"), str(e), _("action was not executed.")))
@@ -809,8 +800,6 @@ class ToolTransform(FlatCAMTool):
                     xminimal = min(xminlist)
                     yminimal = min(yminlist)
 
-                    self.app.progress.emit(20)
-
                     for sel_obj in obj_list:
                         if isinstance(sel_obj, FlatCAMCNCjob):
                             self.app.inform.emit(_("CNCJob objects can't be skewed."))
@@ -825,10 +814,7 @@ class ToolTransform(FlatCAMTool):
                                 sel_obj.options['skew_y'] = num
                             self.app.object_changed.emit(sel_obj)
                         sel_obj.plot()
-                    self.app.inform.emit('[success] %s %s %s...' %
-                                         (_('Skew on the'),  str(axis), _("axis done")))
-                    self.app.progress.emit(100)
-
+                    self.app.inform.emit('[success] %s %s %s...' % (_('Skew on the'),  str(axis), _("axis done")))
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
                                          (_("Due of"), str(e), _("action was not executed.")))
@@ -865,8 +851,6 @@ class ToolTransform(FlatCAMTool):
                     xmaximal = max(xmaxlist)
                     ymaximal = max(ymaxlist)
 
-                    self.app.progress.emit(20)
-
                     if point is None:
                         px = 0.5 * (xminimal + xmaximal)
                         py = 0.5 * (yminimal + ymaximal)
@@ -887,7 +871,6 @@ class ToolTransform(FlatCAMTool):
 
                     self.app.inform.emit('[success] %s %s %s...' %
                                          (_('Scale on the'), str(axis), _('axis done')))
-                    self.app.progress.emit(100)
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
                                          (_("Due of"), str(e), _("action was not executed.")))
@@ -903,8 +886,6 @@ class ToolTransform(FlatCAMTool):
         else:
             with self.app.proc_container.new(_("Applying Offset")):
                 try:
-                    self.app.progress.emit(20)
-
                     for sel_obj in obj_list:
                         if isinstance(sel_obj, FlatCAMCNCjob):
                             self.app.inform.emit(_("CNCJob objects can't be offset."))
@@ -922,8 +903,6 @@ class ToolTransform(FlatCAMTool):
 
                     self.app.inform.emit('[success] %s %s %s...' %
                                          (_('Offset on the'), str(axis), _('axis done')))
-                    self.app.progress.emit(100)
-
                 except Exception as e:
                     self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' %
                                          (_("Due of"), str(e),  _("action was not executed.")))

+ 0 - 6
tclCommands/TclCommandPanelize.py

@@ -177,11 +177,8 @@ class TclCommandPanelize(TclCommand):
             if obj is not None:
                 self.app.inform.emit("Generating panel ... Please wait.")
 
-                self.app.progress.emit(0)
-
                 def job_init_excellon(obj_fin, app_obj):
                     currenty = 0.0
-                    self.app.progress.emit(10)
                     obj_fin.tools = obj.tools.copy()
                     obj_fin.drills = []
                     obj_fin.slots = []
@@ -247,7 +244,6 @@ class TclCommandPanelize(TclCommand):
                             for tool in obj.tools:
                                 obj_fin.tools[tool]['solid_geometry'][:] = []
 
-                    self.app.progress.emit(0)
                     for row in range(rows):
                         currentx = 0.0
 
@@ -271,10 +267,8 @@ class TclCommandPanelize(TclCommand):
                         currenty += lenghty
 
                 if isinstance(obj, FlatCAMExcellon):
-                    self.app.progress.emit(50)
                     self.app.new_object("excellon", outname, job_init_excellon, plot=False, autoselected=True)
                 else:
-                    self.app.progress.emit(50)
                     self.app.new_object("geometry", outname, job_init_geometry, plot=False, autoselected=True)
 
         if threaded is True: