diff --git a/AppMain.py b/App.py similarity index 99% rename from AppMain.py rename to App.py index 297707c6..b22aa467 100644 --- a/AppMain.py +++ b/App.py @@ -50,7 +50,7 @@ from AppDatabase import ToolsDB2 from vispy.gloo.util import _screenshot from vispy.io import write_png -# FlatCAM AppObjects +# FlatCAM Objects from defaults import FlatCAMDefaults from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI from AppGUI.preferences.PreferencesUIManager import PreferencesUIManager @@ -1896,7 +1896,7 @@ class App(QtCore.QObject): self.calculator_tool = ToolCalculator(self) self.calculator_tool.install(icon=QtGui.QIcon(self.resource_location + '/calculator16.png'), separator=True) - self.sub_tool = ToolSub(app=self) + self.sub_tool = ToolSub(self) self.sub_tool.install(icon=QtGui.QIcon(self.resource_location + '/sub32.png'), pos=self.ui.menutool, separator=True) @@ -2049,9 +2049,6 @@ class App(QtCore.QObject): self.ui.zoom_out_btn.triggered.connect(lambda: self.plotcanvas.zoom(1.5)) # Edit Toolbar Signals - self.ui.newgeo_btn.triggered.connect(self.app_obj.new_geometry_object) - self.ui.newgrb_btn.triggered.connect(self.app_obj.new_gerber_object) - self.ui.newexc_btn.triggered.connect(self.app_obj.new_excellon_object) self.ui.editgeo_btn.triggered.connect(self.object2editor) self.ui.update_obj_btn.triggered.connect(lambda: self.editor2object()) self.ui.copy_btn.triggered.connect(self.on_copy_command) @@ -3586,7 +3583,7 @@ class App(QtCore.QObject): if len(objs) < 2: self.inform.emit('[ERROR_NOTCL] %s: %d' % - (_("At least two objects are required for join. AppObjects currently selected"), len(objs))) + (_("At least two objects are required for join. Objects currently selected"), len(objs))) return 'fail' for obj in objs: @@ -3645,7 +3642,7 @@ class App(QtCore.QObject): if len(objs) < 2: self.inform.emit('[ERROR_NOTCL] %s: %d' % - (_("At least two objects are required for join. AppObjects currently selected"), len(objs))) + (_("At least two objects are required for join. Objects currently selected"), len(objs))) return 'fail' def initialize(exc_obj, app): @@ -3673,7 +3670,7 @@ class App(QtCore.QObject): if len(objs) < 2: self.inform.emit('[ERROR_NOTCL] %s: %d' % - (_("At least two objects are required for join. AppObjects currently selected"), len(objs))) + (_("At least two objects are required for join. Objects currently selected"), len(objs))) return 'fail' def initialize(grb_obj, app): @@ -5793,7 +5790,7 @@ class App(QtCore.QObject): else: self.plotcanvas.auto_adjust_axes() - self.on_zoom_fit(None) + self.on_zoom_fit() self.collection.update_view() # self.inform.emit(_("Plots updated ...")) @@ -6285,7 +6282,7 @@ class App(QtCore.QObject): for obj in self.all_objects_list: # ScriptObject and DocumentObject objects can't be selected - if isinstance(obj, ScriptObject) or isinstance(obj, DocumentObject): + if obj.kind == 'script' or obj.kind == 'document': continue if key == 'multisel' and obj.options['name'] in self.objects_under_the_click_list: @@ -7596,8 +7593,6 @@ class App(QtCore.QObject): Will create a new script file and open it in the Code Editor :param silent: if True will not display status messages - :param name: if specified will be the name of the new script - :param text: pass a source file to the newly created script to be loaded in it :return: None """ if silent is False: @@ -9465,8 +9460,8 @@ class App(QtCore.QObject): # no_stats dict; just so it won't break things on website no_ststs_dict = {} no_ststs_dict["global_ststs"] = {} - full_url = App.version_url + "?s=" + str(self.defaults['global_serial']) + "&v=" + str(self.version) + \ - "&os=" + str(self.os) + "&" + urllib.parse.urlencode(no_ststs_dict["global_ststs"]) + full_url = App.version_url + "?s=" + str(self.defaults['global_serial']) + "&v=" + str(self.version) + full_url += "&os=" + str(self.os) + "&" + urllib.parse.urlencode(no_ststs_dict["global_ststs"]) App.log.debug("Checking for updates @ %s" % full_url) # ## Get the data @@ -9569,13 +9564,12 @@ class App(QtCore.QObject): # will use the default Matplotlib axes self.hover_shapes = ShapeCollectionLegacy(obj=self, app=self, name='hover') - def on_zoom_fit(self, event): + def on_zoom_fit(self): """ Callback for zoom-fit request. This can be either from the corresponding toolbar button or the '1' key when the canvas is focused. Calls ``self.adjust_axes()`` with axes limits from the geometry bounds of all objects. - :param event: Ignored. :return: None """ if self.is_legacy is False: @@ -9644,7 +9638,7 @@ class App(QtCore.QObject): """ Enable plots - :param objects: list of AppObjects to be enabled + :param objects: list of Objects to be enabled :return: """ log.debug("Enabling plots ...") @@ -9685,7 +9679,7 @@ class App(QtCore.QObject): """ Disables plots - :param objects: list of AppObjects to be disabled + :param objects: list of Objects to be disabled :return: """ @@ -9734,7 +9728,7 @@ class App(QtCore.QObject): """ Toggle plots visibility - :param objects: list of AppObjects for which to be toggled the visibility + :param objects: list of Objects for which to be toggled the visibility :return: None """ diff --git a/AppEditors/FlatCAMGeoEditor.py b/AppEditors/FlatCAMGeoEditor.py index aeaf24ec..679f5f03 100644 --- a/AppEditors/FlatCAMGeoEditor.py +++ b/AppEditors/FlatCAMGeoEditor.py @@ -15,10 +15,9 @@ from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5.QtCore import Qt, QSettings from camlib import distance, arc, three_point_circle, Geometry, FlatCAMRTreeStorage -from AppTool import AppTool -from AppGUI.ObjectUI import RadioSet +from AppTools.AppTool import AppTool from AppGUI.GUIElements import OptionalInputSection, FCCheckBox, FCEntry, FCComboBox, FCTextAreaRich, \ - FCTable, FCDoubleSpinner, FCButton, EvalEntry2, FCInputDialog, FCTree + FCDoubleSpinner, FCButton, FCInputDialog, FCTree from AppParsers.ParseFont import * from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon diff --git a/AppEditors/FlatCAMGrbEditor.py b/AppEditors/FlatCAMGrbEditor.py index 0053ac5a..0fdb8b8d 100644 --- a/AppEditors/FlatCAMGrbEditor.py +++ b/AppEditors/FlatCAMGrbEditor.py @@ -14,15 +14,13 @@ import shapely.affinity as affinity from vispy.geometry import Rect -import threading -import time from copy import copy, deepcopy import logging from camlib import distance, arc, three_point_circle from AppGUI.GUIElements import FCEntry, FCComboBox, FCTable, FCDoubleSpinner, FCSpinner, RadioSet, \ EvalEntry2, FCInputDialog, FCButton, OptionalInputSection, FCCheckBox -from AppTool import AppTool +from AppTools.AppTool import AppTool import numpy as np from numpy.linalg import norm as numpy_norm diff --git a/AppGUI/MainGUI.py b/AppGUI/MainGUI.py index 147c90b2..ca0c9524 100644 --- a/AppGUI/MainGUI.py +++ b/AppGUI/MainGUI.py @@ -581,7 +581,7 @@ class MainGUI(QtWidgets.QMainWindow): self.geo_cutpath_menuitem = self.geo_editor_menu.addAction( QtGui.QIcon(self.app.resource_location + '/cutpath16.png'), _('Cut Path\tX')) # self.move_menuitem = self.menu.addAction( - # QtGui.QIcon(self.app.resource_location + '/move16.png'), "Move AppObjects 'm'") + # QtGui.QIcon(self.app.resource_location + '/move16.png'), "Move Objects 'm'") self.geo_copy_menuitem = self.geo_editor_menu.addAction( QtGui.QIcon(self.app.resource_location + '/copy16.png'), _("Copy Geom\tC")) self.geo_delete_menuitem = self.geo_editor_menu.addAction( @@ -789,9 +789,9 @@ class MainGUI(QtWidgets.QMainWindow): self.toolbarfile.setObjectName('File_TB') self.addToolBar(self.toolbarfile) - self.toolbargeo = QtWidgets.QToolBar(_('Edit Toolbar')) - self.toolbargeo.setObjectName('Edit_TB') - self.addToolBar(self.toolbargeo) + self.toolbaredit = QtWidgets.QToolBar(_('Edit Toolbar')) + self.toolbaredit.setObjectName('Edit_TB') + self.addToolBar(self.toolbaredit) self.toolbarview = QtWidgets.QToolBar(_('View Toolbar')) self.toolbarview.setObjectName('View_TB') @@ -845,37 +845,30 @@ class MainGUI(QtWidgets.QMainWindow): # ######################################################################## # ########################## Edit Toolbar# ############################### # ######################################################################## - self.newgeo_btn = self.toolbargeo.addAction( - QtGui.QIcon(self.app.resource_location + '/new_file_geo32.png'), _("New Blank Geometry")) - self.newgrb_btn = self.toolbargeo.addAction( - QtGui.QIcon(self.app.resource_location + '/new_file_grb32.png'), _("New Blank Gerber")) - self.newexc_btn = self.toolbargeo.addAction( - QtGui.QIcon(self.app.resource_location + '/new_file_exc32.png'), _("New Blank Excellon")) - self.toolbargeo.addSeparator() - self.editgeo_btn = self.toolbargeo.addAction( + self.editgeo_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/edit_file32.png'), _("Editor")) - self.update_obj_btn = self.toolbargeo.addAction( + self.update_obj_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/close_edit_file32.png'), _("Save Object and close the Editor") ) - self.toolbargeo.addSeparator() - self.copy_btn = self.toolbargeo.addAction( + self.toolbaredit.addSeparator() + self.copy_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/copy_file32.png'), _("Copy")) - self.delete_btn = self.toolbargeo.addAction( + self.delete_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/delete_file32.png'), _("&Delete")) - self.toolbargeo.addSeparator() - self.distance_btn = self.toolbargeo.addAction( + self.toolbaredit.addSeparator() + self.distance_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/distance32.png'), _("Distance Tool")) - self.distance_min_btn = self.toolbargeo.addAction( + self.distance_min_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/distance_min32.png'), _("Distance Min Tool")) - self.origin_btn = self.toolbargeo.addAction( + self.origin_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/origin32.png'), _('Set Origin')) - self.move2origin_btn = self.toolbargeo.addAction( + self.move2origin_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/origin2_32.png'), _('Move to Origin')) - self.jmp_btn = self.toolbargeo.addAction( + self.jmp_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/jump_to16.png'), _('Jump to Location')) - self.locate_btn = self.toolbargeo.addAction( + self.locate_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/locate32.png'), _('Locate in Object')) # ######################################################################## @@ -912,7 +905,7 @@ class MainGUI(QtWidgets.QMainWindow): self.dblsided_btn = self.toolbartools.addAction( QtGui.QIcon(self.app.resource_location + '/doubleside32.png'), _("2Sided Tool")) self.align_btn = self.toolbartools.addAction( - QtGui.QIcon(self.app.resource_location + '/align32.png'), _("Align AppObjects Tool")) + QtGui.QIcon(self.app.resource_location + '/align32.png'), _("Align Objects Tool")) self.extract_btn = self.toolbartools.addAction( QtGui.QIcon(self.app.resource_location + '/extract_drill32.png'), _("Extract Drills Tool")) @@ -1035,7 +1028,7 @@ class MainGUI(QtWidgets.QMainWindow): QtGui.QIcon(self.app.resource_location + '/transform.png'), _("Transformations")) self.geo_edit_toolbar.addSeparator() self.geo_move_btn = self.geo_edit_toolbar.addAction( - QtGui.QIcon(self.app.resource_location + '/move32.png'), _("Move AppObjects ")) + QtGui.QIcon(self.app.resource_location + '/move32.png'), _("Move Objects ")) # ######################################################################## # ########################## Gerber Editor Toolbar# ###################### @@ -1374,11 +1367,11 @@ class MainGUI(QtWidgets.QMainWindow): self.cmenu_newmenu = self.popMenu.addMenu( QtGui.QIcon(self.app.resource_location + '/file32.png'), _("New")) self.popmenu_new_geo = self.cmenu_newmenu.addAction( - QtGui.QIcon(self.app.resource_location + '/new_geo32_bis.png'), _("Geometry")) + QtGui.QIcon(self.app.resource_location + '/new_file_geo16.png'), _("Geometry")) self.popmenu_new_grb = self.cmenu_newmenu.addAction( - QtGui.QIcon(self.app.resource_location + '/flatcam_icon32.png'), "Gerber") + QtGui.QIcon(self.app.resource_location + '/new_file_grb16.png'), "Gerber") self.popmenu_new_exc = self.cmenu_newmenu.addAction( - QtGui.QIcon(self.app.resource_location + '/new_exc32.png'), _("Excellon")) + QtGui.QIcon(self.app.resource_location + '/new_file_exc16.png'), _("Excellon")) self.cmenu_newmenu.addSeparator() self.popmenu_new_prj = self.cmenu_newmenu.addAction( QtGui.QIcon(self.app.resource_location + '/file16.png'), _("Project")) @@ -1694,9 +1687,9 @@ class MainGUI(QtWidgets.QMainWindow): self.toolbarfile.setVisible(False) if tb & 2: - self.toolbargeo.setVisible(True) + self.toolbaredit.setVisible(True) else: - self.toolbargeo.setVisible(False) + self.toolbaredit.setVisible(False) if tb & 4: self.toolbarview.setVisible(True) @@ -1816,37 +1809,30 @@ class MainGUI(QtWidgets.QMainWindow): # ######################################################################## # ## Edit Toolbar # ## # ######################################################################## - self.newgeo_btn = self.toolbargeo.addAction( - QtGui.QIcon(self.app.resource_location + '/new_file_geo32.png'), _("New Blank Geometry")) - self.newgrb_btn = self.toolbargeo.addAction( - QtGui.QIcon(self.app.resource_location + '/new_file_grb32.png'), _("New Blank Gerber")) - self.newexc_btn = self.toolbargeo.addAction( - QtGui.QIcon(self.app.resource_location + '/new_file_exc32.png'), _("New Blank Excellon")) - self.toolbargeo.addSeparator() - self.editgeo_btn = self.toolbargeo.addAction( + self.editgeo_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/edit32.png'), _("Editor")) - self.update_obj_btn = self.toolbargeo.addAction( + self.update_obj_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/close_edit_file32.png'), _("Save Object and close the Editor") ) - self.toolbargeo.addSeparator() - self.copy_btn = self.toolbargeo.addAction( + self.toolbaredit.addSeparator() + self.copy_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/copy_file32.png'), _("Copy")) - self.delete_btn = self.toolbargeo.addAction( + self.delete_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/delete_file32.png'), _("&Delete")) - self.toolbargeo.addSeparator() - self.distance_btn = self.toolbargeo.addAction( + self.toolbaredit.addSeparator() + self.distance_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/distance32.png'), _("Distance Tool")) - self.distance_min_btn = self.toolbargeo.addAction( + self.distance_min_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/distance_min32.png'), _("Distance Min Tool")) - self.origin_btn = self.toolbargeo.addAction( + self.origin_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/origin32.png'), _('Set Origin')) - self.move2origin_btn = self.toolbargeo.addAction( + self.move2origin_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/origin2_32.png'), _('Move to Origin')) - self.jmp_btn = self.toolbargeo.addAction( + self.jmp_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/jump_to16.png'), _('Jump to Location')) - self.locate_btn = self.toolbargeo.addAction( + self.locate_btn = self.toolbaredit.addAction( QtGui.QIcon(self.app.resource_location + '/locate32.png'), _('Locate in Object')) # ######################################################################## @@ -1881,7 +1867,7 @@ class MainGUI(QtWidgets.QMainWindow): self.dblsided_btn = self.toolbartools.addAction( QtGui.QIcon(self.app.resource_location + '/doubleside32.png'), _("2Sided Tool")) self.align_btn = self.toolbartools.addAction( - QtGui.QIcon(self.app.resource_location + '/align32.png'), _("Align AppObjects Tool")) + QtGui.QIcon(self.app.resource_location + '/align32.png'), _("Align Objects Tool")) self.extract_btn = self.toolbartools.addAction( QtGui.QIcon(self.app.resource_location + '/extract_drill32.png'), _("Extract Drills Tool")) @@ -1996,7 +1982,7 @@ class MainGUI(QtWidgets.QMainWindow): self.geo_cutpath_btn = self.geo_edit_toolbar.addAction( QtGui.QIcon(self.app.resource_location + '/cutpath32.png'), _('Cut Path')) self.geo_copy_btn = self.geo_edit_toolbar.addAction( - QtGui.QIcon(self.app.resource_location + '/copy32.png'), _("Copy AppObjects")) + QtGui.QIcon(self.app.resource_location + '/copy32.png'), _("Copy Objects")) self.geo_delete_btn = self.geo_edit_toolbar.addAction( QtGui.QIcon(self.app.resource_location + '/trash32.png'), _("Delete Shape")) self.geo_transform_btn = self.geo_edit_toolbar.addAction( @@ -2004,7 +1990,7 @@ class MainGUI(QtWidgets.QMainWindow): self.geo_edit_toolbar.addSeparator() self.geo_move_btn = self.geo_edit_toolbar.addAction( - QtGui.QIcon(self.app.resource_location + '/move32.png'), _("Move AppObjects")) + QtGui.QIcon(self.app.resource_location + '/move32.png'), _("Move Objects")) # ######################################################################## # ## Gerber Editor Toolbar # ## @@ -2547,7 +2533,7 @@ class MainGUI(QtWidgets.QMainWindow): # Zoom Fit if key == QtCore.Qt.Key_V: - self.app.on_zoom_fit(None) + self.app.on_zoom_fit() # Mirror on X the selected object(s) if key == QtCore.Qt.Key_X: @@ -2726,7 +2712,7 @@ class MainGUI(QtWidgets.QMainWindow): self.app.geo_editor.on_corner_snap() if key == QtCore.Qt.Key_V or key == 'V': - self.app.on_zoom_fit(None) + self.app.on_zoom_fit() # we do this so we can reuse the following keys while inside a Tool # the above keys are general enough so were left outside @@ -3180,7 +3166,7 @@ class MainGUI(QtWidgets.QMainWindow): # Zoom Fit if key == QtCore.Qt.Key_V or key == 'V': self.app.exc_editor.launched_from_shortcuts = True - self.app.on_zoom_fit(None) + self.app.on_zoom_fit() return # Add Slot Hole Tool @@ -4010,7 +3996,7 @@ class ShortcutsTab(QtWidgets.QWidget): _("Skew on Y axis"), # ALT section - _("Align AppObjects Tool"), _("Calculators Tool"), _("2-Sided PCB Tool"), _("Transformations Tool"), + _("Align Objects Tool"), _("Calculators Tool"), _("2-Sided PCB Tool"), _("Transformations Tool"), _("Punch Gerber Tool"), _("Extract Drills Tool"), _("Fiducials Tool"), _("Solder Paste Dispensing Tool"), _("Film PCB Tool"), _("Corner Markers Tool"), _("Non-Copper Clearing Tool"), _("Optimal Tool"), diff --git a/AppGUI/ObjectUI.py b/AppGUI/ObjectUI.py index 1c271b68..8f42d44e 100644 --- a/AppGUI/ObjectUI.py +++ b/AppGUI/ObjectUI.py @@ -1272,7 +1272,7 @@ class ExcellonObjectUI(ObjectUI): pp_excellon_label = QtWidgets.QLabel('%s:' % _("Preprocessor E")) pp_excellon_label.setToolTip( _("The preprocessor JSON file that dictates\n" - "Gcode output for Excellon AppObjects.") + "Gcode output for Excellon Objects.") ) self.pp_excellon_name_cb = FCComboBox() self.pp_excellon_name_cb.setFocusPolicy(QtCore.Qt.StrongFocus) @@ -1284,7 +1284,7 @@ class ExcellonObjectUI(ObjectUI): pp_geo_label = QtWidgets.QLabel('%s:' % _("Preprocessor G")) pp_geo_label.setToolTip( _("The preprocessor JSON file that dictates\n" - "Gcode output for Geometry (Milling) AppObjects.") + "Gcode output for Geometry (Milling) Objects.") ) self.pp_geo_name_cb = FCComboBox() self.pp_geo_name_cb.setFocusPolicy(QtCore.Qt.StrongFocus) diff --git a/AppGUI/preferences/PreferencesUIManager.py b/AppGUI/preferences/PreferencesUIManager.py index 2cc2487c..db1d738b 100644 --- a/AppGUI/preferences/PreferencesUIManager.py +++ b/AppGUI/preferences/PreferencesUIManager.py @@ -1093,7 +1093,7 @@ class PreferencesUIManager: if self.ui.toolbarfile.isVisible(): tb_status += 1 - if self.ui.toolbargeo.isVisible(): + if self.ui.toolbaredit.isVisible(): tb_status += 2 if self.ui.toolbarview.isVisible(): diff --git a/AppGUI/preferences/general/GeneralGUIPrefGroupUI.py b/AppGUI/preferences/general/GeneralGUIPrefGroupUI.py index f96c0fe8..67dabc55 100644 --- a/AppGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/AppGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -647,7 +647,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): # first remove the toolbars: try: self.app.ui.removeToolBar(self.app.ui.toolbarfile) - self.app.ui.removeToolBar(self.app.ui.toolbargeo) + self.app.ui.removeToolBar(self.app.ui.toolbaredit) self.app.ui.removeToolBar(self.app.ui.toolbarview) self.app.ui.removeToolBar(self.app.ui.toolbarshell) self.app.ui.removeToolBar(self.app.ui.toolbartools) @@ -664,9 +664,9 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): self.app.ui.toolbarfile.setObjectName('File_TB') self.app.ui.addToolBar(Qt.LeftToolBarArea, self.app.ui.toolbarfile) - self.app.ui.toolbargeo = QtWidgets.QToolBar('Edit Toolbar') - self.app.ui.toolbargeo.setObjectName('Edit_TB') - self.app.ui.addToolBar(Qt.LeftToolBarArea, self.app.ui.toolbargeo) + self.app.ui.toolbaredit = QtWidgets.QToolBar('Edit Toolbar') + self.app.ui.toolbaredit.setObjectName('Edit_TB') + self.app.ui.addToolBar(Qt.LeftToolBarArea, self.app.ui.toolbaredit) self.app.ui.toolbarshell = QtWidgets.QToolBar('Shell Toolbar') self.app.ui.toolbarshell.setObjectName('Shell_TB') @@ -702,9 +702,9 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): self.app.ui.toolbarfile.setObjectName('File_TB') self.app.ui.addToolBar(self.app.ui.toolbarfile) - self.app.ui.toolbargeo = QtWidgets.QToolBar('Edit Toolbar') - self.app.ui.toolbargeo.setObjectName('Edit_TB') - self.app.ui.addToolBar(self.app.ui.toolbargeo) + self.app.ui.toolbaredit = QtWidgets.QToolBar('Edit Toolbar') + self.app.ui.toolbaredit.setObjectName('Edit_TB') + self.app.ui.addToolBar(self.app.ui.toolbaredit) self.app.ui.toolbarview = QtWidgets.QToolBar('View Toolbar') self.app.ui.toolbarview.setObjectName('View_TB') diff --git a/AppObjects/AppObject.py b/AppObjects/AppObject.py index 361663ed..8dfa2113 100644 --- a/AppObjects/AppObject.py +++ b/AppObjects/AppObject.py @@ -292,7 +292,7 @@ class AppObject(QtCore.QObject): self.app.collection.append(obj) # after adding the object to the collection always update the list of objects that are in the collection - self.all_objects_list = self.app.collection.get_list() + self.app.all_objects_list = self.app.collection.get_list() # self.app.inform.emit('[selected] %s created & selected: %s' % # (str(obj.kind).capitalize(), str(obj.options['name']))) @@ -358,7 +358,7 @@ class AppObject(QtCore.QObject): # Send to worker # self.worker.add_task(worker_task, [self]) if plot is True: - self.worker_task.emit({'fcn': task, 'params': [obj]}) + self.app.worker_task.emit({'fcn': task, 'params': [obj]}) def on_object_changed(self, obj): """ @@ -390,4 +390,4 @@ class AppObject(QtCore.QObject): :return: None """ - self.app.on_zoom_fit(None) + self.app.on_zoom_fit() diff --git a/AppObjects/FlatCAMExcellon.py b/AppObjects/FlatCAMExcellon.py index 30f5f841..9095a3f4 100644 --- a/AppObjects/FlatCAMExcellon.py +++ b/AppObjects/FlatCAMExcellon.py @@ -146,7 +146,7 @@ class ExcellonObject(FlatCAMObj, Excellon): If only one object is in exc_list parameter then this function will copy that object in the exc_final - :param exc_list: List or one object of ExcellonObject AppObjects to join. + :param exc_list: List or one object of ExcellonObject Objects to join. :param exc_final: Destination ExcellonObject object. :return: None """ diff --git a/AppObjects/FlatCAMGeometry.py b/AppObjects/FlatCAMGeometry.py index bb418dc3..83744fcd 100644 --- a/AppObjects/FlatCAMGeometry.py +++ b/AppObjects/FlatCAMGeometry.py @@ -2738,7 +2738,7 @@ class GeometryObject(FlatCAMObj, Geometry): """ Merges the geometry of objects in grb_list into the geometry of geo_final. - :param geo_list: List of GerberObject AppObjects to join. + :param geo_list: List of GerberObject Objects to join. :param geo_final: Destination GerberObject object. :param multigeo: if the merged geometry objects are of type MultiGeo :return: None diff --git a/AppObjects/FlatCAMGerber.py b/AppObjects/FlatCAMGerber.py index 98049513..1fcefb28 100644 --- a/AppObjects/FlatCAMGerber.py +++ b/AppObjects/FlatCAMGerber.py @@ -45,7 +45,7 @@ class GerberObject(FlatCAMObj, Gerber): Merges the geometry of objects in geo_list into the geometry of geo_final. - :param grb_list: List of GerberObject AppObjects to join. + :param grb_list: List of GerberObject Objects to join. :param grb_final: Destination GeometryObject object. :return: None """ diff --git a/AppObjects/ObjectCollection.py b/AppObjects/ObjectCollection.py index 8fc25560..02a0247e 100644 --- a/AppObjects/ObjectCollection.py +++ b/AppObjects/ObjectCollection.py @@ -1010,7 +1010,7 @@ class ObjectCollection(QtCore.QAbstractItemModel): def on_row_selected(self, obj_name): """ - This is a special string; when received it will make all Menu -> AppObjects entries unchecked + This is a special string; when received it will make all Menu -> Objects entries unchecked It mean we clicked outside of the items and deselected all :param obj_name: @@ -1194,6 +1194,6 @@ class ObjectCollection(QtCore.QAbstractItemModel): pass if obj_list: - self.app.inform.emit('%s' % _("AppObjects selection is cleared.")) + self.app.inform.emit('%s' % _("Objects selection is cleared.")) else: self.app.inform.emit('') diff --git a/AppTool.py b/AppTools/AppTool.py similarity index 97% rename from AppTool.py rename to AppTools/AppTool.py index 2c2362c4..4c5bd22c 100644 --- a/AppTool.py +++ b/AppTools/AppTool.py @@ -6,8 +6,7 @@ # MIT Licence # # ########################################################## ## -from PyQt5 import QtGui, QtCore, QtWidgets, QtWidgets -from PyQt5.QtCore import Qt +from PyQt5 import QtCore, QtWidgets from shapely.geometry import Polygon, LineString @@ -27,15 +26,16 @@ class AppTool(QtWidgets.QWidget): def __init__(self, app, parent=None): """ - :param app: The application this tool will run in. - :type app: AppMain - :param parent: Qt Parent - :return: AppTool + :param app: The application this tool will run in. + :type app: App.App + :param parent: Qt Parent + :return: AppTool """ - self.app = app - self.decimals = app.decimals - QtWidgets.QWidget.__init__(self, parent) + + self.app = app + self.decimals = self.app.decimals + # self.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum) self.layout = QtWidgets.QVBoxLayout() diff --git a/AppTools/ToolAlignObjects.py b/AppTools/ToolAlignObjects.py index f158e386..542d27f8 100644 --- a/AppTools/ToolAlignObjects.py +++ b/AppTools/ToolAlignObjects.py @@ -5,8 +5,8 @@ # MIT Licence # # ########################################################## -from PyQt5 import QtWidgets, QtGui, QtCore -from AppTool import AppTool +from PyQt5 import QtWidgets, QtCore +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCComboBox, RadioSet @@ -29,7 +29,7 @@ log = logging.getLogger('base') class AlignObjects(AppTool): - toolName = _("Align AppObjects") + toolName = _("Align Objects") def __init__(self, app): AppTool.__init__(self, app) diff --git a/AppTools/ToolCalculators.py b/AppTools/ToolCalculators.py index 08edc27d..247b5003 100644 --- a/AppTools/ToolCalculators.py +++ b/AppTools/ToolCalculators.py @@ -6,7 +6,7 @@ # ########################################################## from PyQt5 import QtWidgets -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCSpinner, FCDoubleSpinner, FCEntry import math diff --git a/AppTools/ToolCalibration.py b/AppTools/ToolCalibration.py index b220f1c0..8071faa4 100644 --- a/AppTools/ToolCalibration.py +++ b/AppTools/ToolCalibration.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore, QtGui -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCDoubleSpinner, EvalEntry, FCCheckBox, OptionalInputSection, FCEntry from AppGUI.GUIElements import FCTable, FCComboBox, RadioSet from AppEditors.FlatCAMTextEditor import TextEditor @@ -620,7 +620,7 @@ class ToolCalibration(AppTool): grid_lay.addWidget(QtWidgets.QLabel(''), 44, 0, 1, 3) # STEP 5 # - step_5 = QtWidgets.QLabel('%s' % _("STEP 5: Calibrate FlatCAM AppObjects")) + step_5 = QtWidgets.QLabel('%s' % _("STEP 5: Calibrate FlatCAM Objects")) step_5.setToolTip( _("Adjust the FlatCAM objects\n" "with the factors determined and verified above.") @@ -656,7 +656,7 @@ class ToolCalibration(AppTool): grid_lay.addWidget(self.adj_object_label, 48, 0, 1, 3) grid_lay.addWidget(self.adj_object_combo, 49, 0, 1, 3) - # ## Adjust AppObjects Button + # ## Adjust Objects Button self.cal_button = QtWidgets.QPushButton(_("Calibrate")) self.cal_button.setToolTip( _("Adjust (scale and/or skew) the objects\n" diff --git a/AppTools/ToolCopperThieving.py b/AppTools/ToolCopperThieving.py index a166866f..fa0ce728 100644 --- a/AppTools/ToolCopperThieving.py +++ b/AppTools/ToolCopperThieving.py @@ -8,7 +8,7 @@ from PyQt5 import QtWidgets, QtCore from Common import GracefulException as grace -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCDoubleSpinner, RadioSet, FCEntry, FCComboBox import shapely.geometry.base as base @@ -493,7 +493,7 @@ class ToolCopperThieving(AppTool): """) self.layout.addWidget(self.reset_button) - # AppObjects involved in Copper thieving + # Objects involved in Copper thieving self.grb_object = None self.ref_obj = None self.sel_rect = [] diff --git a/AppTools/ToolCorners.py b/AppTools/ToolCorners.py index e1d087ab..f8969cd2 100644 --- a/AppTools/ToolCorners.py +++ b/AppTools/ToolCorners.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, FCButton from shapely.geometry import MultiPolygon, LineString @@ -182,7 +182,7 @@ class ToolCorners(AppTool): """) self.layout.addWidget(self.reset_button) - # AppObjects involved in Copper thieving + # Objects involved in Copper thieving self.grb_object = None # store the flattened geometry here: diff --git a/AppTools/ToolCutOut.py b/AppTools/ToolCutOut.py index 196da2b6..25e11390 100644 --- a/AppTools/ToolCutOut.py +++ b/AppTools/ToolCutOut.py @@ -6,7 +6,7 @@ # ########################################################## from PyQt5 import QtWidgets, QtGui, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, OptionalInputSection, FCButton from shapely.geometry import box, MultiPolygon, Polygon, LineString, LinearRing diff --git a/AppTools/ToolDblSided.py b/AppTools/ToolDblSided.py index 1cf2f8ab..817c87d6 100644 --- a/AppTools/ToolDblSided.py +++ b/AppTools/ToolDblSided.py @@ -1,7 +1,7 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, EvalEntry, FCEntry, FCButton, FCComboBox from numpy import Inf @@ -48,9 +48,9 @@ class DblSidedTool(AppTool): grid_lay.setColumnStretch(1, 0) self.layout.addLayout(grid_lay) - # AppObjects to be mirrored + # Objects to be mirrored self.m_objects_label = QtWidgets.QLabel("%s:" % _("Mirror Operation")) - self.m_objects_label.setToolTip('%s.' % _("AppObjects to be mirrored")) + self.m_objects_label.setToolTip('%s.' % _("Objects to be mirrored")) grid_lay.addWidget(self.m_objects_label, 0, 0, 1, 2) @@ -154,7 +154,7 @@ class DblSidedTool(AppTool): grid_lay1.setColumnStretch(1, 1) self.layout.addLayout(grid_lay1) - # AppObjects to be mirrored + # Objects to be mirrored self.param_label = QtWidgets.QLabel("%s:" % _("Mirror Parameters")) self.param_label.setToolTip('%s.' % _("Parameters for the mirror operation")) diff --git a/AppTools/ToolDistance.py b/AppTools/ToolDistance.py index 6798ae8e..e20ebd36 100644 --- a/AppTools/ToolDistance.py +++ b/AppTools/ToolDistance.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.VisPyVisuals import * from AppGUI.GUIElements import FCEntry, FCButton, FCCheckBox diff --git a/AppTools/ToolDistanceMin.py b/AppTools/ToolDistanceMin.py index 87f56678..1ea67ea7 100644 --- a/AppTools/ToolDistanceMin.py +++ b/AppTools/ToolDistanceMin.py @@ -6,8 +6,7 @@ # ########################################################## from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.VisPyVisuals import * +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCEntry from shapely.ops import nearest_points @@ -291,7 +290,7 @@ class DistanceMin(AppTool): ) else: self.app.inform.emit('[WARNING_NOTCL] %s: %s' % - (_("AppObjects intersects or touch at"), + (_("Objects intersects or touch at"), "(%.*f, %.*f)" % (self.decimals, self.h_point[0], self.decimals, self.h_point[1]))) def on_jump_to_half_point(self): diff --git a/AppTools/ToolExtractDrills.py b/AppTools/ToolExtractDrills.py index 71e8fb41..2d3802cc 100644 --- a/AppTools/ToolExtractDrills.py +++ b/AppTools/ToolExtractDrills.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox from shapely.geometry import Point diff --git a/AppTools/ToolFiducials.py b/AppTools/ToolFiducials.py index b43e0944..6a482972 100644 --- a/AppTools/ToolFiducials.py +++ b/AppTools/ToolFiducials.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCDoubleSpinner, RadioSet, EvalEntry, FCTable, FCComboBox from shapely.geometry import Point, Polygon, MultiPolygon, LineString @@ -327,7 +327,7 @@ class ToolFiducials(AppTool): """) self.layout.addWidget(self.reset_button) - # AppObjects involved in Copper thieving + # Objects involved in Copper thieving self.grb_object = None self.sm_object = None diff --git a/AppTools/ToolFilm.py b/AppTools/ToolFilm.py index a4209ce3..81bf6779 100644 --- a/AppTools/ToolFilm.py +++ b/AppTools/ToolFilm.py @@ -5,9 +5,9 @@ # MIT Licence # # ########################################################## -from PyQt5 import QtGui, QtCore, QtWidgets +from PyQt5 import QtCore, QtWidgets -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, \ OptionalHideInputSection, OptionalInputSection, FCComboBox, FCFileSaveDialog diff --git a/AppTools/ToolImage.py b/AppTools/ToolImage.py index 5d520c78..68b3a7e7 100644 --- a/AppTools/ToolImage.py +++ b/AppTools/ToolImage.py @@ -7,7 +7,7 @@ from PyQt5 import QtGui, QtWidgets -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import RadioSet, FCComboBox, FCSpinner import gettext diff --git a/AppTools/ToolInvertGerber.py b/AppTools/ToolInvertGerber.py index 6acc013b..e6ea29d5 100644 --- a/AppTools/ToolInvertGerber.py +++ b/AppTools/ToolInvertGerber.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCButton, FCDoubleSpinner, RadioSet, FCComboBox from shapely.geometry import box diff --git a/AppTools/ToolMove.py b/AppTools/ToolMove.py index e02fed57..866555f9 100644 --- a/AppTools/ToolMove.py +++ b/AppTools/ToolMove.py @@ -6,7 +6,7 @@ # ########################################################## from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.VisPyVisuals import * from copy import copy diff --git a/AppTools/ToolNCC.py b/AppTools/ToolNCC.py index 0a637997..1f323ccb 100644 --- a/AppTools/ToolNCC.py +++ b/AppTools/ToolNCC.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore, QtGui -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCInputDialog, FCButton,\ FCComboBox, OptionalInputSection from AppParsers.ParseGerber import Gerber diff --git a/AppTools/ToolOptimal.py b/AppTools/ToolOptimal.py index 9ad822ae..cc2b6a3d 100644 --- a/AppTools/ToolOptimal.py +++ b/AppTools/ToolOptimal.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore, QtGui -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import OptionalHideInputSection, FCTextArea, FCEntry, FCSpinner, FCCheckBox, FCComboBox from Common import GracefulException as grace diff --git a/AppTools/ToolPDF.py b/AppTools/ToolPDF.py index 2e3cace3..2f105d57 100644 --- a/AppTools/ToolPDF.py +++ b/AppTools/ToolPDF.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from Common import GracefulException as grace from AppParsers.ParsePDF import PdfParser from shapely.geometry import Point, MultiPolygon diff --git a/AppTools/ToolPaint.py b/AppTools/ToolPaint.py index bfa4891b..7b605e8a 100644 --- a/AppTools/ToolPaint.py +++ b/AppTools/ToolPaint.py @@ -8,7 +8,7 @@ from PyQt5 import QtWidgets, QtGui, QtCore from PyQt5.QtCore import Qt -from AppTool import AppTool +from AppTools.AppTool import AppTool from copy import deepcopy # from ObjectCollection import * from AppParsers.ParseGerber import Gerber diff --git a/AppTools/ToolPanelize.py b/AppTools/ToolPanelize.py index 3d774c97..7d96a4dd 100644 --- a/AppTools/ToolPanelize.py +++ b/AppTools/ToolPanelize.py @@ -6,7 +6,7 @@ # ########################################################## from PyQt5 import QtWidgets, QtGui, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCCheckBox, OptionalInputSection, FCComboBox from Common import GracefulException as grace diff --git a/AppTools/ToolPcbWizard.py b/AppTools/ToolPcbWizard.py index a9fc6075..29b17898 100644 --- a/AppTools/ToolPcbWizard.py +++ b/AppTools/ToolPcbWizard.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import RadioSet, FCSpinner, FCButton, FCTable import re diff --git a/AppTools/ToolProperties.py b/AppTools/ToolProperties.py index 59d73a8c..d9268fe1 100644 --- a/AppTools/ToolProperties.py +++ b/AppTools/ToolProperties.py @@ -6,7 +6,7 @@ # ########################################################## from PyQt5 import QtGui, QtCore, QtWidgets -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCTree from shapely.geometry import MultiPolygon, Polygon diff --git a/AppTools/ToolPunchGerber.py b/AppTools/ToolPunchGerber.py index 28d42ef4..4bb80d39 100644 --- a/AppTools/ToolPunchGerber.py +++ b/AppTools/ToolPunchGerber.py @@ -7,7 +7,7 @@ from PyQt5 import QtCore, QtWidgets -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox from copy import deepcopy diff --git a/AppTools/ToolQRCode.py b/AppTools/ToolQRCode.py index 1462f205..b2b77db4 100644 --- a/AppTools/ToolQRCode.py +++ b/AppTools/ToolQRCode.py @@ -8,7 +8,7 @@ from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import Qt -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import RadioSet, FCTextArea, FCSpinner, FCEntry, FCCheckBox, FCComboBox, FCFileSaveDialog from AppParsers.ParseSVG import * diff --git a/AppTools/ToolRulesCheck.py b/AppTools/ToolRulesCheck.py index 7864964a..a738cf42 100644 --- a/AppTools/ToolRulesCheck.py +++ b/AppTools/ToolRulesCheck.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, OptionalInputSection, FCComboBox from copy import deepcopy @@ -196,7 +196,7 @@ class RulesCheck(AppTool): self.grid_layout.addWidget(QtWidgets.QLabel(""), 8, 0, 1, 3) - self.excellon_title_lbl = QtWidgets.QLabel('%s:' % _("Excellon AppObjects")) + self.excellon_title_lbl = QtWidgets.QLabel('%s:' % _("Excellon Objects")) self.excellon_title_lbl.setToolTip( _("Excellon objects for which to check rules.") ) diff --git a/AppTools/ToolSolderPaste.py b/AppTools/ToolSolderPaste.py index cd9fbc08..e168f208 100644 --- a/AppTools/ToolSolderPaste.py +++ b/AppTools/ToolSolderPaste.py @@ -5,11 +5,11 @@ # MIT Licence # # ########################################################## -from AppTool import AppTool +from AppTools.AppTool import AppTool from Common import LoudDict from AppGUI.GUIElements import FCComboBox, FCEntry, FCTable, \ FCInputDialog, FCDoubleSpinner, FCSpinner, FCFileSaveDialog -from AppMain import log +from App import log from camlib import distance from AppEditors.FlatCAMTextEditor import TextEditor diff --git a/AppTools/ToolSub.py b/AppTools/ToolSub.py index b80bea1c..85f0e81f 100644 --- a/AppTools/ToolSub.py +++ b/AppTools/ToolSub.py @@ -7,7 +7,7 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCCheckBox, FCButton, FCComboBox from shapely.geometry import Polygon, MultiPolygon, MultiLineString, LineString @@ -62,7 +62,7 @@ class ToolSub(AppTool): form_layout = QtWidgets.QFormLayout() self.tools_box.addLayout(form_layout) - self.gerber_title = QtWidgets.QLabel("%s" % _("Gerber AppObjects")) + self.gerber_title = QtWidgets.QLabel("%s" % _("Gerber Objects")) form_layout.addRow(self.gerber_title) # Target Gerber Object @@ -117,7 +117,7 @@ class ToolSub(AppTool): form_geo_layout = QtWidgets.QFormLayout() self.tools_box.addLayout(form_geo_layout) - self.geo_title = QtWidgets.QLabel("%s" % _("Geometry AppObjects")) + self.geo_title = QtWidgets.QLabel("%s" % _("Geometry Objects")) form_geo_layout.addRow(self.geo_title) # Target Geometry Object diff --git a/AppTools/ToolTransform.py b/AppTools/ToolTransform.py index 41e6ff91..7167740d 100644 --- a/AppTools/ToolTransform.py +++ b/AppTools/ToolTransform.py @@ -6,7 +6,7 @@ # ########################################################## from PyQt5 import QtWidgets -from AppTool import AppTool +from AppTools.AppTool import AppTool from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCButton, OptionalInputSection, FCEntry import gettext diff --git a/CHANGELOG.md b/CHANGELOG.md index 75255b79..d7ff7570 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ CHANGELOG for FlatCAM beta - more refactoring class names - moved some of the methods from the App class to the ObjectCollection class - moved all the new_object related methods in their own class AppObjects.AppObject +- more refactoring; solved some issues introduced by the refactoring 17.05.2020 diff --git a/Common.py b/Common.py index efdd3252..85442b80 100644 --- a/Common.py +++ b/Common.py @@ -15,7 +15,7 @@ from PyQt5 import QtCore from shapely.geometry import Polygon, MultiPolygon from AppGUI.VisPyVisuals import ShapeCollection -from AppTool import AppTool +from AppTools.AppTool import AppTool import numpy as np diff --git a/FlatCAM.py b/FlatCAM.py index 0bb79f1f..1a309537 100644 --- a/FlatCAM.py +++ b/FlatCAM.py @@ -3,7 +3,7 @@ import os from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings, Qt -from AppMain import App +from App import App from AppGUI import VisPyPatches from multiprocessing import freeze_support diff --git a/camlib.py b/camlib.py index c3863ca2..e2bebc80 100644 --- a/camlib.py +++ b/camlib.py @@ -6418,7 +6418,7 @@ def distance_euclidian(x1, y1, x2, y2): class FlatCAMRTree(object): """ Indexes geometry (Any object with "cooords" property containing - a list of tuples with x, y values). AppObjects are indexed by + a list of tuples with x, y values). Objects are indexed by all their points by default. To index by arbitrary points, override self.points2obj. """ diff --git a/defaults.py b/defaults.py index 6e8acfac..e2db25b4 100644 --- a/defaults.py +++ b/defaults.py @@ -636,7 +636,7 @@ class FlatCAMDefaults: "tools_punch_rectangular": False, "tools_punch_others": False, - # Align AppObjects Tool + # Align Objects Tool "tools_align_objects_align_type": 'sp', # Invert Gerber Tool diff --git a/tclCommands/TclCommand.py b/tclCommands/TclCommand.py index 5c008671..d89eb0c4 100644 --- a/tclCommands/TclCommand.py +++ b/tclCommands/TclCommand.py @@ -1,6 +1,6 @@ import sys import re -import AppMain +import App import abc import collections from PyQt5 import QtCore @@ -53,7 +53,7 @@ class TclCommand(object): if self.app is None: raise TypeError('Expected app to be FlatCAMApp instance.') - if not isinstance(self.app, AppMain.App): + if not isinstance(self.app, App.App): raise TypeError('Expected FlatCAMApp, got %s.' % type(app)) self.log = self.app.log