From 2eecb20e950808f4474d2a5174a6d733381f9dba Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Wed, 3 Jun 2020 20:35:59 +0300 Subject: [PATCH] - remade file names in the app - fixed the issue with factory_defaults being saved every time the app start - fixed the preferences not being saved to a file when the Save button is pressed in Edit -> Preferences - fixed and updated the Transform Tools in the Editors --- AppTools/__init__.py | 45 - Bookmark.py | 4 +- CHANGELOG.md | 4 + Common.py | 8 +- FlatCAM.py | 4 +- AppDatabase.py => appDatabase.py | 8 +- .../FlatCAMExcEditor.py | 16 +- .../FlatCAMGeoEditor.py | 1421 ++++++++--------- .../FlatCAMGrbEditor.py | 1292 ++++++++------- .../FlatCAMTextEditor.py | 4 +- {AppEditors => appEditors}/__init__.py | 0 {AppGUI => appGUI}/ColumnarFlowLayout.py | 0 {AppGUI => appGUI}/GUIElements.py | 2 +- {AppGUI => appGUI}/MainGUI.py | 30 +- {AppGUI => appGUI}/ObjectUI.py | 4 +- {AppGUI => appGUI}/PlotCanvas.py | 6 +- {AppGUI => appGUI}/PlotCanvasLegacy.py | 2 +- {AppGUI => appGUI}/VisPyCanvas.py | 0 .../VisPyData/data/fonts/opensans-regular.ttf | Bin .../VisPyData/data/freetype/freetype253.dll | Bin .../data/freetype/freetype253_x64.dll | Bin {AppGUI => appGUI}/VisPyPatches.py | 0 {AppGUI => appGUI}/VisPyTesselators.py | 0 {AppGUI => appGUI}/VisPyVisuals.py | 2 +- {AppGUI => appGUI}/__init__.py | 0 {AppGUI => appGUI}/preferences/OptionUI.py | 4 +- .../preferences/OptionsGroupUI.py | 4 +- .../preferences/PreferencesSectionUI.py | 6 +- .../preferences/PreferencesUIManager.py | 31 +- {AppGUI => appGUI}/preferences/__init__.py | 4 +- .../cncjob/CNCJobAdvOptPrefGroupUI.py | 6 +- .../cncjob/CNCJobGenPrefGroupUI.py | 6 +- .../cncjob/CNCJobOptPrefGroupUI.py | 6 +- .../preferences/cncjob/CNCJobPreferencesUI.py | 6 +- .../preferences/cncjob/__init__.py | 0 .../excellon/ExcellonAdvOptPrefGroupUI.py | 6 +- .../excellon/ExcellonEditorPrefGroupUI.py | 6 +- .../excellon/ExcellonExpPrefGroupUI.py | 6 +- .../excellon/ExcellonGenPrefGroupUI.py | 6 +- .../excellon/ExcellonOptPrefGroupUI.py | 8 +- .../excellon/ExcellonPreferencesUI.py | 12 +- .../preferences/excellon/__init__.py | 0 .../general/GeneralAPPSetGroupUI.py | 12 +- .../general/GeneralAppPrefGroupUI.py | 6 +- .../general/GeneralAppSettingsGroupUI.py | 10 +- .../general/GeneralGUIPrefGroupUI.py | 6 +- .../general/GeneralPreferencesUI.py | 8 +- .../preferences/general/__init__.py | 0 .../geometry/GeometryAdvOptPrefGroupUI.py | 6 +- .../geometry/GeometryEditorPrefGroupUI.py | 6 +- .../geometry/GeometryGenPrefGroupUI.py | 6 +- .../geometry/GeometryOptPrefGroupUI.py | 8 +- .../geometry/GeometryPreferencesUI.py | 10 +- .../preferences/geometry/__init__.py | 0 .../gerber/GerberAdvOptPrefGroupUI.py | 6 +- .../gerber/GerberEditorPrefGroupUI.py | 6 +- .../gerber/GerberExpPrefGroupUI.py | 6 +- .../gerber/GerberGenPrefGroupUI.py | 6 +- .../gerber/GerberOptPrefGroupUI.py | 6 +- .../preferences/gerber/GerberPreferencesUI.py | 12 +- .../preferences/gerber/__init__.py | 0 .../tools/Tools2CThievingPrefGroupUI.py | 6 +- .../preferences/tools/Tools2CalPrefGroupUI.py | 6 +- .../tools/Tools2EDrillsPrefGroupUI.py | 6 +- .../tools/Tools2FiducialsPrefGroupUI.py | 6 +- .../tools/Tools2InvertPrefGroupUI.py | 6 +- .../tools/Tools2OptimalPrefGroupUI.py | 6 +- .../preferences/tools/Tools2PreferencesUI.py | 20 +- .../tools/Tools2PunchGerberPrefGroupUI.py | 6 +- .../tools/Tools2QRCodePrefGroupUI.py | 6 +- .../tools/Tools2RulesCheckPrefGroupUI.py | 6 +- .../tools/Tools2sidedPrefGroupUI.py | 6 +- .../tools/ToolsCalculatorsPrefGroupUI.py | 6 +- .../tools/ToolsCornersPrefGroupUI.py | 6 +- .../tools/ToolsCutoutPrefGroupUI.py | 8 +- .../preferences/tools/ToolsFilmPrefGroupUI.py | 6 +- .../preferences/tools/ToolsISOPrefGroupUI.py | 6 +- .../preferences/tools/ToolsNCCPrefGroupUI.py | 6 +- .../tools/ToolsPaintPrefGroupUI.py | 6 +- .../tools/ToolsPanelizePrefGroupUI.py | 6 +- .../preferences/tools/ToolsPreferencesUI.py | 26 +- .../tools/ToolsSolderpastePrefGroupUI.py | 6 +- .../preferences/tools/ToolsSubPrefGroupUI.py | 6 +- .../tools/ToolsTransformPrefGroupUI.py | 6 +- .../preferences/tools/__init__.py | 0 .../utilities/AutoCompletePrefGroupUI.py | 6 +- .../preferences/utilities/FAExcPrefGroupUI.py | 6 +- .../preferences/utilities/FAGcoPrefGroupUI.py | 6 +- .../preferences/utilities/FAGrbPrefGroupUI.py | 6 +- .../utilities/UtilPreferencesUI.py | 8 +- .../preferences/utilities/__init__.py | 0 {AppObjects => appObjects}/AppObject.py | 16 +- {AppObjects => appObjects}/FlatCAMCNCJob.py | 6 +- {AppObjects => appObjects}/FlatCAMDocument.py | 6 +- {AppObjects => appObjects}/FlatCAMExcellon.py | 8 +- {AppObjects => appObjects}/FlatCAMGeometry.py | 12 +- {AppObjects => appObjects}/FlatCAMGerber.py | 6 +- {AppObjects => appObjects}/FlatCAMObj.py | 8 +- {AppObjects => appObjects}/FlatCAMScript.py | 8 +- .../ObjectCollection.py | 18 +- {AppObjects => appObjects}/__init__.py | 0 {AppParsers => appParsers}/ParseDXF.py | 4 +- {AppParsers => appParsers}/ParseDXF_Spline.py | 0 {AppParsers => appParsers}/ParseExcellon.py | 24 +- {AppParsers => appParsers}/ParseFont.py | 2 +- {AppParsers => appParsers}/ParseGerber.py | 8 +- {AppParsers => appParsers}/ParseHPGL2.py | 0 {AppParsers => appParsers}/ParsePDF.py | 0 {AppParsers => appParsers}/ParseSVG.py | 2 +- {AppParsers => appParsers}/__init__.py | 0 AppPool.py => appPool.py | 0 AppPreProcessor.py => appPreProcessor.py | 0 AppProcess.py => appProcess.py | 4 +- AppTool.py => appTool.py | 8 +- {AppTools => appTools}/ToolAlignObjects.py | 6 +- {AppTools => appTools}/ToolCalculators.py | 6 +- {AppTools => appTools}/ToolCalibration.py | 10 +- {AppTools => appTools}/ToolCopperThieving.py | 6 +- {AppTools => appTools}/ToolCorners.py | 6 +- {AppTools => appTools}/ToolCutOut.py | 6 +- {AppTools => appTools}/ToolDblSided.py | 6 +- {AppTools => appTools}/ToolDistance.py | 16 +- {AppTools => appTools}/ToolDistanceMin.py | 10 +- .../ToolEtchCompensation.py | 8 +- {AppTools => appTools}/ToolExtractDrills.py | 6 +- {AppTools => appTools}/ToolFiducials.py | 6 +- {AppTools => appTools}/ToolFilm.py | 6 +- {AppTools => appTools}/ToolImage.py | 6 +- {AppTools => appTools}/ToolInvertGerber.py | 6 +- {AppTools => appTools}/ToolIsolation.py | 8 +- {AppTools => appTools}/ToolMove.py | 8 +- {AppTools => appTools}/ToolNCC.py | 8 +- {AppTools => appTools}/ToolOptimal.py | 6 +- {AppTools => appTools}/ToolPDF.py | 8 +- {AppTools => appTools}/ToolPaint.py | 8 +- {AppTools => appTools}/ToolPanelize.py | 6 +- {AppTools => appTools}/ToolPcbWizard.py | 6 +- {AppTools => appTools}/ToolProperties.py | 6 +- {AppTools => appTools}/ToolPunchGerber.py | 6 +- {AppTools => appTools}/ToolQRCode.py | 8 +- {AppTools => appTools}/ToolRulesCheck.py | 8 +- {AppTools => appTools}/ToolShell.py | 4 +- {AppTools => appTools}/ToolSolderPaste.py | 10 +- {AppTools => appTools}/ToolSub.py | 6 +- {AppTools => appTools}/ToolTransform.py | 16 +- appTools/__init__.py | 45 + AppTranslation.py => appTranslation.py | 0 AppWorker.py => appWorker.py | 0 AppWorkerStack.py => appWorkerStack.py | 2 +- App_Main.py => app_Main.py | 105 +- camlib.py | 14 +- defaults.py | 13 +- make_freezed.py | 2 +- preprocessors/Berta_CNC.py | 4 +- preprocessors/GRBL_laser.py | 2 +- preprocessors/ISEL_CNC.py | 2 +- preprocessors/ISEL_ICP_CNC.py | 2 +- preprocessors/Marlin.py | 2 +- preprocessors/Marlin_laser_FAN_pin.py | 2 +- preprocessors/Marlin_laser_Spindle_pin.py | 2 +- preprocessors/Paste_1.py | 2 +- preprocessors/Repetier.py | 2 +- preprocessors/Roland_MDX_20.py | 2 +- preprocessors/Toolchange_Custom.py | 2 +- preprocessors/Toolchange_Manual.py | 2 +- preprocessors/Toolchange_Probe_MACH3.py | 2 +- preprocessors/default.py | 2 +- preprocessors/grbl_11.py | 2 +- preprocessors/hpgl.py | 2 +- preprocessors/line_xyz.py | 2 +- tclCommands/TclCommand.py | 4 +- tclCommands/TclCommandBbox.py | 2 +- tclCommands/TclCommandBounds.py | 2 +- tclCommands/TclCommandCopperClear.py | 2 +- tclCommands/TclCommandDrillcncjob.py | 2 +- tclCommands/TclCommandGeoCutout.py | 2 +- tclCommands/TclCommandGetNames.py | 2 +- tclCommands/TclCommandGetPath.py | 2 +- tclCommands/TclCommandHelp.py | 2 +- tclCommands/TclCommandJoinExcellon.py | 2 +- tclCommands/TclCommandJoinGeometry.py | 2 +- tclCommands/TclCommandNregions.py | 2 +- tclCommands/TclCommandPaint.py | 2 +- tclCommands/TclCommandPlotAll.py | 4 +- tclCommands/TclCommandPlotObjects.py | 4 +- tclCommands/TclCommandScale.py | 2 +- tclCommands/TclCommandSetActive.py | 2 +- tclCommands/TclCommandSetOrigin.py | 2 +- tclCommands/TclCommandSetPath.py | 2 +- tclCommands/TclCommandSubtractRectangle.py | 2 +- 190 files changed, 1940 insertions(+), 1990 deletions(-) delete mode 100644 AppTools/__init__.py rename AppDatabase.py => appDatabase.py (99%) rename {AppEditors => appEditors}/FlatCAMExcEditor.py (99%) rename {AppEditors => appEditors}/FlatCAMGeoEditor.py (84%) rename {AppEditors => appEditors}/FlatCAMGrbEditor.py (89%) rename {AppEditors => appEditors}/FlatCAMTextEditor.py (99%) rename {AppEditors => appEditors}/__init__.py (100%) rename {AppGUI => appGUI}/ColumnarFlowLayout.py (100%) rename {AppGUI => appGUI}/GUIElements.py (99%) rename {AppGUI => appGUI}/MainGUI.py (99%) rename {AppGUI => appGUI}/ObjectUI.py (99%) rename {AppGUI => appGUI}/PlotCanvas.py (99%) rename {AppGUI => appGUI}/PlotCanvasLegacy.py (99%) rename {AppGUI => appGUI}/VisPyCanvas.py (100%) rename {AppGUI => appGUI}/VisPyData/data/fonts/opensans-regular.ttf (100%) rename {AppGUI => appGUI}/VisPyData/data/freetype/freetype253.dll (100%) rename {AppGUI => appGUI}/VisPyData/data/freetype/freetype253_x64.dll (100%) rename {AppGUI => appGUI}/VisPyPatches.py (100%) rename {AppGUI => appGUI}/VisPyTesselators.py (100%) rename {AppGUI => appGUI}/VisPyVisuals.py (99%) rename {AppGUI => appGUI}/__init__.py (100%) rename {AppGUI => appGUI}/preferences/OptionUI.py (99%) rename {AppGUI => appGUI}/preferences/OptionsGroupUI.py (95%) rename {AppGUI => appGUI}/preferences/PreferencesSectionUI.py (86%) rename {AppGUI => appGUI}/preferences/PreferencesUIManager.py (98%) rename {AppGUI => appGUI}/preferences/__init__.py (81%) rename {AppGUI => appGUI}/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py (97%) rename {AppGUI => appGUI}/preferences/cncjob/CNCJobGenPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/cncjob/CNCJobOptPrefGroupUI.py (94%) rename {AppGUI => appGUI}/preferences/cncjob/CNCJobPreferencesUI.py (83%) rename {AppGUI => appGUI}/preferences/cncjob/__init__.py (100%) rename {AppGUI => appGUI}/preferences/excellon/ExcellonAdvOptPrefGroupUI.py (97%) rename {AppGUI => appGUI}/preferences/excellon/ExcellonEditorPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/excellon/ExcellonExpPrefGroupUI.py (97%) rename {AppGUI => appGUI}/preferences/excellon/ExcellonGenPrefGroupUI.py (99%) rename {AppGUI => appGUI}/preferences/excellon/ExcellonOptPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/excellon/ExcellonPreferencesUI.py (83%) rename {AppGUI => appGUI}/preferences/excellon/__init__.py (100%) rename {AppGUI => appGUI}/preferences/general/GeneralAPPSetGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/general/GeneralAppPrefGroupUI.py (99%) rename {AppGUI => appGUI}/preferences/general/GeneralAppSettingsGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/general/GeneralGUIPrefGroupUI.py (99%) rename {AppGUI => appGUI}/preferences/general/GeneralPreferencesUI.py (84%) rename {AppGUI => appGUI}/preferences/general/__init__.py (100%) rename {AppGUI => appGUI}/preferences/geometry/GeometryAdvOptPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/geometry/GeometryEditorPrefGroupUI.py (94%) rename {AppGUI => appGUI}/preferences/geometry/GeometryGenPrefGroupUI.py (95%) rename {AppGUI => appGUI}/preferences/geometry/GeometryOptPrefGroupUI.py (97%) rename {AppGUI => appGUI}/preferences/geometry/GeometryPreferencesUI.py (84%) rename {AppGUI => appGUI}/preferences/geometry/__init__.py (100%) rename {AppGUI => appGUI}/preferences/gerber/GerberAdvOptPrefGroupUI.py (95%) rename {AppGUI => appGUI}/preferences/gerber/GerberEditorPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/gerber/GerberExpPrefGroupUI.py (96%) rename {AppGUI => appGUI}/preferences/gerber/GerberGenPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/gerber/GerberOptPrefGroupUI.py (95%) rename {AppGUI => appGUI}/preferences/gerber/GerberPreferencesUI.py (83%) rename {AppGUI => appGUI}/preferences/gerber/__init__.py (100%) rename {AppGUI => appGUI}/preferences/tools/Tools2CThievingPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/tools/Tools2CalPrefGroupUI.py (96%) rename {AppGUI => appGUI}/preferences/tools/Tools2EDrillsPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/tools/Tools2FiducialsPrefGroupUI.py (97%) rename {AppGUI => appGUI}/preferences/tools/Tools2InvertPrefGroupUI.py (94%) rename {AppGUI => appGUI}/preferences/tools/Tools2OptimalPrefGroupUI.py (91%) rename {AppGUI => appGUI}/preferences/tools/Tools2PreferencesUI.py (83%) rename {AppGUI => appGUI}/preferences/tools/Tools2PunchGerberPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/tools/Tools2QRCodePrefGroupUI.py (97%) rename {AppGUI => appGUI}/preferences/tools/Tools2RulesCheckPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/tools/Tools2sidedPrefGroupUI.py (95%) rename {AppGUI => appGUI}/preferences/tools/ToolsCalculatorsPrefGroupUI.py (97%) rename {AppGUI => appGUI}/preferences/tools/ToolsCornersPrefGroupUI.py (94%) rename {AppGUI => appGUI}/preferences/tools/ToolsCutoutPrefGroupUI.py (96%) rename {AppGUI => appGUI}/preferences/tools/ToolsFilmPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/tools/ToolsISOPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/tools/ToolsNCCPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/tools/ToolsPaintPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/tools/ToolsPanelizePrefGroupUI.py (97%) rename {AppGUI => appGUI}/preferences/tools/ToolsPreferencesUI.py (81%) rename {AppGUI => appGUI}/preferences/tools/ToolsSolderpastePrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/tools/ToolsSubPrefGroupUI.py (89%) rename {AppGUI => appGUI}/preferences/tools/ToolsTransformPrefGroupUI.py (98%) rename {AppGUI => appGUI}/preferences/tools/__init__.py (100%) rename {AppGUI => appGUI}/preferences/utilities/AutoCompletePrefGroupUI.py (94%) rename {AppGUI => appGUI}/preferences/utilities/FAExcPrefGroupUI.py (95%) rename {AppGUI => appGUI}/preferences/utilities/FAGcoPrefGroupUI.py (95%) rename {AppGUI => appGUI}/preferences/utilities/FAGrbPrefGroupUI.py (95%) rename {AppGUI => appGUI}/preferences/utilities/UtilPreferencesUI.py (81%) rename {AppGUI => appGUI}/preferences/utilities/__init__.py (100%) rename {AppObjects => appObjects}/AppObject.py (97%) rename {AppObjects => appObjects}/FlatCAMCNCJob.py (99%) rename {AppObjects => appObjects}/FlatCAMDocument.py (99%) rename {AppObjects => appObjects}/FlatCAMExcellon.py (99%) rename {AppObjects => appObjects}/FlatCAMGeometry.py (99%) rename {AppObjects => appObjects}/FlatCAMGerber.py (99%) rename {AppObjects => appObjects}/FlatCAMObj.py (98%) rename {AppObjects => appObjects}/FlatCAMScript.py (98%) rename {AppObjects => appObjects}/ObjectCollection.py (98%) rename {AppObjects => appObjects}/__init__.py (100%) rename {AppParsers => appParsers}/ParseDXF.py (99%) rename {AppParsers => appParsers}/ParseDXF_Spline.py (100%) rename {AppParsers => appParsers}/ParseExcellon.py (98%) rename {AppParsers => appParsers}/ParseFont.py (99%) rename {AppParsers => appParsers}/ParseGerber.py (99%) rename {AppParsers => appParsers}/ParseHPGL2.py (100%) rename {AppParsers => appParsers}/ParsePDF.py (100%) rename {AppParsers => appParsers}/ParseSVG.py (99%) rename {AppParsers => appParsers}/__init__.py (100%) rename AppPool.py => appPool.py (100%) rename AppPreProcessor.py => appPreProcessor.py (100%) rename AppProcess.py => appProcess.py (98%) rename AppTool.py => appTool.py (98%) rename {AppTools => appTools}/ToolAlignObjects.py (99%) rename {AppTools => appTools}/ToolCalculators.py (99%) rename {AppTools => appTools}/ToolCalibration.py (99%) rename {AppTools => appTools}/ToolCopperThieving.py (99%) rename {AppTools => appTools}/ToolCorners.py (99%) rename {AppTools => appTools}/ToolCutOut.py (99%) rename {AppTools => appTools}/ToolDblSided.py (99%) rename {AppTools => appTools}/ToolDistance.py (98%) rename {AppTools => appTools}/ToolDistanceMin.py (98%) rename {AppTools => appTools}/ToolEtchCompensation.py (99%) rename {AppTools => appTools}/ToolExtractDrills.py (99%) rename {AppTools => appTools}/ToolFiducials.py (99%) rename {AppTools => appTools}/ToolFilm.py (99%) rename {AppTools => appTools}/ToolImage.py (98%) rename {AppTools => appTools}/ToolInvertGerber.py (98%) rename {AppTools => appTools}/ToolIsolation.py (99%) rename {AppTools => appTools}/ToolMove.py (98%) rename {AppTools => appTools}/ToolNCC.py (99%) rename {AppTools => appTools}/ToolOptimal.py (99%) rename {AppTools => appTools}/ToolPDF.py (99%) rename {AppTools => appTools}/ToolPaint.py (99%) rename {AppTools => appTools}/ToolPanelize.py (99%) rename {AppTools => appTools}/ToolPcbWizard.py (99%) rename {AppTools => appTools}/ToolProperties.py (99%) rename {AppTools => appTools}/ToolPunchGerber.py (99%) rename {AppTools => appTools}/ToolQRCode.py (99%) rename {AppTools => appTools}/ToolRulesCheck.py (99%) rename {AppTools => appTools}/ToolShell.py (99%) rename {AppTools => appTools}/ToolSolderPaste.py (99%) rename {AppTools => appTools}/ToolSub.py (99%) rename {AppTools => appTools}/ToolTransform.py (98%) create mode 100644 appTools/__init__.py rename AppTranslation.py => appTranslation.py (100%) rename AppWorker.py => appWorker.py (100%) rename AppWorkerStack.py => appWorkerStack.py (98%) rename App_Main.py => app_Main.py (99%) diff --git a/AppTools/__init__.py b/AppTools/__init__.py deleted file mode 100644 index e2699a42..00000000 --- a/AppTools/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ - -from AppTools.ToolCalculators import ToolCalculator -from AppTools.ToolCalibration import ToolCalibration - -from AppTools.ToolDblSided import DblSidedTool -from AppTools.ToolExtractDrills import ToolExtractDrills -from AppTools.ToolAlignObjects import AlignObjects - -from AppTools.ToolFilm import Film - -from AppTools.ToolImage import ToolImage - -from AppTools.ToolDistance import Distance -from AppTools.ToolDistanceMin import DistanceMin - -from AppTools.ToolMove import ToolMove - -from AppTools.ToolCutOut import CutOut -from AppTools.ToolNCC import NonCopperClear -from AppTools.ToolPaint import ToolPaint -from AppTools.ToolIsolation import ToolIsolation - -from AppTools.ToolOptimal import ToolOptimal - -from AppTools.ToolPanelize import Panelize -from AppTools.ToolPcbWizard import PcbWizard -from AppTools.ToolPDF import ToolPDF -from AppTools.ToolProperties import Properties - -from AppTools.ToolQRCode import QRCode -from AppTools.ToolRulesCheck import RulesCheck - -from AppTools.ToolCopperThieving import ToolCopperThieving -from AppTools.ToolFiducials import ToolFiducials - -from AppTools.ToolShell import FCShell -from AppTools.ToolSolderPaste import SolderPaste -from AppTools.ToolSub import ToolSub - -from AppTools.ToolTransform import ToolTransform -from AppTools.ToolPunchGerber import ToolPunchGerber - -from AppTools.ToolInvertGerber import ToolInvertGerber -from AppTools.ToolCorners import ToolCorners -from AppTools.ToolEtchCompensation import ToolEtchCompensation \ No newline at end of file diff --git a/Bookmark.py b/Bookmark.py index e9234322..c0c7a839 100644 --- a/Bookmark.py +++ b/Bookmark.py @@ -1,5 +1,5 @@ from PyQt5 import QtGui, QtCore, QtWidgets -from AppGUI.GUIElements import FCTable, FCEntry, FCButton, FCFileSaveDialog +from appGUI.GUIElements import FCTable, FCEntry, FCButton, FCFileSaveDialog import sys import webbrowser @@ -7,7 +7,7 @@ import webbrowser from copy import deepcopy from datetime import datetime import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/CHANGELOG.md b/CHANGELOG.md index 687ac30d..be1a2bd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ CHANGELOG for FlatCAM beta - added a new feature for Gerber parsing: if the NO buffering is chosen in the Gerber Advanced Preferences there is now a checkbox to activate delayed buffering which will do the buffering in background allowing the user to work in between. I hope that this can be useful in case of large Gerber files. - made the delayed Gerber buffering to use multiprocessing but I see not much performance increase - made sure that the status bar label for preferences is updated also when the Preferences Tab is opened from the Edit -> Preferences +- remade file names in the app +- fixed the issue with factory_defaults being saved every time the app start +- fixed the preferences not being saved to a file when the Save button is pressed in Edit -> Preferences +- fixed and updated the Transform Tools in the Editors 2.06.2020 diff --git a/Common.py b/Common.py index 90050a33..aeaf4ba5 100644 --- a/Common.py +++ b/Common.py @@ -15,15 +15,15 @@ from PyQt5 import QtCore from shapely.geometry import Polygon, Point, LineString from shapely.ops import unary_union -from AppGUI.VisPyVisuals import ShapeCollection -from AppTool import AppTool +from appGUI.VisPyVisuals import ShapeCollection +from appTool import AppTool from copy import deepcopy import numpy as np import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -156,7 +156,7 @@ class ExclusionAreas(QtCore.QObject): except AttributeError: self.exclusion_shapes = None else: - from AppGUI.PlotCanvasLegacy import ShapeCollectionLegacy + from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy self.exclusion_shapes = ShapeCollectionLegacy(obj=self, app=self.app, name="exclusion") # Event signals disconnect id holders diff --git a/FlatCAM.py b/FlatCAM.py index 17b56c29..0b2d0b88 100644 --- a/FlatCAM.py +++ b/FlatCAM.py @@ -3,8 +3,8 @@ import os from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings, Qt -from App_Main import App -from AppGUI import VisPyPatches +from app_Main import App +from appGUI import VisPyPatches from multiprocessing import freeze_support # import copyreg diff --git a/AppDatabase.py b/appDatabase.py similarity index 99% rename from AppDatabase.py rename to appDatabase.py index b6836b0f..01dba6e2 100644 --- a/AppDatabase.py +++ b/appDatabase.py @@ -1,5 +1,5 @@ from PyQt5 import QtGui, QtCore, QtWidgets -from AppGUI.GUIElements import FCTable, FCEntry, FCButton, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, \ +from appGUI.GUIElements import FCTable, FCEntry, FCButton, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, \ FCTree, RadioSet, FCFileSaveDialog from camlib import to_dict @@ -11,7 +11,7 @@ from datetime import datetime import math import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -2074,7 +2074,7 @@ class ToolsDB2(QtWidgets.QWidget): if self.db_tool_dict: self.storage_to_form(self.db_tool_dict['1']) - # Enable AppGUI + # Enable appGUI self.basic_box.setEnabled(True) self.advanced_box.setEnabled(True) self.ncc_box.setEnabled(True) @@ -2085,7 +2085,7 @@ class ToolsDB2(QtWidgets.QWidget): # self.tree_widget.setFocus() else: - # Disable AppGUI + # Disable appGUI self.basic_box.setEnabled(False) self.advanced_box.setEnabled(False) self.ncc_box.setEnabled(False) diff --git a/AppEditors/FlatCAMExcEditor.py b/appEditors/FlatCAMExcEditor.py similarity index 99% rename from AppEditors/FlatCAMExcEditor.py rename to appEditors/FlatCAMExcEditor.py index c5d56218..ca253072 100644 --- a/AppEditors/FlatCAMExcEditor.py +++ b/appEditors/FlatCAMExcEditor.py @@ -9,9 +9,9 @@ from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5.QtCore import Qt, QSettings from camlib import distance, arc, FlatCAMRTreeStorage -from AppGUI.GUIElements import FCEntry, FCComboBox, FCTable, FCDoubleSpinner, RadioSet, FCSpinner -from AppEditors.FlatCAMGeoEditor import FCShapeTool, DrawTool, DrawToolShape, DrawToolUtilityShape, FlatCAMGeoEditor -from AppParsers.ParseExcellon import Excellon +from appGUI.GUIElements import FCEntry, FCComboBox, FCTable, FCDoubleSpinner, RadioSet, FCSpinner +from appEditors.FlatCAMGeoEditor import FCShapeTool, DrawTool, DrawToolShape, DrawToolUtilityShape, FlatCAMGeoEditor +from appParsers.ParseExcellon import Excellon from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon, Point import shapely.affinity as affinity @@ -26,7 +26,7 @@ import logging from copy import deepcopy import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -2123,7 +2123,7 @@ class FlatCAMExcEditor(QtCore.QObject): else: self.tool_shape = self.app.plotcanvas.new_shape_collection(layers=1) else: - from AppGUI.PlotCanvasLegacy import ShapeCollectionLegacy + from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy self.shapes = ShapeCollectionLegacy(obj=self, app=self.app, name='shapes_exc_editor') self.tool_shape = ShapeCollectionLegacy(obj=self, app=self.app, name='tool_shapes_exc_editor') @@ -2312,7 +2312,7 @@ class FlatCAMExcEditor(QtCore.QObject): tool_dia = float('%.*f' % (self.decimals, v['C'])) self.tool2tooldia[int(k)] = tool_dia - # Init AppGUI + # Init appGUI self.addtool_entry.set_value(float(self.app.defaults['excellon_editor_newdia'])) self.drill_array_size_entry.set_value(int(self.app.defaults['excellon_editor_array_size'])) self.drill_axis_radio.set_value(self.app.defaults['excellon_editor_lin_dir']) @@ -3043,7 +3043,7 @@ class FlatCAMExcEditor(QtCore.QObject): self.set_ui() - # now that we hava data, create the AppGUI interface and add it to the Tool Tab + # now that we hava data, create the appGUI interface and add it to the Tool Tab self.build_ui(first_run=True) # we activate this after the initial build as we don't need to see the tool been populated @@ -4026,7 +4026,7 @@ class FlatCAMExcEditor(QtCore.QObject): def select_tool(self, toolname): """ - Selects a drawing tool. Impacts the object and AppGUI. + Selects a drawing tool. Impacts the object and appGUI. :param toolname: Name of the tool. :return: None diff --git a/AppEditors/FlatCAMGeoEditor.py b/appEditors/FlatCAMGeoEditor.py similarity index 84% rename from AppEditors/FlatCAMGeoEditor.py rename to appEditors/FlatCAMGeoEditor.py index 51bb53a6..5127fa09 100644 --- a/AppEditors/FlatCAMGeoEditor.py +++ b/appEditors/FlatCAMGeoEditor.py @@ -15,10 +15,10 @@ 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.GUIElements import OptionalInputSection, FCCheckBox, FCEntry, FCComboBox, FCTextAreaRich, \ - FCDoubleSpinner, FCButton, FCInputDialog, FCTree -from AppParsers.ParseFont import * +from appTool import AppTool +from appGUI.GUIElements import OptionalInputSection, FCCheckBox, FCEntry, FCComboBox, FCTextAreaRich, \ + FCDoubleSpinner, FCButton, FCInputDialog, FCTree, NumericalEvalTupleEntry +from appParsers.ParseFont import * from shapely.geometry import LineString, LinearRing, MultiLineString, Polygon, MultiPolygon from shapely.ops import cascaded_union, unary_union, linemerge @@ -33,7 +33,7 @@ from rtree import index as rtindex from copy import deepcopy # from vispy.io import read_png import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -117,7 +117,7 @@ class BufferSelectionTool(AppTool): self.buffer_int_button.clicked.connect(self.on_buffer_int) self.buffer_ext_button.clicked.connect(self.on_buffer_ext) - # Init AppGUI + # Init appGUI self.buffer_distance_entry.set_value(0.01) def run(self): @@ -546,7 +546,7 @@ class PaintOptionsTool(AppTool): self.app.ui.notebook.setTabText(2, _("Paint Tool")) def set_tool_ui(self): - # Init AppGUI + # Init appGUI if self.app.defaults["tools_painttooldia"]: self.painttooldia_entry.set_value(self.app.defaults["tools_painttooldia"]) else: @@ -609,6 +609,7 @@ class TransformEditorTool(AppTool): scaleName = _("Scale") flipName = _("Mirror (Flip)") offsetName = _("Offset") + bufferName = _("Buffer") def __init__(self, app, draw_app): AppTool.__init__(self, app) @@ -617,376 +618,420 @@ class TransformEditorTool(AppTool): self.draw_app = draw_app self.decimals = self.app.decimals - self.transform_lay = QtWidgets.QVBoxLayout() - self.layout.addLayout(self.transform_lay) - # ## Title - title_label = QtWidgets.QLabel("%s %s" % (_('Editor'), str(self.toolName))) + title_label = QtWidgets.QLabel("%s" % self.toolName) title_label.setStyleSheet(""" - QLabel - { - font-size: 16px; - font-weight: bold; - } - """) - self.transform_lay.addWidget(title_label) + QLabel + { + font-size: 16px; + font-weight: bold; + } + """) + self.layout.addWidget(title_label) + self.layout.addWidget(QtWidgets.QLabel('')) - self.empty_label = QtWidgets.QLabel("") - self.empty_label.setMinimumWidth(50) + # ## Layout + grid0 = QtWidgets.QGridLayout() + self.layout.addLayout(grid0) + grid0.setColumnStretch(0, 0) + grid0.setColumnStretch(1, 1) + grid0.setColumnStretch(2, 0) - self.empty_label1 = QtWidgets.QLabel("") - self.empty_label1.setMinimumWidth(70) - self.empty_label2 = QtWidgets.QLabel("") - self.empty_label2.setMinimumWidth(70) - self.empty_label3 = QtWidgets.QLabel("") - self.empty_label3.setMinimumWidth(70) - self.empty_label4 = QtWidgets.QLabel("") - self.empty_label4.setMinimumWidth(70) - self.transform_lay.addWidget(self.empty_label) + grid0.addWidget(QtWidgets.QLabel('')) - # Rotate Title + # Reference + ref_label = QtWidgets.QLabel('%s:' % _("Reference")) + ref_label.setToolTip( + _("The reference point for Rotate, Skew, Scale, Mirror.\n" + "Can be:\n" + "- Origin -> it is the 0, 0 point\n" + "- Selection -> the center of the bounding box of the selected objects\n" + "- Point -> a custom point defined by X,Y coordinates\n" + "- Min Selection -> the point (minx, miny) of the bounding box of the selection") + ) + self.ref_combo = FCComboBox() + self.ref_items = [_("Origin"), _("Selection"), _("Point"), _("Minimum")] + self.ref_combo.addItems(self.ref_items) + + grid0.addWidget(ref_label, 0, 0) + grid0.addWidget(self.ref_combo, 0, 1, 1, 2) + + self.point_label = QtWidgets.QLabel('%s:' % _("Value")) + self.point_label.setToolTip( + _("A point of reference in format X,Y.") + ) + self.point_entry = NumericalEvalTupleEntry() + + grid0.addWidget(self.point_label, 1, 0) + grid0.addWidget(self.point_entry, 1, 1, 1, 2) + + self.point_button = FCButton(_("Add")) + self.point_button.setToolTip( + _("Add point coordinates from clipboard.") + ) + grid0.addWidget(self.point_button, 2, 0, 1, 3) + + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 5, 0, 1, 3) + + # ## Rotate Title rotate_title_label = QtWidgets.QLabel("%s" % self.rotateName) - self.transform_lay.addWidget(rotate_title_label) + grid0.addWidget(rotate_title_label, 6, 0, 1, 3) - # Layout - form_layout = QtWidgets.QFormLayout() - self.transform_lay.addLayout(form_layout) - form_child = QtWidgets.QHBoxLayout() - - self.rotate_label = QtWidgets.QLabel(_("Angle:")) + self.rotate_label = QtWidgets.QLabel('%s:' % _("Angle")) self.rotate_label.setToolTip( - _("Angle for Rotation action, in degrees.\n" - "Float number between -360 and 359.\n" - "Positive numbers for CW motion.\n" - "Negative numbers for CCW motion.") + _("Angle for Rotation action, in degrees.\n" + "Float number between -360 and 359.\n" + "Positive numbers for CW motion.\n" + "Negative numbers for CCW motion.") ) - self.rotate_label.setFixedWidth(50) - self.rotate_entry = FCDoubleSpinner() + self.rotate_entry = FCDoubleSpinner(callback=self.confirmation_message) self.rotate_entry.set_precision(self.decimals) - self.rotate_entry.set_range(-360.0000, 360.0000) - self.rotate_entry.setSingleStep(0.1) + self.rotate_entry.setSingleStep(45) self.rotate_entry.setWrapping(True) + self.rotate_entry.set_range(-360, 360) - self.rotate_button = FCButton() - self.rotate_button.set_value(_("Rotate")) + # self.rotate_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + + self.rotate_button = FCButton(_("Rotate")) self.rotate_button.setToolTip( - _("Rotate the selected shape(s).\n" + _("Rotate the selected object(s).\n" "The point of reference is the middle of\n" - "the bounding box for all selected shapes.") + "the bounding box for all selected objects.") ) - self.rotate_button.setFixedWidth(60) + self.rotate_button.setMinimumWidth(90) - form_child.addWidget(self.rotate_entry) - form_child.addWidget(self.rotate_button) + grid0.addWidget(self.rotate_label, 7, 0) + grid0.addWidget(self.rotate_entry, 7, 1) + grid0.addWidget(self.rotate_button, 7, 2) - form_layout.addRow(self.rotate_label, form_child) + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 8, 0, 1, 3) - self.transform_lay.addWidget(self.empty_label1) - - # Skew Title + # ## Skew Title skew_title_label = QtWidgets.QLabel("%s" % self.skewName) - self.transform_lay.addWidget(skew_title_label) + grid0.addWidget(skew_title_label, 9, 0, 1, 2) - # Form Layout - form1_layout = QtWidgets.QFormLayout() - self.transform_lay.addLayout(form1_layout) - form1_child_1 = QtWidgets.QHBoxLayout() - form1_child_2 = QtWidgets.QHBoxLayout() + self.skew_link_cb = FCCheckBox() + self.skew_link_cb.setText(_("Link")) + self.skew_link_cb.setToolTip( + _("Link the Y entry to X entry and copy it's content.") + ) - self.skewx_label = QtWidgets.QLabel(_("Angle X:")) + grid0.addWidget(self.skew_link_cb, 9, 2) + + self.skewx_label = QtWidgets.QLabel('%s:' % _("X angle")) self.skewx_label.setToolTip( - _("Angle for Skew action, in degrees.\n" - "Float number between -360 and 359.") + _("Angle for Skew action, in degrees.\n" + "Float number between -360 and 360.") ) - self.skewx_label.setFixedWidth(50) - self.skewx_entry = FCDoubleSpinner() + self.skewx_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.skewx_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.skewx_entry.set_precision(self.decimals) - self.skewx_entry.set_range(-360.0000, 360.0000) - self.skewx_entry.setSingleStep(0.1) - self.skewx_entry.setWrapping(True) + self.skewx_entry.set_range(-360, 360) - self.skewx_button = FCButton() - self.skewx_button.set_value(_("Skew X")) + self.skewx_button = FCButton(_("Skew X")) self.skewx_button.setToolTip( - _("Skew/shear the selected shape(s).\n" - "The point of reference is the middle of\n" - "the bounding box for all selected shapes.")) - self.skewx_button.setFixedWidth(60) - - self.skewy_label = QtWidgets.QLabel(_("Angle Y:")) - self.skewy_label.setToolTip( - _("Angle for Skew action, in degrees.\n" - "Float number between -360 and 359.") - ) - self.skewy_label.setFixedWidth(50) - self.skewy_entry = FCDoubleSpinner() - self.skewy_entry.set_precision(self.decimals) - self.skewy_entry.set_range(-360.0000, 360.0000) - self.skewy_entry.setSingleStep(0.1) - self.skewy_entry.setWrapping(True) - - self.skewy_button = FCButton() - self.skewy_button.set_value(_("Skew Y")) - self.skewy_button.setToolTip( - _("Skew/shear the selected shape(s).\n" + _("Skew/shear the selected object(s).\n" "The point of reference is the middle of\n" - "the bounding box for all selected shapes.")) - self.skewy_button.setFixedWidth(60) + "the bounding box for all selected objects.")) + self.skewx_button.setMinimumWidth(90) - form1_child_1.addWidget(self.skewx_entry) - form1_child_1.addWidget(self.skewx_button) + grid0.addWidget(self.skewx_label, 10, 0) + grid0.addWidget(self.skewx_entry, 10, 1) + grid0.addWidget(self.skewx_button, 10, 2) - form1_child_2.addWidget(self.skewy_entry) - form1_child_2.addWidget(self.skewy_button) + self.skewy_label = QtWidgets.QLabel('%s:' % _("Y angle")) + self.skewy_label.setToolTip( + _("Angle for Skew action, in degrees.\n" + "Float number between -360 and 360.") + ) + self.skewy_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.skewy_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + self.skewy_entry.set_precision(self.decimals) + self.skewy_entry.set_range(-360, 360) - form1_layout.addRow(self.skewx_label, form1_child_1) - form1_layout.addRow(self.skewy_label, form1_child_2) + self.skewy_button = FCButton(_("Skew Y")) + self.skewy_button.setToolTip( + _("Skew/shear the selected object(s).\n" + "The point of reference is the middle of\n" + "the bounding box for all selected objects.")) + self.skewy_button.setMinimumWidth(90) - self.transform_lay.addWidget(self.empty_label2) + grid0.addWidget(self.skewy_label, 12, 0) + grid0.addWidget(self.skewy_entry, 12, 1) + grid0.addWidget(self.skewy_button, 12, 2) - # Scale Title + self.ois_sk = OptionalInputSection(self.skew_link_cb, [self.skewy_label, self.skewy_entry, self.skewy_button], + logic=False) + + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 14, 0, 1, 3) + + # ## Scale Title scale_title_label = QtWidgets.QLabel("%s" % self.scaleName) - self.transform_lay.addWidget(scale_title_label) - - # Form Layout - form2_layout = QtWidgets.QFormLayout() - self.transform_lay.addLayout(form2_layout) - form2_child_1 = QtWidgets.QHBoxLayout() - form2_child_2 = QtWidgets.QHBoxLayout() - - self.scalex_label = QtWidgets.QLabel(_("Factor X:")) - self.scalex_label.setToolTip( - _("Factor for Scale action over X axis.") - ) - self.scalex_label.setFixedWidth(50) - self.scalex_entry = FCDoubleSpinner() - self.scalex_entry.set_precision(self.decimals) - self.scalex_entry.set_range(0.0000, 9999.9999) - self.scalex_entry.setSingleStep(0.1) - self.scalex_entry.setWrapping(True) - - self.scalex_button = FCButton() - self.scalex_button.set_value(_("Scale X")) - self.scalex_button.setToolTip( - _("Scale the selected shape(s).\n" - "The point of reference depends on \n" - "the Scale reference checkbox state.")) - self.scalex_button.setFixedWidth(60) - - self.scaley_label = QtWidgets.QLabel(_("Factor Y:")) - self.scaley_label.setToolTip( - _("Factor for Scale action over Y axis.") - ) - self.scaley_label.setFixedWidth(50) - self.scaley_entry = FCDoubleSpinner() - self.scaley_entry.set_precision(self.decimals) - self.scaley_entry.set_range(0.0000, 9999.9999) - self.scaley_entry.setSingleStep(0.1) - self.scaley_entry.setWrapping(True) - - self.scaley_button = FCButton() - self.scaley_button.set_value(_("Scale Y")) - self.scaley_button.setToolTip( - _("Scale the selected shape(s).\n" - "The point of reference depends on \n" - "the Scale reference checkbox state.")) - self.scaley_button.setFixedWidth(60) + grid0.addWidget(scale_title_label, 15, 0, 1, 2) self.scale_link_cb = FCCheckBox() - self.scale_link_cb.set_value(True) self.scale_link_cb.setText(_("Link")) self.scale_link_cb.setToolTip( - _("Scale the selected shape(s)\n" - "using the Scale Factor X for both axis.")) - self.scale_link_cb.setFixedWidth(50) - - self.scale_zero_ref_cb = FCCheckBox() - self.scale_zero_ref_cb.set_value(True) - self.scale_zero_ref_cb.setText(_("Scale Reference")) - self.scale_zero_ref_cb.setToolTip( - _("Scale the selected shape(s)\n" - "using the origin reference when checked,\n" - "and the center of the biggest bounding box\n" - "of the selected shapes when unchecked.")) - - form2_child_1.addWidget(self.scalex_entry) - form2_child_1.addWidget(self.scalex_button) - - form2_child_2.addWidget(self.scaley_entry) - form2_child_2.addWidget(self.scaley_button) - - form2_layout.addRow(self.scalex_label, form2_child_1) - form2_layout.addRow(self.scaley_label, form2_child_2) - form2_layout.addRow(self.scale_link_cb, self.scale_zero_ref_cb) - self.ois_scale = OptionalInputSection(self.scale_link_cb, [self.scaley_entry, self.scaley_button], logic=False) - - self.transform_lay.addWidget(self.empty_label3) - - # Offset Title - offset_title_label = QtWidgets.QLabel("%s" % self.offsetName) - self.transform_lay.addWidget(offset_title_label) - - # Form Layout - form3_layout = QtWidgets.QFormLayout() - self.transform_lay.addLayout(form3_layout) - form3_child_1 = QtWidgets.QHBoxLayout() - form3_child_2 = QtWidgets.QHBoxLayout() - - self.offx_label = QtWidgets.QLabel(_("Value X:")) - self.offx_label.setToolTip( - _("Value for Offset action on X axis.") + _("Link the Y entry to X entry and copy it's content.") ) - self.offx_label.setFixedWidth(50) - self.offx_entry = FCDoubleSpinner() - self.offx_entry.set_precision(self.decimals) - self.offx_entry.set_range(-9999.9999, 9999.9999) - self.offx_entry.setSingleStep(0.1) - self.offx_entry.setWrapping(True) - self.offx_button = FCButton() - self.offx_button.set_value(_("Offset X")) - self.offx_button.setToolTip( - _("Offset the selected shape(s).\n" - "The point of reference is the middle of\n" - "the bounding box for all selected shapes.\n") + grid0.addWidget(self.scale_link_cb, 15, 2) + + self.scalex_label = QtWidgets.QLabel('%s:' % _("X factor")) + self.scalex_label.setToolTip( + _("Factor for scaling on X axis.") ) - self.offx_button.setFixedWidth(60) + self.scalex_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.scalex_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + self.scalex_entry.set_precision(self.decimals) + self.scalex_entry.setMinimum(-1e6) - self.offy_label = QtWidgets.QLabel(_("Value Y:")) - self.offy_label.setToolTip( - _("Value for Offset action on Y axis.") + self.scalex_button = FCButton(_("Scale X")) + self.scalex_button.setToolTip( + _("Scale the selected object(s).\n" + "The point of reference depends on \n" + "the Scale reference checkbox state.")) + self.scalex_button.setMinimumWidth(90) + + grid0.addWidget(self.scalex_label, 17, 0) + grid0.addWidget(self.scalex_entry, 17, 1) + grid0.addWidget(self.scalex_button, 17, 2) + + self.scaley_label = QtWidgets.QLabel('%s:' % _("Y factor")) + self.scaley_label.setToolTip( + _("Factor for scaling on Y axis.") ) - self.offy_label.setFixedWidth(50) - self.offy_entry = FCDoubleSpinner() - self.offy_entry.set_precision(self.decimals) - self.offy_entry.set_range(-9999.9999, 9999.9999) - self.offy_entry.setSingleStep(0.1) - self.offy_entry.setWrapping(True) + self.scaley_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.scaley_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + self.scaley_entry.set_precision(self.decimals) + self.scaley_entry.setMinimum(-1e6) - self.offy_button = FCButton() - self.offy_button.set_value(_("Offset Y")) - self.offy_button.setToolTip( - _("Offset the selected shape(s).\n" - "The point of reference is the middle of\n" - "the bounding box for all selected shapes.\n") - ) - self.offy_button.setFixedWidth(60) + self.scaley_button = FCButton(_("Scale Y")) + self.scaley_button.setToolTip( + _("Scale the selected object(s).\n" + "The point of reference depends on \n" + "the Scale reference checkbox state.")) + self.scaley_button.setMinimumWidth(90) - form3_child_1.addWidget(self.offx_entry) - form3_child_1.addWidget(self.offx_button) + grid0.addWidget(self.scaley_label, 19, 0) + grid0.addWidget(self.scaley_entry, 19, 1) + grid0.addWidget(self.scaley_button, 19, 2) - form3_child_2.addWidget(self.offy_entry) - form3_child_2.addWidget(self.offy_button) + self.ois_s = OptionalInputSection(self.scale_link_cb, + [ + self.scaley_label, + self.scaley_entry, + self.scaley_button + ], logic=False) - form3_layout.addRow(self.offx_label, form3_child_1) - form3_layout.addRow(self.offy_label, form3_child_2) + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 21, 0, 1, 3) - self.transform_lay.addWidget(self.empty_label4) - - # Flip Title + # ## Flip Title flip_title_label = QtWidgets.QLabel("%s" % self.flipName) - self.transform_lay.addWidget(flip_title_label) + grid0.addWidget(flip_title_label, 23, 0, 1, 3) - # Form Layout - form4_layout = QtWidgets.QFormLayout() - form4_child_hlay = QtWidgets.QHBoxLayout() - self.transform_lay.addLayout(form4_child_hlay) - self.transform_lay.addLayout(form4_layout) - form4_child_1 = QtWidgets.QHBoxLayout() - - self.flipx_button = FCButton() - self.flipx_button.set_value(_("Flip on X")) + self.flipx_button = FCButton(_("Flip on X")) self.flipx_button.setToolTip( - _("Flip the selected shape(s) over the X axis.\n" - "Does not create a new shape.") + _("Flip the selected object(s) over the X axis.") ) - self.flipy_button = FCButton() - self.flipy_button.set_value(_("Flip on Y")) + self.flipy_button = FCButton(_("Flip on Y")) self.flipy_button.setToolTip( - _("Flip the selected shape(s) over the X axis.\n" - "Does not create a new shape.") + _("Flip the selected object(s) over the X axis.") ) - self.flip_ref_cb = FCCheckBox() - self.flip_ref_cb.set_value(True) - self.flip_ref_cb.setText(_("Ref Pt")) - self.flip_ref_cb.setToolTip( - _("Flip the selected shape(s)\n" - "around the point in Point Entry Field.\n" - "\n" - "The point coordinates can be captured by\n" - "left click on canvas together with pressing\n" - "SHIFT key. \n" - "Then click Add button to insert coordinates.\n" - "Or enter the coords in format (x, y) in the\n" - "Point Entry field and click Flip on X(Y)") + hlay0 = QtWidgets.QHBoxLayout() + grid0.addLayout(hlay0, 25, 0, 1, 3) + + hlay0.addWidget(self.flipx_button) + hlay0.addWidget(self.flipy_button) + + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 27, 0, 1, 3) + + # ## Offset Title + offset_title_label = QtWidgets.QLabel("%s" % self.offsetName) + grid0.addWidget(offset_title_label, 29, 0, 1, 3) + + self.offx_label = QtWidgets.QLabel('%s:' % _("X val")) + self.offx_label.setToolTip( + _("Distance to offset on X axis. In current units.") ) - self.flip_ref_cb.setFixedWidth(50) + self.offx_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.offx_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + self.offx_entry.set_precision(self.decimals) + self.offx_entry.setMinimum(-1e6) - self.flip_ref_label = QtWidgets.QLabel(_("Point:")) - self.flip_ref_label.setToolTip( - _("Coordinates in format (x, y) used as reference for mirroring.\n" - "The 'x' in (x, y) will be used when using Flip on X and\n" - "the 'y' in (x, y) will be used when using Flip on Y.") + self.offx_button = FCButton(_("Offset X")) + self.offx_button.setToolTip( + _("Offset the selected object(s).\n" + "The point of reference is the middle of\n" + "the bounding box for all selected objects.\n")) + self.offx_button.setMinimumWidth(90) + + grid0.addWidget(self.offx_label, 31, 0) + grid0.addWidget(self.offx_entry, 31, 1) + grid0.addWidget(self.offx_button, 31, 2) + + self.offy_label = QtWidgets.QLabel('%s:' % _("Y val")) + self.offy_label.setToolTip( + _("Distance to offset on Y axis. In current units.") ) - self.flip_ref_label.setFixedWidth(50) - self.flip_ref_entry = FCEntry("0, 0") + self.offy_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.offy_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + self.offy_entry.set_precision(self.decimals) + self.offy_entry.setMinimum(-1e6) - self.flip_ref_button = FCButton() - self.flip_ref_button.set_value(_("Add")) - self.flip_ref_button.setToolTip( - _("The point coordinates can be captured by\n" - "left click on canvas together with pressing\n" - "SHIFT key. Then click Add button to insert.") - ) - self.flip_ref_button.setFixedWidth(60) + self.offy_button = FCButton(_("Offset Y")) + self.offy_button.setToolTip( + _("Offset the selected object(s).\n" + "The point of reference is the middle of\n" + "the bounding box for all selected objects.\n")) + self.offy_button.setMinimumWidth(90) - form4_child_hlay.addWidget(self.flipx_button) - form4_child_hlay.addWidget(self.flipy_button) + grid0.addWidget(self.offy_label, 32, 0) + grid0.addWidget(self.offy_entry, 32, 1) + grid0.addWidget(self.offy_button, 32, 2) - form4_child_1.addWidget(self.flip_ref_entry) - form4_child_1.addWidget(self.flip_ref_button) + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 34, 0, 1, 3) - form4_layout.addRow(self.flip_ref_cb) - form4_layout.addRow(self.flip_ref_label, form4_child_1) - self.ois_flip = OptionalInputSection(self.flip_ref_cb, - [self.flip_ref_entry, self.flip_ref_button], logic=True) + # ## Buffer Title + buffer_title_label = QtWidgets.QLabel("%s" % self.bufferName) + grid0.addWidget(buffer_title_label, 35, 0, 1, 2) - self.transform_lay.addStretch() + self.buffer_rounded_cb = FCCheckBox('%s' % _("Rounded")) + self.buffer_rounded_cb.setToolTip( + _("If checked then the buffer will surround the buffered shape,\n" + "every corner will be rounded.\n" + "If not checked then the buffer will follow the exact geometry\n" + "of the buffered shape.") + ) + + grid0.addWidget(self.buffer_rounded_cb, 35, 2) + + self.buffer_label = QtWidgets.QLabel('%s:' % _("Distance")) + self.buffer_label.setToolTip( + _("A positive value will create the effect of dilation,\n" + "while a negative value will create the effect of erosion.\n" + "Each geometry element of the object will be increased\n" + "or decreased with the 'distance'.") + ) + + self.buffer_entry = FCDoubleSpinner(callback=self.confirmation_message) + self.buffer_entry.set_precision(self.decimals) + self.buffer_entry.setSingleStep(0.1) + self.buffer_entry.setWrapping(True) + self.buffer_entry.set_range(-9999.9999, 9999.9999) + + self.buffer_button = FCButton(_("Buffer D")) + self.buffer_button.setToolTip( + _("Create the buffer effect on each geometry,\n" + "element from the selected object, using the distance.") + ) + self.buffer_button.setMinimumWidth(90) + + grid0.addWidget(self.buffer_label, 37, 0) + grid0.addWidget(self.buffer_entry, 37, 1) + grid0.addWidget(self.buffer_button, 37, 2) + + self.buffer_factor_label = QtWidgets.QLabel('%s:' % _("Value")) + self.buffer_factor_label.setToolTip( + _("A positive value will create the effect of dilation,\n" + "while a negative value will create the effect of erosion.\n" + "Each geometry element of the object will be increased\n" + "or decreased to fit the 'Value'. Value is a percentage\n" + "of the initial dimension.") + ) + + self.buffer_factor_entry = FCDoubleSpinner(callback=self.confirmation_message, suffix='%') + self.buffer_factor_entry.set_range(-100.0000, 1000.0000) + self.buffer_factor_entry.set_precision(self.decimals) + self.buffer_factor_entry.setWrapping(True) + self.buffer_factor_entry.setSingleStep(1) + + self.buffer_factor_button = FCButton(_("Buffer F")) + self.buffer_factor_button.setToolTip( + _("Create the buffer effect on each geometry,\n" + "element from the selected object, using the factor.") + ) + self.buffer_factor_button.setMinimumWidth(90) + + grid0.addWidget(self.buffer_factor_label, 38, 0) + grid0.addWidget(self.buffer_factor_entry, 38, 1) + grid0.addWidget(self.buffer_factor_button, 38, 2) + + grid0.addWidget(QtWidgets.QLabel(''), 42, 0, 1, 3) + + self.layout.addStretch() # Signals + self.ref_combo.currentIndexChanged.connect(self.on_reference_changed) + self.point_button.clicked.connect(self.on_add_coords) + self.rotate_button.clicked.connect(self.on_rotate) + self.skewx_button.clicked.connect(self.on_skewx) self.skewy_button.clicked.connect(self.on_skewy) + self.scalex_button.clicked.connect(self.on_scalex) self.scaley_button.clicked.connect(self.on_scaley) + self.offx_button.clicked.connect(self.on_offx) self.offy_button.clicked.connect(self.on_offy) + self.flipx_button.clicked.connect(self.on_flipx) self.flipy_button.clicked.connect(self.on_flipy) - self.flip_ref_button.clicked.connect(self.on_flip_add_coords) - self.rotate_entry.editingFinished.connect(self.on_rotate) - self.skewx_entry.editingFinished.connect(self.on_skewx) - self.skewy_entry.editingFinished.connect(self.on_skewy) - self.scalex_entry.editingFinished.connect(self.on_scalex) - self.scaley_entry.editingFinished.connect(self.on_scaley) - self.offx_entry.editingFinished.connect(self.on_offx) - self.offy_entry.editingFinished.connect(self.on_offy) + self.buffer_button.clicked.connect(self.on_buffer_by_distance) + self.buffer_factor_button.clicked.connect(self.on_buffer_by_factor) + + # self.rotate_entry.editingFinished.connect(self.on_rotate) + # self.skewx_entry.editingFinished.connect(self.on_skewx) + # self.skewy_entry.editingFinished.connect(self.on_skewy) + # self.scalex_entry.editingFinished.connect(self.on_scalex) + # self.scaley_entry.editingFinished.connect(self.on_scaley) + # self.offx_entry.editingFinished.connect(self.on_offx) + # self.offy_entry.editingFinished.connect(self.on_offy) self.set_tool_ui() - def run(self): + def run(self, toggle=True): self.app.defaults.report_usage("Geo Editor Transform Tool()") - AppTool.run(self) - self.set_tool_ui() # if the splitter us hidden, display it if self.app.ui.splitter.sizes()[0] == 0: self.app.ui.splitter.setSizes([1, 1]) + if toggle: + try: + if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName: + self.app.ui.notebook.setCurrentWidget(self.app.ui.selected_tab) + else: + self.app.ui.notebook.setCurrentWidget(self.app.ui.tool_tab) + except AttributeError: + pass + + AppTool.run(self) + self.set_tool_ui() + self.app.ui.notebook.setTabText(2, _("Transform Tool")) def install(self, icon=None, separator=None, **kwargs): @@ -994,60 +1039,32 @@ class TransformEditorTool(AppTool): def set_tool_ui(self): # Initialize form - if self.app.defaults["tools_transform_rotate"]: - self.rotate_entry.set_value(self.app.defaults["tools_transform_rotate"]) - else: - self.rotate_entry.set_value(0.0) + ref_val = self.app.defaults["tools_transform_reference"] + if ref_val == _("Object"): + ref_val = _("Selection") + self.ref_combo.set_value(ref_val) + self.point_entry.set_value(self.app.defaults["tools_transform_ref_point"]) + self.rotate_entry.set_value(self.app.defaults["tools_transform_rotate"]) - if self.app.defaults["tools_transform_skew_x"]: - self.skewx_entry.set_value(self.app.defaults["tools_transform_skew_x"]) - else: - self.skewx_entry.set_value(0.0) + self.skewx_entry.set_value(self.app.defaults["tools_transform_skew_x"]) + self.skewy_entry.set_value(self.app.defaults["tools_transform_skew_y"]) + self.skew_link_cb.set_value(self.app.defaults["tools_transform_skew_link"]) - if self.app.defaults["tools_transform_skew_y"]: - self.skewy_entry.set_value(self.app.defaults["tools_transform_skew_y"]) - else: - self.skewy_entry.set_value(0.0) + self.scalex_entry.set_value(self.app.defaults["tools_transform_scale_x"]) + self.scaley_entry.set_value(self.app.defaults["tools_transform_scale_y"]) + self.scale_link_cb.set_value(self.app.defaults["tools_transform_scale_link"]) - if self.app.defaults["tools_transform_scale_x"]: - self.scalex_entry.set_value(self.app.defaults["tools_transform_scale_x"]) - else: - self.scalex_entry.set_value(1.0) + self.offx_entry.set_value(self.app.defaults["tools_transform_offset_x"]) + self.offy_entry.set_value(self.app.defaults["tools_transform_offset_y"]) - if self.app.defaults["tools_transform_scale_y"]: - self.scaley_entry.set_value(self.app.defaults["tools_transform_scale_y"]) - else: - self.scaley_entry.set_value(1.0) + self.buffer_entry.set_value(self.app.defaults["tools_transform_buffer_dis"]) + self.buffer_factor_entry.set_value(self.app.defaults["tools_transform_buffer_factor"]) + self.buffer_rounded_cb.set_value(self.app.defaults["tools_transform_buffer_corner"]) - if self.app.defaults["tools_transform_scale_link"]: - self.scale_link_cb.set_value(self.app.defaults["tools_transform_scale_link"]) - else: - self.scale_link_cb.set_value(True) - - if self.app.defaults["tools_transform_scale_reference"]: - self.scale_zero_ref_cb.set_value(self.app.defaults["tools_transform_scale_reference"]) - else: - self.scale_zero_ref_cb.set_value(True) - - if self.app.defaults["tools_transform_offset_x"]: - self.offx_entry.set_value(self.app.defaults["tools_transform_offset_x"]) - else: - self.offx_entry.set_value(0.0) - - if self.app.defaults["tools_transform_offset_y"]: - self.offy_entry.set_value(self.app.defaults["tools_transform_offset_y"]) - else: - self.offy_entry.set_value(0.0) - - if self.app.defaults["tools_transform_mirror_reference"]: - self.flip_ref_cb.set_value(self.app.defaults["tools_transform_mirror_reference"]) - else: - self.flip_ref_cb.set_value(False) - - if self.app.defaults["tools_transform_mirror_point"]: - self.flip_ref_entry.set_value(self.app.defaults["tools_transform_mirror_point"]) - else: - self.flip_ref_entry.set_value("0, 0") + # initial state is hidden + self.point_label.hide() + self.point_entry.hide() + self.point_button.hide() def template(self): if not self.draw_app.selected: @@ -1060,391 +1077,280 @@ class TransformEditorTool(AppTool): self.app.ui.splitter.setSizes([0, 1]) - def on_rotate(self, sig=None, val=None): - if val: - value = val + def on_reference_changed(self, index): + if index == 0 or index == 1: # "Origin" or "Selection" reference + self.point_label.hide() + self.point_entry.hide() + self.point_button.hide() + + elif index == 2: # "Point" reference + self.point_label.show() + self.point_entry.show() + self.point_button.show() + + def on_calculate_reference(self, ref_index=None): + if ref_index: + ref_val = ref_index else: + ref_val = self.ref_combo.currentIndex() + + if ref_val == 0: # "Origin" reference + return 0, 0 + elif ref_val == 1: # "Selection" reference + sel_list = self.draw_app.selected + if sel_list: + xmin, ymin, xmax, ymax = self.alt_bounds(sel_list) + px = (xmax + xmin) * 0.5 + py = (ymax + ymin) * 0.5 + return px, py + else: + self.app.inform.emit('[ERROR_NOTCL] %s' % _("No shape selected.")) + return "fail" + elif ref_val == 2: # "Point" reference + point_val = self.point_entry.get_value() try: - value = float(self.rotate_entry.get_value()) - except ValueError: - # try to convert comma to decimal point. if it's still not working error message and return - try: - value = float(self.rotate_entry.get_value().replace(',', '.')) - except ValueError: - self.app.inform.emit('[ERROR_NOTCL] %s' % - _("Wrong value format entered, use a number.")) - return - self.app.worker_task.emit({'fcn': self.on_rotate_action, 'params': [value]}) + px, py = eval('{}'.format(point_val)) + return px, py + except Exception: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Incorrect format for Point value. Needs format X,Y")) + return "fail" + else: + sel_list = self.draw_app.selected + if sel_list: + xmin, ymin, xmax, ymax = self.alt_bounds(sel_list) + if ref_val == 3: + return xmin, ymin # lower left corner + elif ref_val == 4: + return xmax, ymin # lower right corner + elif ref_val == 5: + return xmax, ymax # upper right corner + else: + return xmin, ymax # upper left corner + else: + self.app.inform.emit('[ERROR_NOTCL] %s' % _("No shape selected.")) + return "fail" - def on_flipx(self): - # self.on_flip("Y") - axis = 'Y' - self.app.worker_task.emit({'fcn': self.on_flip, - 'params': [axis]}) - return - - def on_flipy(self): - # self.on_flip("X") - axis = 'X' - self.app.worker_task.emit({'fcn': self.on_flip, - 'params': [axis]}) - return - - def on_flip_add_coords(self): + def on_add_coords(self): val = self.app.clipboard.text() - self.flip_ref_entry.set_value(val) + self.point_entry.set_value(val) - def on_skewx(self, sig=None, val=None): - """ - Skew on X axis + def on_rotate(self, signal=None, val=None, ref=None): + value = float(self.rotate_entry.get_value()) if val is None else val + if value == 0: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Rotate transformation can not be done for a value of 0.")) + return + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return + self.app.worker_task.emit({'fcn': self.on_rotate_action, 'params': [value, point]}) - :param sig: Signal value sent by the signal that is connected to this slot - :param val: Skew with a known value, val - :return: - """ - - if val: - value = val - else: - try: - value = float(self.skewx_entry.get_value()) - except ValueError: - # try to convert comma to decimal point. if it's still not working error message and return - try: - value = float(self.skewx_entry.get_value().replace(',', '.')) - except ValueError: - self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number.")) - return - - # self.on_skew("X", value) - axis = 'X' - self.app.worker_task.emit({'fcn': self.on_skew, - 'params': [axis, value]}) - return - - def on_skewy(self, sig=None, val=None): - """ - Skew on Y axis - - :param sig: Signal value sent by the signal that is connected to this slot - :param val: Skew with a known value, val - :return: - """ - - if val: - value = val - else: - try: - value = float(self.skewy_entry.get_value()) - except ValueError: - # try to convert comma to decimal point. if it's still not working error message and return - try: - value = float(self.skewy_entry.get_value().replace(',', '.')) - except ValueError: - self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number.")) - return - - # self.on_skew("Y", value) + def on_flipx(self, signal=None, ref=None): axis = 'Y' - self.app.worker_task.emit({'fcn': self.on_skew, - 'params': [axis, value]}) - return + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return + self.app.worker_task.emit({'fcn': self.on_flip, 'params': [axis, point]}) - def on_scalex(self, sig=None, val=None): - """ - Scale on X axis + def on_flipy(self, signal=None, ref=None): + axis = 'X' + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return + self.app.worker_task.emit({'fcn': self.on_flip, 'params': [axis, point]}) - :param sig: Signal value sent by the signal that is connected to this slot - :param val: Scale with a known value, val - :return: - """ + def on_skewx(self, signal=None, val=None, ref=None): + xvalue = float(self.skewx_entry.get_value()) if val is None else val - if val: - xvalue = val - else: - try: - xvalue = float(self.scalex_entry.get_value()) - except ValueError: - # try to convert comma to decimal point. if it's still not working error message and return - try: - xvalue = float(self.scalex_entry.get_value().replace(',', '.')) - except ValueError: - self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number.")) - return - - # scaling to zero has no sense so we remove it, because scaling with 1 does nothing if xvalue == 0: - xvalue = 1 + return + + if self.skew_link_cb.get_value(): + yvalue = xvalue + else: + yvalue = 0 + + axis = 'X' + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return + + self.app.worker_task.emit({'fcn': self.on_skew, 'params': [axis, xvalue, yvalue, point]}) + + def on_skewy(self, signal=None, val=None, ref=None): + xvalue = 0 + yvalue = float(self.skewy_entry.get_value()) if val is None else val + + if yvalue == 0: + return + + axis = 'Y' + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return + + self.app.worker_task.emit({'fcn': self.on_skew, 'params': [axis, xvalue, yvalue, point]}) + + def on_scalex(self, signal=None, val=None, ref=None): + xvalue = float(self.scalex_entry.get_value()) if val is None else val + + if xvalue == 0 or xvalue == 1: + self.app.inform.emit('[WARNING_NOTCL] %s' % + _("Scale transformation can not be done for a factor of 0 or 1.")) + return + if self.scale_link_cb.get_value(): yvalue = xvalue else: yvalue = 1 axis = 'X' - point = (0, 0) - if self.scale_zero_ref_cb.get_value(): - self.app.worker_task.emit({'fcn': self.on_scale, - 'params': [axis, xvalue, yvalue, point]}) - # self.on_scale("X", xvalue, yvalue, point=(0,0)) - else: - # self.on_scale("X", xvalue, yvalue) - self.app.worker_task.emit({'fcn': self.on_scale, - 'params': [axis, xvalue, yvalue]}) + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return - return - - def on_scaley(self, sig=None, val=None): - """ - Scale on Y axis - - :param sig: Signal value sent by the signal that is connected to this slot - :param val: Scale with a known value, val - :return: - """ + self.app.worker_task.emit({'fcn': self.on_scale, 'params': [axis, xvalue, yvalue, point]}) + def on_scaley(self, signal=None, val=None, ref=None): xvalue = 1 - if val: - yvalue = val - else: - try: - yvalue = float(self.scaley_entry.get_value()) - except ValueError: - # try to convert comma to decimal point. if it's still not working error message and return - try: - yvalue = float(self.scaley_entry.get_value().replace(',', '.')) - except ValueError: - self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number.")) - return + yvalue = float(self.scaley_entry.get_value()) if val is None else val - # scaling to zero has no sense so we remove it, because scaling with 1 does nothing - if yvalue == 0: - yvalue = 1 + if yvalue == 0 or yvalue == 1: + self.app.inform.emit('[WARNING_NOTCL] %s' % + _("Scale transformation can not be done for a factor of 0 or 1.")) + return axis = 'Y' - point = (0, 0) - if self.scale_zero_ref_cb.get_value(): - self.app.worker_task.emit({'fcn': self.on_scale, 'params': [axis, xvalue, yvalue, point]}) - else: - self.app.worker_task.emit({'fcn': self.on_scale, 'params': [axis, xvalue, yvalue]}) + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return - return + self.app.worker_task.emit({'fcn': self.on_scale, 'params': [axis, xvalue, yvalue, point]}) - def on_offx(self, sig=None, val=None): - """ - Offset on X axis - - :param sig: Signal value sent by the signal that is connected to this slot - :param val: Offset with a known value, val - :return: - """ - - if val: - value = val - else: - try: - value = float(self.offx_entry.get_value()) - except ValueError: - # try to convert comma to decimal point. if it's still not working error message and return - try: - value = float(self.offx_entry.get_value().replace(',', '.')) - except ValueError: - self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number.")) - return - - # self.on_offset("X", value) + def on_offx(self, signal=None, val=None): + value = float(self.offx_entry.get_value()) if val is None else val + if value == 0: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Offset transformation can not be done for a value of 0.")) + return axis = 'X' - self.app.worker_task.emit({'fcn': self.on_offset, - 'params': [axis, value]}) - return - def on_offy(self, sig=None, val=None): - """ - Offset on Y axis + self.app.worker_task.emit({'fcn': self.on_offset, 'params': [axis, value]}) - :param sig: Signal value sent by the signal that is connected to this slot - :param val: Offset with a known value, val - :return: - """ - - if val: - value = val - else: - try: - value = float(self.offy_entry.get_value()) - except ValueError: - # try to convert comma to decimal point. if it's still not working error message and return - try: - value = float(self.offy_entry.get_value().replace(',', '.')) - except ValueError: - self.app.inform.emit('[ERROR_NOTCL] %s' % _("Wrong value format entered, use a number.")) - return - - # self.on_offset("Y", value) + def on_offy(self, signal=None, val=None): + value = float(self.offy_entry.get_value()) if val is None else val + if value == 0: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Offset transformation can not be done for a value of 0.")) + return axis = 'Y' - self.app.worker_task.emit({'fcn': self.on_offset, - 'params': [axis, value]}) - return - def on_rotate_action(self, num): + self.app.worker_task.emit({'fcn': self.on_offset, 'params': [axis, value]}) + + def on_buffer_by_distance(self): + value = self.buffer_entry.get_value() + join = 1 if self.buffer_rounded_cb.get_value() else 2 + + self.app.worker_task.emit({'fcn': self.on_buffer_action, 'params': [value, join]}) + + def on_buffer_by_factor(self): + value = 1 + (self.buffer_factor_entry.get_value() / 100.0) + join = 1 if self.buffer_rounded_cb.get_value() else 2 + + # tell the buffer method to use the factor + factor = True + + self.app.worker_task.emit({'fcn': self.on_buffer_action, 'params': [value, join, factor]}) + + def on_rotate_action(self, val, point): """ Rotate geometry - :param num: Rotate with a known angle value, num + :param num: Rotate with a known angle value, val + :param point: Reference point for rotation: tuple :return: """ - shape_list = self.draw_app.selected - xminlist = [] - yminlist = [] - xmaxlist = [] - ymaxlist = [] + with self.app.proc_container.new(_("Appying Rotate")): + shape_list = self.draw_app.selected + px, py = point - if not shape_list: - self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected. Please Select a shape to rotate!")) - return - else: - with self.app.proc_container.new(_("Appying Rotate")): - try: - # first get a bounding box to fit all - for sha in shape_list: - xmin, ymin, xmax, ymax = sha.bounds() - xminlist.append(xmin) - yminlist.append(ymin) - xmaxlist.append(xmax) - ymaxlist.append(ymax) + if not shape_list: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected.")) + return - # get the minimum x,y and maximum x,y for all objects selected - xminimal = min(xminlist) - yminimal = min(yminlist) - xmaximal = max(xmaxlist) - ymaximal = max(ymaxlist) + try: + for sel_sha in shape_list: + sel_sha.rotate(-val, point=(px, py)) + self.draw_app.replot() - for sel_sha in shape_list: - px = 0.5 * (xminimal + xmaximal) - py = 0.5 * (yminimal + ymaximal) + 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 - sel_sha.rotate(-num, point=(px, py)) - self.draw_app.replot() - # self.draw_app.add_shape(DrawToolShape(sel_sha.geo)) - - # self.draw_app.transform_complete.emit() - - 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 - - def on_flip(self, axis): + def on_flip(self, axis, point): """ Mirror (flip) geometry - :param axis: Miror on a known axis given by the axis parameter + :param axis: Mirror on a known axis given by the axis parameter + :param point: Mirror reference point :return: """ shape_list = self.draw_app.selected - xminlist = [] - yminlist = [] - xmaxlist = [] - ymaxlist = [] if not shape_list: - self.app.inform.emit('[WARNING_NOTCL] %s' % - _("No shape selected. Please Select a shape to flip!")) + self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected.")) return - else: - with self.app.proc_container.new(_("Applying Flip")): - try: - # get mirroring coords from the point entry - if self.flip_ref_cb.isChecked(): - px, py = eval('{}'.format(self.flip_ref_entry.text())) - # get mirroring coords from the center of an all-enclosing bounding box - else: - # first get a bounding box to fit all - for sha in shape_list: - xmin, ymin, xmax, ymax = sha.bounds() - xminlist.append(xmin) - yminlist.append(ymin) - xmaxlist.append(xmax) - ymaxlist.append(ymax) - # get the minimum x,y and maximum x,y for all objects selected - xminimal = min(xminlist) - yminimal = min(yminlist) - xmaximal = max(xmaxlist) - ymaximal = max(ymaxlist) + with self.app.proc_container.new(_("Applying Flip")): + try: + px, py = point - px = 0.5 * (xminimal + xmaximal) - py = 0.5 * (yminimal + ymaximal) + # execute mirroring + for sha in shape_list: + if axis == 'X': + sha.mirror('X', (px, py)) + self.app.inform.emit('[success] %s...' % _('Flip on the Y axis done')) + elif axis == 'Y': + sha.mirror('Y', (px, py)) + self.app.inform.emit('[success] %s' % _('Flip on the X axis done')) + self.draw_app.replot() - # execute mirroring - for sha in shape_list: - if axis == 'X': - sha.mirror('X', (px, py)) - self.app.inform.emit('[success] %s...' % - _('Flip on the Y axis done')) - elif axis == 'Y': - sha.mirror('Y', (px, py)) - self.app.inform.emit('[success] %s' % - _('Flip on the X axis done')) - self.draw_app.replot() + except Exception as e: + self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Flip action was not executed"), str(e))) + return - # self.draw_app.add_shape(DrawToolShape(sha.geo)) - # - # self.draw_app.transform_complete.emit() - - except Exception as e: - self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Flip action was not executed"), str(e))) - return - - def on_skew(self, axis, num): + def on_skew(self, axis, xval, yval, point): """ Skew geometry - :param num: Rotate with a known angle value, num :param axis: Axis on which to deform, skew + :param xval: Skew value on X axis + :param yval: Skew value on Y axis :return: """ shape_list = self.draw_app.selected - xminlist = [] - yminlist = [] if not shape_list: - self.app.inform.emit('[WARNING_NOTCL] %s' % - _("No shape selected. Please Select a shape to shear/skew!")) + self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected.")) return - else: - with self.app.proc_container.new(_("Applying Skew")): - try: - # first get a bounding box to fit all - for sha in shape_list: - xmin, ymin, xmax, ymax = sha.bounds() - xminlist.append(xmin) - yminlist.append(ymin) - # get the minimum x,y and maximum x,y for all objects selected - xminimal = min(xminlist) - yminimal = min(yminlist) + with self.app.proc_container.new(_("Applying Skew")): + try: + px, py = point + for sha in shape_list: + sha.skew(xval, yval, point=(px, py)) - for sha in shape_list: - if axis == 'X': - sha.skew(num, 0, point=(xminimal, yminimal)) - elif axis == 'Y': - sha.skew(0, num, point=(xminimal, yminimal)) - self.draw_app.replot() + self.draw_app.replot() - # self.draw_app.add_shape(DrawToolShape(sha.geo)) - # - # self.draw_app.transform_complete.emit() - if axis == 'X': - 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')) + if axis == 'X': + 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')) - except Exception as e: - self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed"), str(e))) - return + except Exception as e: + self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed"), str(e))) + return def on_scale(self, axis, xfactor, yfactor, point=None): """ @@ -1459,53 +1365,26 @@ class TransformEditorTool(AppTool): """ shape_list = self.draw_app.selected - xminlist = [] - yminlist = [] - xmaxlist = [] - 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.")) return - else: - with self.app.proc_container.new(_("Applying Scale")): - try: - # first get a bounding box to fit all - for sha in shape_list: - xmin, ymin, xmax, ymax = sha.bounds() - xminlist.append(xmin) - yminlist.append(ymin) - xmaxlist.append(xmax) - ymaxlist.append(ymax) - # get the minimum x,y and maximum x,y for all objects selected - xminimal = min(xminlist) - yminimal = min(yminlist) - xmaximal = max(xmaxlist) - ymaximal = max(ymaxlist) + with self.app.proc_container.new(_("Applying Scale")): + try: + px, py = point - if point is None: - px = 0.5 * (xminimal + xmaximal) - py = 0.5 * (yminimal + ymaximal) - else: - px = 0 - py = 0 + for sha in shape_list: + sha.scale(xfactor, yfactor, point=(px, py)) + self.draw_app.replot() - for sha in shape_list: - sha.scale(xfactor, yfactor, point=(px, py)) - self.draw_app.replot() - - # self.draw_app.add_shape(DrawToolShape(sha.geo)) - # - # self.draw_app.transform_complete.emit() - - if str(axis) == 'X': - 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')) - except Exception as e: - self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Scale action was not executed"), str(e))) - return + if str(axis) == 'X': + 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')) + except Exception as e: + self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Scale action was not executed"), str(e))) + return def on_offset(self, axis, num): """ @@ -1519,25 +1398,46 @@ class TransformEditorTool(AppTool): shape_list = self.draw_app.selected if not shape_list: - self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected. Please Select a shape to offset!")) + self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected.")) + return + + with self.app.proc_container.new(_("Applying Offset")): + try: + for sha in shape_list: + if axis == 'X': + sha.offset((num, 0)) + elif axis == 'Y': + sha.offset((0, num)) + self.draw_app.replot() + + if axis == 'X': + 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')) + + except Exception as e: + self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Offset action was not executed"), str(e))) + return + + def on_buffer_action(self, value, join, factor=None): + shape_list = self.draw_app.selected + + if not shape_list: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected")) return else: - with self.app.proc_container.new(_("Applying Offset")): + with self.app.proc_container.new(_("Applying Buffer")): try: - for sha in shape_list: - if axis == 'X': - sha.offset((num, 0)) - elif axis == 'Y': - sha.offset((0, num)) + for sel_obj in shape_list: + sel_obj.buffer(value, join, factor) + self.draw_app.replot() - if axis == 'X': - 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.inform.emit('[success] %s...' % _('Buffer done')) except Exception as e: - self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Offset action was not executed"), str(e))) + self.app.log.debug("TransformEditorTool.on_buffer_action() --> %s" % str(e)) + self.app.inform.emit('[ERROR_NOTCL] %s: %s.' % (_("Action was not executed, due of"), str(e))) return def on_rotate_key(self): @@ -1549,13 +1449,11 @@ class TransformEditorTool(AppTool): val, ok = val_box.get_value() if ok: - self.on_rotate(val=val) - self.app.inform.emit('[success] %s...' % - _("Geometry shape rotate done")) + self.on_rotate(val=val, ref=1) + self.app.inform.emit('[success] %s...' % _("Geometry shape rotate done")) return else: - self.app.inform.emit('[WARNING_NOTCL] %s' % - _("Geometry shape rotate cancelled")) + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Geometry shape rotate cancelled")) def on_offx_key(self): units = self.app.defaults['units'].lower() @@ -1569,12 +1467,10 @@ class TransformEditorTool(AppTool): val, ok = val_box.get_value() if ok: self.on_offx(val=val) - self.app.inform.emit('[success] %s' % - _("Geometry shape offset on X axis done")) + self.app.inform.emit('[success] %s' % _("Geometry shape offset on X axis done")) return else: - self.app.inform.emit('[WARNING_NOTCL] %s' % - _("Geometry shape offset X cancelled")) + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Geometry shape offset X cancelled")) def on_offy_key(self): units = self.app.defaults['units'].lower() @@ -1588,12 +1484,10 @@ class TransformEditorTool(AppTool): val, ok = val_box.get_value() if ok: self.on_offx(val=val) - self.app.inform.emit('[success] %s...' % - _("Geometry shape offset on Y axis done")) + self.app.inform.emit('[success] %s...' % _("Geometry shape offset on Y axis done")) return else: - self.app.inform.emit('[success] %s...' % - _("Geometry shape offset on Y axis canceled")) + self.app.inform.emit('[success] %s...' % _("Geometry shape offset on Y axis canceled")) def on_skewx_key(self): val_box = FCInputDialog(title=_("Skew on X axis ..."), @@ -1604,13 +1498,11 @@ class TransformEditorTool(AppTool): val, ok = val_box.get_value() if ok: - self.on_skewx(val=val) - self.app.inform.emit('[success] %s...' % - _("Geometry shape skew on X axis done")) + self.on_skewx(val=val, ref=3) + self.app.inform.emit('[success] %s...' % _("Geometry shape skew on X axis done")) return else: - self.app.inform.emit('[success] %s...' % - _("Geometry shape skew on X axis canceled")) + self.app.inform.emit('[success] %s...' % _("Geometry shape skew on X axis canceled")) def on_skewy_key(self): val_box = FCInputDialog(title=_("Skew on Y axis ..."), @@ -1621,13 +1513,37 @@ class TransformEditorTool(AppTool): val, ok = val_box.get_value() if ok: - self.on_skewx(val=val) - self.app.inform.emit('[success] %s...' % - _("Geometry shape skew on Y axis done")) + self.on_skewx(val=val, ref=3) + self.app.inform.emit('[success] %s...' % _("Geometry shape skew on Y axis done")) return else: - self.app.inform.emit('[success] %s...' % - _("Geometry shape skew on Y axis canceled")) + self.app.inform.emit('[success] %s...' % _("Geometry shape skew on Y axis canceled")) + + @staticmethod + def alt_bounds(shapelist): + """ + Returns coordinates of rectangular bounds of a selection of shapes + """ + + def bounds_rec(lst): + minx = np.Inf + miny = np.Inf + maxx = -np.Inf + maxy = -np.Inf + + try: + for shape in lst: + minx_, miny_, maxx_, maxy_ = bounds_rec(shape) + minx = min(minx, minx_) + miny = min(miny, miny_) + maxx = max(maxx, maxx_) + maxy = max(maxy, maxy_) + return minx, miny, maxx, maxy + except TypeError: + # it's an object, return it's bounds + return lst.bounds() + + return bounds_rec(shapelist) class DrawToolShape(object): @@ -1892,6 +1808,33 @@ class DrawToolShape(object): except AttributeError: log.debug("DrawToolShape.scale() --> Failed to scale. No shape selected") + def buffer(self, value, join=None, factor=None): + """ + Create a buffered geometry + + :param value: the distance to which to buffer + :param join: the type of connections between nearby buffer lines + :param factor: a scaling factor which will do a "sort of" buffer + :return: None + """ + + def buffer_recursion(geom): + if type(geom) == list: + geoms = [] + for local_geom in geom: + geoms.append(buffer_recursion(local_geom)) + return geoms + else: + if factor: + return affinity.scale(geom, xfact=value, yfact=value, origin='center') + else: + return geom.buffer(value, resolution=32, join_style=join) + + try: + self.geo = buffer_recursion(self.geo) + except AttributeError: + log.debug("DrawToolShape.buffer() --> Failed to buffer. No shape selected") + class DrawToolUtilityShape(DrawToolShape): """ @@ -3382,7 +3325,7 @@ class FlatCAMGeoEditor(QtCore.QObject): self.shapes = self.app.plotcanvas.new_shape_collection(layers=1) self.tool_shape = self.app.plotcanvas.new_shape_collection(layers=1) else: - from AppGUI.PlotCanvasLegacy import ShapeCollectionLegacy + from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy self.shapes = ShapeCollectionLegacy(obj=self, app=self.app, name='shapes_geo_editor') self.tool_shape = ShapeCollectionLegacy(obj=self, app=self.app, name='tool_shapes_geo_editor') @@ -3568,14 +3511,14 @@ class FlatCAMGeoEditor(QtCore.QObject): # Remove anything else in the GUI Selected Tab self.app.ui.selected_scroll_area.takeWidget() - # Put ourselves in the AppGUI Selected Tab + # Put ourselves in the appGUI Selected Tab self.app.ui.selected_scroll_area.setWidget(self.geo_edit_widget) # Switch notebook to Selected page self.app.ui.notebook.setCurrentWidget(self.app.ui.selected_tab) def build_ui(self): """ - Build the AppGUI in the Selected Tab for this editor + Build the appGUI in the Selected Tab for this editor :return: """ @@ -3682,7 +3625,7 @@ class FlatCAMGeoEditor(QtCore.QObject): self.item_selected.connect(self.on_geo_elem_selected) - # ## AppGUI Events + # ## appGUI Events self.tw.itemSelectionChanged.connect(self.on_tree_selection_change) # self.tw.keyPressed.connect(self.app.ui.keyPressEvent) # self.tw.customContextMenuRequested.connect(self.on_menu_request) @@ -3745,7 +3688,7 @@ class FlatCAMGeoEditor(QtCore.QObject): pass try: - # ## AppGUI Events + # ## appGUI Events self.tw.itemSelectionChanged.disconnect(self.on_tree_selection_change) # self.tw.keyPressed.connect(self.app.ui.keyPressEvent) # self.tw.customContextMenuRequested.connect(self.on_menu_request) @@ -4659,7 +4602,7 @@ class FlatCAMGeoEditor(QtCore.QObject): def select_tool(self, toolname): """ - Selects a drawing tool. Impacts the object and AppGUI. + Selects a drawing tool. Impacts the object and appGUI. :param toolname: Name of the tool. :return: None diff --git a/AppEditors/FlatCAMGrbEditor.py b/appEditors/FlatCAMGrbEditor.py similarity index 89% rename from AppEditors/FlatCAMGrbEditor.py rename to appEditors/FlatCAMGrbEditor.py index 3ce13f5b..171a3e1e 100644 --- a/AppEditors/FlatCAMGrbEditor.py +++ b/appEditors/FlatCAMGrbEditor.py @@ -18,9 +18,9 @@ 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 appGUI.GUIElements import FCEntry, FCComboBox, FCTable, FCDoubleSpinner, FCSpinner, RadioSet, \ + EvalEntry2, FCInputDialog, FCButton, OptionalInputSection, FCCheckBox, NumericalEvalTupleEntry +from appTool import AppTool import numpy as np from numpy.linalg import norm as numpy_norm @@ -30,7 +30,7 @@ import math # import pngcanvas import traceback import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -2962,7 +2962,7 @@ class FlatCAMGrbEditor(QtCore.QObject): # this var will store the state of the toolbar before starting the editor self.toolbar_old_state = False - # Init AppGUI + # Init appGUI self.apdim_lbl.hide() self.apdim_entry.hide() self.gerber_obj = None @@ -2974,7 +2974,7 @@ class FlatCAMGrbEditor(QtCore.QObject): self.tool_shape = self.canvas.new_shape_collection(layers=1) self.ma_annotation = self.canvas.new_text_group() else: - from AppGUI.PlotCanvasLegacy import ShapeCollectionLegacy + from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy self.shapes = ShapeCollectionLegacy(obj=self, app=self.app, name='shapes_grb_editor') self.tool_shape = ShapeCollectionLegacy(obj=self, app=self.app, name='tool_shapes_grb_editor') self.ma_annotation = ShapeCollectionLegacy( @@ -3146,7 +3146,7 @@ class FlatCAMGrbEditor(QtCore.QObject): tt_aperture = self.sorted_apcode[i] self.tid2apcode[i + 1] = tt_aperture - # Init AppGUI + # Init appGUI self.buffer_distance_entry.set_value(self.app.defaults["gerber_editor_buff_f"]) self.scale_factor_entry.set_value(self.app.defaults["gerber_editor_scale_f"]) @@ -4193,7 +4193,7 @@ class FlatCAMGrbEditor(QtCore.QObject): def on_multiprocessing_finished(self): self.app.proc_container.update_view_text(' %s' % _("Setting up the UI")) - self.app.inform.emit('[success] %s.' % _("Adding geometry finished. Preparing the AppGUI")) + self.app.inform.emit('[success] %s.' % _("Adding geometry finished. Preparing the appGUI")) self.set_ui() self.build_ui(first_run=True) self.plot_all() @@ -5026,7 +5026,7 @@ class FlatCAMGrbEditor(QtCore.QObject): def select_tool(self, toolname): """ - Selects a drawing tool. Impacts the object and AppGUI. + Selects a drawing tool. Impacts the object and appGUI. :param toolname: Name of the tool. :return: None @@ -5303,6 +5303,7 @@ class TransformEditorTool(AppTool): scaleName = _("Scale") flipName = _("Mirror (Flip)") offsetName = _("Offset") + bufferName = _("Buffer") def __init__(self, app, draw_app): AppTool.__init__(self, app) @@ -5311,372 +5312,403 @@ class TransformEditorTool(AppTool): self.draw_app = draw_app self.decimals = self.app.decimals - self.transform_lay = QtWidgets.QVBoxLayout() - self.layout.addLayout(self.transform_lay) - - # Title - title_label = QtWidgets.QLabel("%s %s" % (_('Editor'), self.toolName)) + # ## Title + title_label = QtWidgets.QLabel("%s" % self.toolName) title_label.setStyleSheet(""" - QLabel - { - font-size: 16px; - font-weight: bold; - } - """) - self.transform_lay.addWidget(title_label) + QLabel + { + font-size: 16px; + font-weight: bold; + } + """) + self.layout.addWidget(title_label) + self.layout.addWidget(QtWidgets.QLabel('')) - self.empty_label = QtWidgets.QLabel("") - self.empty_label.setMinimumWidth(50) + # ## Layout + grid0 = QtWidgets.QGridLayout() + self.layout.addLayout(grid0) + grid0.setColumnStretch(0, 0) + grid0.setColumnStretch(1, 1) + grid0.setColumnStretch(2, 0) - self.empty_label1 = QtWidgets.QLabel("") - self.empty_label1.setMinimumWidth(70) - self.empty_label2 = QtWidgets.QLabel("") - self.empty_label2.setMinimumWidth(70) - self.empty_label3 = QtWidgets.QLabel("") - self.empty_label3.setMinimumWidth(70) - self.empty_label4 = QtWidgets.QLabel("") - self.empty_label4.setMinimumWidth(70) - self.transform_lay.addWidget(self.empty_label) + grid0.addWidget(QtWidgets.QLabel('')) - # Rotate Title + # Reference + ref_label = QtWidgets.QLabel('%s:' % _("Reference")) + ref_label.setToolTip( + _("The reference point for Rotate, Skew, Scale, Mirror.\n" + "Can be:\n" + "- Origin -> it is the 0, 0 point\n" + "- Selection -> the center of the bounding box of the selected objects\n" + "- Point -> a custom point defined by X,Y coordinates\n" + "- Min Selection -> the point (minx, miny) of the bounding box of the selection") + ) + self.ref_combo = FCComboBox() + self.ref_items = [_("Origin"), _("Selection"), _("Point"), _("Minimum")] + self.ref_combo.addItems(self.ref_items) + + grid0.addWidget(ref_label, 0, 0) + grid0.addWidget(self.ref_combo, 0, 1, 1, 2) + + self.point_label = QtWidgets.QLabel('%s:' % _("Value")) + self.point_label.setToolTip( + _("A point of reference in format X,Y.") + ) + self.point_entry = NumericalEvalTupleEntry() + + grid0.addWidget(self.point_label, 1, 0) + grid0.addWidget(self.point_entry, 1, 1, 1, 2) + + self.point_button = FCButton(_("Add")) + self.point_button.setToolTip( + _("Add point coordinates from clipboard.") + ) + grid0.addWidget(self.point_button, 2, 0, 1, 3) + + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 5, 0, 1, 3) + + # ## Rotate Title rotate_title_label = QtWidgets.QLabel("%s" % self.rotateName) - self.transform_lay.addWidget(rotate_title_label) + grid0.addWidget(rotate_title_label, 6, 0, 1, 3) - # Layout - form_layout = QtWidgets.QFormLayout() - self.transform_lay.addLayout(form_layout) - form_child = QtWidgets.QHBoxLayout() - - self.rotate_label = QtWidgets.QLabel(_("Angle:")) + self.rotate_label = QtWidgets.QLabel('%s:' % _("Angle")) self.rotate_label.setToolTip( _("Angle for Rotation action, in degrees.\n" "Float number between -360 and 359.\n" "Positive numbers for CW motion.\n" "Negative numbers for CCW motion.") ) - self.rotate_label.setMinimumWidth(50) - self.rotate_entry = FCDoubleSpinner() + self.rotate_entry = FCDoubleSpinner(callback=self.confirmation_message) self.rotate_entry.set_precision(self.decimals) - self.rotate_entry.set_range(-360.0000, 360.0000) - self.rotate_entry.setSingleStep(0.1) + self.rotate_entry.setSingleStep(45) self.rotate_entry.setWrapping(True) + self.rotate_entry.set_range(-360, 360) - self.rotate_button = FCButton() - self.rotate_button.set_value(_("Rotate")) + # self.rotate_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + + self.rotate_button = FCButton(_("Rotate")) self.rotate_button.setToolTip( - _("Rotate the selected shape(s).\n" + _("Rotate the selected object(s).\n" "The point of reference is the middle of\n" - "the bounding box for all selected shapes.") + "the bounding box for all selected objects.") ) - self.rotate_button.setMinimumWidth(60) + self.rotate_button.setMinimumWidth(90) - form_child.addWidget(self.rotate_entry) - form_child.addWidget(self.rotate_button) + grid0.addWidget(self.rotate_label, 7, 0) + grid0.addWidget(self.rotate_entry, 7, 1) + grid0.addWidget(self.rotate_button, 7, 2) - form_layout.addRow(self.rotate_label, form_child) + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 8, 0, 1, 3) - self.transform_lay.addWidget(self.empty_label1) - - # Skew Title + # ## Skew Title skew_title_label = QtWidgets.QLabel("%s" % self.skewName) - self.transform_lay.addWidget(skew_title_label) + grid0.addWidget(skew_title_label, 9, 0, 1, 2) - # Form Layout - form1_layout = QtWidgets.QFormLayout() - self.transform_lay.addLayout(form1_layout) - form1_child_1 = QtWidgets.QHBoxLayout() - form1_child_2 = QtWidgets.QHBoxLayout() + self.skew_link_cb = FCCheckBox() + self.skew_link_cb.setText(_("Link")) + self.skew_link_cb.setToolTip( + _("Link the Y entry to X entry and copy it's content.") + ) - self.skewx_label = QtWidgets.QLabel(_("Angle X:")) + grid0.addWidget(self.skew_link_cb, 9, 2) + + self.skewx_label = QtWidgets.QLabel('%s:' % _("X angle")) self.skewx_label.setToolTip( _("Angle for Skew action, in degrees.\n" - "Float number between -360 and 359.") + "Float number between -360 and 360.") ) - self.skewx_label.setMinimumWidth(50) - self.skewx_entry = FCDoubleSpinner() + self.skewx_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.skewx_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.skewx_entry.set_precision(self.decimals) - self.skewx_entry.set_range(-360.0000, 360.0000) - self.skewx_entry.setSingleStep(0.1) - self.skewx_entry.setWrapping(True) + self.skewx_entry.set_range(-360, 360) - self.skewx_button = FCButton() - self.skewx_button.set_value(_("Skew X")) + self.skewx_button = FCButton(_("Skew X")) self.skewx_button.setToolTip( - _("Skew/shear the selected shape(s).\n" + _("Skew/shear the selected object(s).\n" "The point of reference is the middle of\n" - "the bounding box for all selected shapes.")) - self.skewx_button.setMinimumWidth(60) + "the bounding box for all selected objects.")) + self.skewx_button.setMinimumWidth(90) - self.skewy_label = QtWidgets.QLabel(_("Angle Y:")) + grid0.addWidget(self.skewx_label, 10, 0) + grid0.addWidget(self.skewx_entry, 10, 1) + grid0.addWidget(self.skewx_button, 10, 2) + + self.skewy_label = QtWidgets.QLabel('%s:' % _("Y angle")) self.skewy_label.setToolTip( _("Angle for Skew action, in degrees.\n" - "Float number between -360 and 359.") + "Float number between -360 and 360.") ) - self.skewy_label.setMinimumWidth(50) - self.skewy_entry = FCDoubleSpinner() + self.skewy_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.skewy_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.skewy_entry.set_precision(self.decimals) - self.skewy_entry.set_range(-360.0000, 360.0000) - self.skewy_entry.setSingleStep(0.1) - self.skewy_entry.setWrapping(True) + self.skewy_entry.set_range(-360, 360) - self.skewy_button = FCButton() - self.skewy_button.set_value(_("Skew Y")) + self.skewy_button = FCButton(_("Skew Y")) self.skewy_button.setToolTip( - _("Skew/shear the selected shape(s).\n" + _("Skew/shear the selected object(s).\n" "The point of reference is the middle of\n" - "the bounding box for all selected shapes.")) - self.skewy_button.setMinimumWidth(60) + "the bounding box for all selected objects.")) + self.skewy_button.setMinimumWidth(90) - form1_child_1.addWidget(self.skewx_entry) - form1_child_1.addWidget(self.skewx_button) + grid0.addWidget(self.skewy_label, 12, 0) + grid0.addWidget(self.skewy_entry, 12, 1) + grid0.addWidget(self.skewy_button, 12, 2) - form1_child_2.addWidget(self.skewy_entry) - form1_child_2.addWidget(self.skewy_button) + self.ois_sk = OptionalInputSection(self.skew_link_cb, [self.skewy_label, self.skewy_entry, self.skewy_button], + logic=False) - form1_layout.addRow(self.skewx_label, form1_child_1) - form1_layout.addRow(self.skewy_label, form1_child_2) + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 14, 0, 1, 3) - self.transform_lay.addWidget(self.empty_label2) - - # Scale Title + # ## Scale Title scale_title_label = QtWidgets.QLabel("%s" % self.scaleName) - self.transform_lay.addWidget(scale_title_label) - - # Form Layout - form2_layout = QtWidgets.QFormLayout() - self.transform_lay.addLayout(form2_layout) - form2_child_1 = QtWidgets.QHBoxLayout() - form2_child_2 = QtWidgets.QHBoxLayout() - - self.scalex_label = QtWidgets.QLabel(_("Factor X:")) - self.scalex_label.setToolTip( - _("Factor for Scale action over X axis.") - ) - self.scalex_label.setMinimumWidth(50) - self.scalex_entry = FCDoubleSpinner() - self.scalex_entry.set_precision(self.decimals) - self.scalex_entry.set_range(0.0000, 9999.9999) - self.scalex_entry.setSingleStep(0.1) - self.scalex_entry.setWrapping(True) - - self.scalex_button = FCButton() - self.scalex_button.set_value(_("Scale X")) - self.scalex_button.setToolTip( - _("Scale the selected shape(s).\n" - "The point of reference depends on \n" - "the Scale reference checkbox state.")) - self.scalex_button.setMinimumWidth(60) - - self.scaley_label = QtWidgets.QLabel(_("Factor Y:")) - self.scaley_label.setToolTip( - _("Factor for Scale action over Y axis.") - ) - self.scaley_label.setMinimumWidth(50) - self.scaley_entry = FCDoubleSpinner() - self.scaley_entry.set_precision(self.decimals) - self.scaley_entry.set_range(0.0000, 9999.9999) - self.scaley_entry.setSingleStep(0.1) - self.scaley_entry.setWrapping(True) - - self.scaley_button = FCButton() - self.scaley_button.set_value(_("Scale Y")) - self.scaley_button.setToolTip( - _("Scale the selected shape(s).\n" - "The point of reference depends on \n" - "the Scale reference checkbox state.")) - self.scaley_button.setMinimumWidth(60) + grid0.addWidget(scale_title_label, 15, 0, 1, 2) self.scale_link_cb = FCCheckBox() - self.scale_link_cb.set_value(True) self.scale_link_cb.setText(_("Link")) self.scale_link_cb.setToolTip( - _("Scale the selected shape(s)\n" - "using the Scale Factor X for both axis.")) - self.scale_link_cb.setMinimumWidth(50) - - self.scale_zero_ref_cb = FCCheckBox() - self.scale_zero_ref_cb.set_value(True) - self.scale_zero_ref_cb.setText(_("Scale Reference")) - self.scale_zero_ref_cb.setToolTip( - _("Scale the selected shape(s)\n" - "using the origin reference when checked,\n" - "and the center of the biggest bounding box\n" - "of the selected shapes when unchecked.")) - - form2_child_1.addWidget(self.scalex_entry) - form2_child_1.addWidget(self.scalex_button) - - form2_child_2.addWidget(self.scaley_entry) - form2_child_2.addWidget(self.scaley_button) - - form2_layout.addRow(self.scalex_label, form2_child_1) - form2_layout.addRow(self.scaley_label, form2_child_2) - form2_layout.addRow(self.scale_link_cb, self.scale_zero_ref_cb) - self.ois_scale = OptionalInputSection(self.scale_link_cb, [self.scaley_entry, self.scaley_button], - logic=False) - - self.transform_lay.addWidget(self.empty_label3) - - # Offset Title - offset_title_label = QtWidgets.QLabel("%s" % self.offsetName) - self.transform_lay.addWidget(offset_title_label) - - # Form Layout - form3_layout = QtWidgets.QFormLayout() - self.transform_lay.addLayout(form3_layout) - form3_child_1 = QtWidgets.QHBoxLayout() - form3_child_2 = QtWidgets.QHBoxLayout() - - self.offx_label = QtWidgets.QLabel(_("Value X:")) - self.offx_label.setToolTip( - _("Value for Offset action on X axis.") + _("Link the Y entry to X entry and copy it's content.") ) - self.offx_label.setMinimumWidth(50) - self.offx_entry = FCDoubleSpinner() - self.offx_entry.set_precision(self.decimals) - self.offx_entry.set_range(-9999.9999, 9999.9999) - self.offx_entry.setSingleStep(0.1) - self.offx_entry.setWrapping(True) - self.offx_button = FCButton() - self.offx_button.set_value(_("Offset X")) - self.offx_button.setToolTip( - _("Offset the selected shape(s).\n" - "The point of reference is the middle of\n" - "the bounding box for all selected shapes.\n") + grid0.addWidget(self.scale_link_cb, 15, 2) + + self.scalex_label = QtWidgets.QLabel('%s:' % _("X factor")) + self.scalex_label.setToolTip( + _("Factor for scaling on X axis.") ) - self.offx_button.setMinimumWidth(60) + self.scalex_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.scalex_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + self.scalex_entry.set_precision(self.decimals) + self.scalex_entry.setMinimum(-1e6) - self.offy_label = QtWidgets.QLabel(_("Value Y:")) - self.offy_label.setToolTip( - _("Value for Offset action on Y axis.") + self.scalex_button = FCButton(_("Scale X")) + self.scalex_button.setToolTip( + _("Scale the selected object(s).\n" + "The point of reference depends on \n" + "the Scale reference checkbox state.")) + self.scalex_button.setMinimumWidth(90) + + grid0.addWidget(self.scalex_label, 17, 0) + grid0.addWidget(self.scalex_entry, 17, 1) + grid0.addWidget(self.scalex_button, 17, 2) + + self.scaley_label = QtWidgets.QLabel('%s:' % _("Y factor")) + self.scaley_label.setToolTip( + _("Factor for scaling on Y axis.") ) - self.offy_label.setMinimumWidth(50) - self.offy_entry = FCDoubleSpinner() - self.offy_entry.set_precision(self.decimals) - self.offy_entry.set_range(-9999.9999, 9999.9999) - self.offy_entry.setSingleStep(0.1) - self.offy_entry.setWrapping(True) + self.scaley_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.scaley_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + self.scaley_entry.set_precision(self.decimals) + self.scaley_entry.setMinimum(-1e6) - self.offy_button = FCButton() - self.offy_button.set_value(_("Offset Y")) - self.offy_button.setToolTip( - _("Offset the selected shape(s).\n" - "The point of reference is the middle of\n" - "the bounding box for all selected shapes.\n") - ) - self.offy_button.setMinimumWidth(60) + self.scaley_button = FCButton(_("Scale Y")) + self.scaley_button.setToolTip( + _("Scale the selected object(s).\n" + "The point of reference depends on \n" + "the Scale reference checkbox state.")) + self.scaley_button.setMinimumWidth(90) - form3_child_1.addWidget(self.offx_entry) - form3_child_1.addWidget(self.offx_button) + grid0.addWidget(self.scaley_label, 19, 0) + grid0.addWidget(self.scaley_entry, 19, 1) + grid0.addWidget(self.scaley_button, 19, 2) - form3_child_2.addWidget(self.offy_entry) - form3_child_2.addWidget(self.offy_button) + self.ois_s = OptionalInputSection(self.scale_link_cb, + [ + self.scaley_label, + self.scaley_entry, + self.scaley_button + ], logic=False) - form3_layout.addRow(self.offx_label, form3_child_1) - form3_layout.addRow(self.offy_label, form3_child_2) + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 21, 0, 1, 3) - self.transform_lay.addWidget(self.empty_label4) - - # Flip Title + # ## Flip Title flip_title_label = QtWidgets.QLabel("%s" % self.flipName) - self.transform_lay.addWidget(flip_title_label) + grid0.addWidget(flip_title_label, 23, 0, 1, 3) - # Form Layout - form4_layout = QtWidgets.QFormLayout() - form4_child_hlay = QtWidgets.QHBoxLayout() - self.transform_lay.addLayout(form4_child_hlay) - self.transform_lay.addLayout(form4_layout) - form4_child_1 = QtWidgets.QHBoxLayout() - - self.flipx_button = FCButton() - self.flipx_button.set_value(_("Flip on X")) + self.flipx_button = FCButton(_("Flip on X")) self.flipx_button.setToolTip( - _("Flip the selected shape(s) over the X axis.\n" - "Does not create a new shape.") + _("Flip the selected object(s) over the X axis.") ) - self.flipy_button = FCButton() - self.flipy_button.set_value(_("Flip on Y")) + self.flipy_button = FCButton(_("Flip on Y")) self.flipy_button.setToolTip( - _("Flip the selected shape(s) over the X axis.\n" - "Does not create a new shape.") + _("Flip the selected object(s) over the X axis.") ) - self.flip_ref_cb = FCCheckBox() - self.flip_ref_cb.set_value(True) - self.flip_ref_cb.setText(_("Ref Pt")) - self.flip_ref_cb.setToolTip( - _("Flip the selected shape(s)\n" - "around the point in Point Entry Field.\n" - "\n" - "The point coordinates can be captured by\n" - "left click on canvas together with pressing\n" - "SHIFT key. \n" - "Then click Add button to insert coordinates.\n" - "Or enter the coords in format (x, y) in the\n" - "Point Entry field and click Flip on X(Y)") + hlay0 = QtWidgets.QHBoxLayout() + grid0.addLayout(hlay0, 25, 0, 1, 3) + + hlay0.addWidget(self.flipx_button) + hlay0.addWidget(self.flipy_button) + + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 27, 0, 1, 3) + + # ## Offset Title + offset_title_label = QtWidgets.QLabel("%s" % self.offsetName) + grid0.addWidget(offset_title_label, 29, 0, 1, 3) + + self.offx_label = QtWidgets.QLabel('%s:' % _("X val")) + self.offx_label.setToolTip( + _("Distance to offset on X axis. In current units.") ) - self.flip_ref_cb.setMinimumWidth(50) + self.offx_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.offx_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + self.offx_entry.set_precision(self.decimals) + self.offx_entry.setMinimum(-1e6) - self.flip_ref_label = QtWidgets.QLabel(_("Point:")) - self.flip_ref_label.setToolTip( - _("Coordinates in format (x, y) used as reference for mirroring.\n" - "The 'x' in (x, y) will be used when using Flip on X and\n" - "the 'y' in (x, y) will be used when using Flip on Y.") + self.offx_button = FCButton(_("Offset X")) + self.offx_button.setToolTip( + _("Offset the selected object(s).\n" + "The point of reference is the middle of\n" + "the bounding box for all selected objects.\n")) + self.offx_button.setMinimumWidth(90) + + grid0.addWidget(self.offx_label, 31, 0) + grid0.addWidget(self.offx_entry, 31, 1) + grid0.addWidget(self.offx_button, 31, 2) + + self.offy_label = QtWidgets.QLabel('%s:' % _("Y val")) + self.offy_label.setToolTip( + _("Distance to offset on Y axis. In current units.") ) - self.flip_ref_label.setMinimumWidth(50) - self.flip_ref_entry = FCEntry() - self.flip_ref_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) - # self.flip_ref_entry.setFixedWidth(60) + self.offy_entry = FCDoubleSpinner(callback=self.confirmation_message) + # self.offy_entry.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) + self.offy_entry.set_precision(self.decimals) + self.offy_entry.setMinimum(-1e6) - self.flip_ref_button = FCButton() - self.flip_ref_button.set_value(_("Add")) - self.flip_ref_button.setToolTip( - _("The point coordinates can be captured by\n" - "left click on canvas together with pressing\n" - "SHIFT key. Then click Add button to insert.") + self.offy_button = FCButton(_("Offset Y")) + self.offy_button.setToolTip( + _("Offset the selected object(s).\n" + "The point of reference is the middle of\n" + "the bounding box for all selected objects.\n")) + self.offy_button.setMinimumWidth(90) + + grid0.addWidget(self.offy_label, 32, 0) + grid0.addWidget(self.offy_entry, 32, 1) + grid0.addWidget(self.offy_button, 32, 2) + + separator_line = QtWidgets.QFrame() + separator_line.setFrameShape(QtWidgets.QFrame.HLine) + separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) + grid0.addWidget(separator_line, 34, 0, 1, 3) + + # ## Buffer Title + buffer_title_label = QtWidgets.QLabel("%s" % self.bufferName) + grid0.addWidget(buffer_title_label, 35, 0, 1, 2) + + self.buffer_rounded_cb = FCCheckBox('%s' % _("Rounded")) + self.buffer_rounded_cb.setToolTip( + _("If checked then the buffer will surround the buffered shape,\n" + "every corner will be rounded.\n" + "If not checked then the buffer will follow the exact geometry\n" + "of the buffered shape.") ) - self.flip_ref_button.setMinimumWidth(60) - form4_child_hlay.addWidget(self.flipx_button) - form4_child_hlay.addWidget(self.flipy_button) + grid0.addWidget(self.buffer_rounded_cb, 35, 2) - form4_child_1.addWidget(self.flip_ref_entry) - form4_child_1.addWidget(self.flip_ref_button) + self.buffer_label = QtWidgets.QLabel('%s:' % _("Distance")) + self.buffer_label.setToolTip( + _("A positive value will create the effect of dilation,\n" + "while a negative value will create the effect of erosion.\n" + "Each geometry element of the object will be increased\n" + "or decreased with the 'distance'.") + ) - form4_layout.addRow(self.flip_ref_cb) - form4_layout.addRow(self.flip_ref_label, form4_child_1) - self.ois_flip = OptionalInputSection(self.flip_ref_cb, - [self.flip_ref_entry, self.flip_ref_button], logic=True) + self.buffer_entry = FCDoubleSpinner(callback=self.confirmation_message) + self.buffer_entry.set_precision(self.decimals) + self.buffer_entry.setSingleStep(0.1) + self.buffer_entry.setWrapping(True) + self.buffer_entry.set_range(-9999.9999, 9999.9999) - self.transform_lay.addStretch() + self.buffer_button = FCButton(_("Buffer D")) + self.buffer_button.setToolTip( + _("Create the buffer effect on each geometry,\n" + "element from the selected object, using the distance.") + ) + self.buffer_button.setMinimumWidth(90) + + grid0.addWidget(self.buffer_label, 37, 0) + grid0.addWidget(self.buffer_entry, 37, 1) + grid0.addWidget(self.buffer_button, 37, 2) + + self.buffer_factor_label = QtWidgets.QLabel('%s:' % _("Value")) + self.buffer_factor_label.setToolTip( + _("A positive value will create the effect of dilation,\n" + "while a negative value will create the effect of erosion.\n" + "Each geometry element of the object will be increased\n" + "or decreased to fit the 'Value'. Value is a percentage\n" + "of the initial dimension.") + ) + + self.buffer_factor_entry = FCDoubleSpinner(callback=self.confirmation_message, suffix='%') + self.buffer_factor_entry.set_range(-100.0000, 1000.0000) + self.buffer_factor_entry.set_precision(self.decimals) + self.buffer_factor_entry.setWrapping(True) + self.buffer_factor_entry.setSingleStep(1) + + self.buffer_factor_button = FCButton(_("Buffer F")) + self.buffer_factor_button.setToolTip( + _("Create the buffer effect on each geometry,\n" + "element from the selected object, using the factor.") + ) + self.buffer_factor_button.setMinimumWidth(90) + + grid0.addWidget(self.buffer_factor_label, 38, 0) + grid0.addWidget(self.buffer_factor_entry, 38, 1) + grid0.addWidget(self.buffer_factor_button, 38, 2) + + grid0.addWidget(QtWidgets.QLabel(''), 42, 0, 1, 3) + + self.layout.addStretch() # Signals + self.ref_combo.currentIndexChanged.connect(self.on_reference_changed) + self.point_button.clicked.connect(self.on_add_coords) + self.rotate_button.clicked.connect(self.on_rotate) + self.skewx_button.clicked.connect(self.on_skewx) self.skewy_button.clicked.connect(self.on_skewy) + self.scalex_button.clicked.connect(self.on_scalex) self.scaley_button.clicked.connect(self.on_scaley) + self.offx_button.clicked.connect(self.on_offx) self.offy_button.clicked.connect(self.on_offy) + self.flipx_button.clicked.connect(self.on_flipx) self.flipy_button.clicked.connect(self.on_flipy) - self.flip_ref_button.clicked.connect(self.on_flip_add_coords) - self.rotate_entry.editingFinished.connect(self.on_rotate) - self.skewx_entry.editingFinished.connect(self.on_skewx) - self.skewy_entry.editingFinished.connect(self.on_skewy) - self.scalex_entry.editingFinished.connect(self.on_scalex) - self.scaley_entry.editingFinished.connect(self.on_scaley) - self.offx_entry.editingFinished.connect(self.on_offx) - self.offy_entry.editingFinished.connect(self.on_offy) + self.buffer_button.clicked.connect(self.on_buffer_by_distance) + self.buffer_factor_button.clicked.connect(self.on_buffer_by_factor) + + # self.rotate_entry.editingFinished.connect(self.on_rotate) + # self.skewx_entry.editingFinished.connect(self.on_skewx) + # self.skewy_entry.editingFinished.connect(self.on_skewy) + # self.scalex_entry.editingFinished.connect(self.on_scalex) + # self.scaley_entry.editingFinished.connect(self.on_scaley) + # self.offx_entry.editingFinished.connect(self.on_offx) + # self.offy_entry.editingFinished.connect(self.on_offy) self.set_tool_ui() def run(self, toggle=True): - self.app.defaults.report_usage("Geo Editor Transform Tool()") + self.app.defaults.report_usage("Gerber Editor Transform Tool()") # if the splitter is hidden, display it, else hide it but only if the current widget is the same if self.app.ui.splitter.sizes()[0] == 0: @@ -5701,60 +5733,32 @@ class TransformEditorTool(AppTool): def set_tool_ui(self): # Initialize form - if self.app.defaults["tools_transform_rotate"]: - self.rotate_entry.set_value(self.app.defaults["tools_transform_rotate"]) - else: - self.rotate_entry.set_value(0.0) + ref_val = self.app.defaults["tools_transform_reference"] + if ref_val == _("Object"): + ref_val = _("Selection") + self.ref_combo.set_value(ref_val) + self.point_entry.set_value(self.app.defaults["tools_transform_ref_point"]) + self.rotate_entry.set_value(self.app.defaults["tools_transform_rotate"]) - if self.app.defaults["tools_transform_skew_x"]: - self.skewx_entry.set_value(self.app.defaults["tools_transform_skew_x"]) - else: - self.skewx_entry.set_value(0.0) + self.skewx_entry.set_value(self.app.defaults["tools_transform_skew_x"]) + self.skewy_entry.set_value(self.app.defaults["tools_transform_skew_y"]) + self.skew_link_cb.set_value(self.app.defaults["tools_transform_skew_link"]) - if self.app.defaults["tools_transform_skew_y"]: - self.skewy_entry.set_value(self.app.defaults["tools_transform_skew_y"]) - else: - self.skewy_entry.set_value(0.0) + self.scalex_entry.set_value(self.app.defaults["tools_transform_scale_x"]) + self.scaley_entry.set_value(self.app.defaults["tools_transform_scale_y"]) + self.scale_link_cb.set_value(self.app.defaults["tools_transform_scale_link"]) - if self.app.defaults["tools_transform_scale_x"]: - self.scalex_entry.set_value(self.app.defaults["tools_transform_scale_x"]) - else: - self.scalex_entry.set_value(1.0) + self.offx_entry.set_value(self.app.defaults["tools_transform_offset_x"]) + self.offy_entry.set_value(self.app.defaults["tools_transform_offset_y"]) - if self.app.defaults["tools_transform_scale_y"]: - self.scaley_entry.set_value(self.app.defaults["tools_transform_scale_y"]) - else: - self.scaley_entry.set_value(1.0) + self.buffer_entry.set_value(self.app.defaults["tools_transform_buffer_dis"]) + self.buffer_factor_entry.set_value(self.app.defaults["tools_transform_buffer_factor"]) + self.buffer_rounded_cb.set_value(self.app.defaults["tools_transform_buffer_corner"]) - if self.app.defaults["tools_transform_scale_link"]: - self.scale_link_cb.set_value(self.app.defaults["tools_transform_scale_link"]) - else: - self.scale_link_cb.set_value(True) - - if self.app.defaults["tools_transform_scale_reference"]: - self.scale_zero_ref_cb.set_value(self.app.defaults["tools_transform_scale_reference"]) - else: - self.scale_zero_ref_cb.set_value(True) - - if self.app.defaults["tools_transform_offset_x"]: - self.offx_entry.set_value(self.app.defaults["tools_transform_offset_x"]) - else: - self.offx_entry.set_value(0.0) - - if self.app.defaults["tools_transform_offset_y"]: - self.offy_entry.set_value(self.app.defaults["tools_transform_offset_y"]) - else: - self.offy_entry.set_value(0.0) - - if self.app.defaults["tools_transform_mirror_reference"]: - self.flip_ref_cb.set_value(self.app.defaults["tools_transform_mirror_reference"]) - else: - self.flip_ref_cb.set_value(False) - - if self.app.defaults["tools_transform_mirror_point"]: - self.flip_ref_entry.set_value(self.app.defaults["tools_transform_mirror_point"]) - else: - self.flip_ref_entry.set_value("0, 0") + # initial state is hidden + self.point_label.hide() + self.point_entry.hide() + self.point_button.hide() def template(self): if not self.draw_app.selected: @@ -5767,214 +5771,214 @@ class TransformEditorTool(AppTool): self.app.ui.splitter.setSizes([0, 1]) - def on_rotate(self, sig=None, val=None): - if val: - value = val + def on_reference_changed(self, index): + if index == 0 or index == 1: # "Origin" or "Selection" reference + self.point_label.hide() + self.point_entry.hide() + self.point_button.hide() + + elif index == 2: # "Point" reference + self.point_label.show() + self.point_entry.show() + self.point_button.show() + + def on_calculate_reference(self, ref_index=None): + if ref_index: + ref_val = ref_index else: - value = float(self.rotate_entry.get_value()) + ref_val = self.ref_combo.currentIndex() - self.app.worker_task.emit({'fcn': self.on_rotate_action, - 'params': [value]}) - # self.on_rotate_action(value) - return + if ref_val == 0: # "Origin" reference + return 0, 0 + elif ref_val == 1: # "Selection" reference + sel_list = self.draw_app.selected + if sel_list: + xmin, ymin, xmax, ymax = self.alt_bounds(sel_list) + px = (xmax + xmin) * 0.5 + py = (ymax + ymin) * 0.5 + return px, py + else: + self.app.inform.emit('[ERROR_NOTCL] %s' % _("No shape selected.")) + return "fail" + elif ref_val == 2: # "Point" reference + point_val = self.point_entry.get_value() + try: + px, py = eval('{}'.format(point_val)) + return px, py + except Exception: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Incorrect format for Point value. Needs format X,Y")) + return "fail" + else: + sel_list = self.draw_app.selected + if sel_list: + xmin, ymin, xmax, ymax = self.alt_bounds(sel_list) + if ref_val == 3: + return xmin, ymin # lower left corner + elif ref_val == 4: + return xmax, ymin # lower right corner + elif ref_val == 5: + return xmax, ymax # upper right corner + else: + return xmin, ymax # upper left corner + else: + self.app.inform.emit('[ERROR_NOTCL] %s' % _("No shape selected.")) + return "fail" - def on_flipx(self): - # self.on_flip("Y") - axis = 'Y' - self.app.worker_task.emit({'fcn': self.on_flip, - 'params': [axis]}) - return - - def on_flipy(self): - # self.on_flip("X") - axis = 'X' - self.app.worker_task.emit({'fcn': self.on_flip, - 'params': [axis]}) - return - - def on_flip_add_coords(self): + def on_add_coords(self): val = self.app.clipboard.text() - self.flip_ref_entry.set_value(val) + self.point_entry.set_value(val) - def on_skewx(self, sig=None, val=None): - """ + def on_rotate(self, sig=None, val=None, ref=None): + value = float(self.rotate_entry.get_value()) if val is None else val + if value == 0: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Rotate transformation can not be done for a value of 0.")) + return + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return + self.app.worker_task.emit({'fcn': self.on_rotate_action, 'params': [value, point]}) - :param sig: here we can get the value passed by the signal - :param val: the amount to skew on the X axis - :return: - """ - if val: - value = val - else: - value = float(self.skewx_entry.get_value()) - - # self.on_skew("X", value) - axis = 'X' - self.app.worker_task.emit({'fcn': self.on_skew, - 'params': [axis, value]}) - return - - def on_skewy(self, sig=None, val=None): - """ - - :param sig: here we can get the value passed by the signal - :param val: the amount to sckew on the Y axis - :return: - """ - if val: - value = val - else: - value = float(self.skewy_entry.get_value()) - - # self.on_skew("Y", value) + def on_flipx(self, signal=None, ref=None): axis = 'Y' - self.app.worker_task.emit({'fcn': self.on_skew, - 'params': [axis, value]}) - return + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return + self.app.worker_task.emit({'fcn': self.on_flip, 'params': [axis, point]}) - def on_scalex(self, sig=None, val=None): - """ + def on_flipy(self, signal=None, ref=None): + axis = 'X' + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return + self.app.worker_task.emit({'fcn': self.on_flip, 'params': [axis, point]}) - :param sig: here we can get the value passed by the signal - :param val: the amount to scale on the X axis - :return: - """ - if val: - x_value = val + def on_skewx(self, signal=None, val=None, ref=None): + xvalue = float(self.skewx_entry.get_value()) if val is None else val + + if xvalue == 0: + return + + if self.skew_link_cb.get_value(): + yvalue = xvalue else: - x_value = float(self.scalex_entry.get_value()) + yvalue = 0 + + axis = 'X' + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return + + self.app.worker_task.emit({'fcn': self.on_skew, 'params': [axis, xvalue, yvalue, point]}) + + def on_skewy(self, signal=None, val=None, ref=None): + xvalue = 0 + yvalue = float(self.skewy_entry.get_value()) if val is None else val + + if yvalue == 0: + return + + axis = 'Y' + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return + + self.app.worker_task.emit({'fcn': self.on_skew, 'params': [axis, xvalue, yvalue, point]}) + + def on_scalex(self, signal=None, val=None, ref=None): + xvalue = float(self.scalex_entry.get_value()) if val is None else val + + if xvalue == 0 or xvalue == 1: + self.app.inform.emit('[WARNING_NOTCL] %s' % + _("Scale transformation can not be done for a factor of 0 or 1.")) + return - # scaling to zero has no sense so we remove it, because scaling with 1 does nothing - if x_value == 0: - x_value = 1 if self.scale_link_cb.get_value(): - y_value = x_value + yvalue = xvalue else: - y_value = 1 + yvalue = 1 axis = 'X' - point = (0, 0) - if self.scale_zero_ref_cb.get_value(): - self.app.worker_task.emit({'fcn': self.on_scale, - 'params': [axis, x_value, y_value, point]}) - # self.on_scale("X", xvalue, yvalue, point=(0,0)) - else: - # self.on_scale("X", xvalue, yvalue) - self.app.worker_task.emit({'fcn': self.on_scale, - 'params': [axis, x_value, y_value]}) + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return - def on_scaley(self, sig=None, val=None): - """ + self.app.worker_task.emit({'fcn': self.on_scale, 'params': [axis, xvalue, yvalue, point]}) - :param sig: here we can get the value passed by the signal - :param val: the amount to scale on the Y axis - :return: - """ - x_value = 1 - if val: - y_value = val - else: - y_value = float(self.scaley_entry.get_value()) + def on_scaley(self, signal=None, val=None, ref=None): + xvalue = 1 + yvalue = float(self.scaley_entry.get_value()) if val is None else val - # scaling to zero has no sense so we remove it, because scaling with 1 does nothing - if y_value == 0: - y_value = 1 + if yvalue == 0 or yvalue == 1: + self.app.inform.emit('[WARNING_NOTCL] %s' % + _("Scale transformation can not be done for a factor of 0 or 1.")) + return axis = 'Y' - point = (0, 0) - if self.scale_zero_ref_cb.get_value(): - self.app.worker_task.emit({'fcn': self.on_scale, - 'params': [axis, x_value, y_value, point]}) - # self.on_scale("Y", xvalue, yvalue, point=(0,0)) - else: - # self.on_scale("Y", xvalue, yvalue) - self.app.worker_task.emit({'fcn': self.on_scale, - 'params': [axis, x_value, y_value]}) + point = self.on_calculate_reference() if ref is None else self.on_calculate_reference(ref_index=ref) + if point == 'fail': + return - return + self.app.worker_task.emit({'fcn': self.on_scale, 'params': [axis, xvalue, yvalue, point]}) - def on_offx(self, sig=None, val=None): - """ - - :param sig: here we can get the value passed by the signal - :param val: the amount to offset on the X axis - :return: - """ - if val: - value = val - else: - value = float(self.offx_entry.get_value()) - - # self.on_offset("X", value) + def on_offx(self, signal=None, val=None): + value = float(self.offx_entry.get_value()) if val is None else val + if value == 0: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Offset transformation can not be done for a value of 0.")) + return axis = 'X' - self.app.worker_task.emit({'fcn': self.on_offset, - 'params': [axis, value]}) - def on_offy(self, sig=None, val=None): - """ + self.app.worker_task.emit({'fcn': self.on_offset, 'params': [axis, value]}) - :param sig: here we can get the value passed by the signal - :param val: the amount to offset on the Y axis - :return: - """ - if val: - value = val - else: - value = float(self.offy_entry.get_value()) - - # self.on_offset("Y", value) + def on_offy(self, signal=None, val=None): + value = float(self.offy_entry.get_value()) if val is None else val + if value == 0: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("Offset transformation can not be done for a value of 0.")) + return axis = 'Y' - self.app.worker_task.emit({'fcn': self.on_offset, - 'params': [axis, value]}) - return - def on_rotate_action(self, num): + self.app.worker_task.emit({'fcn': self.on_offset, 'params': [axis, value]}) + + def on_buffer_by_distance(self): + value = self.buffer_entry.get_value() + join = 1 if self.buffer_rounded_cb.get_value() else 2 + + self.app.worker_task.emit({'fcn': self.on_buffer_action, 'params': [value, join]}) + + def on_buffer_by_factor(self): + value = 1 + (self.buffer_factor_entry.get_value() / 100.0) + join = 1 if self.buffer_rounded_cb.get_value() else 2 + + # tell the buffer method to use the factor + factor = True + + self.app.worker_task.emit({'fcn': self.on_buffer_action, 'params': [value, join, factor]}) + + def on_rotate_action(self, val, point): """ + Rotate geometry - :param num: the angle by which to rotate + :param num: Rotate with a known angle value, val + :param point: Reference point for rotation: tuple :return: """ + elem_list = self.draw_app.selected - xminlist = [] - yminlist = [] - xmaxlist = [] - ymaxlist = [] + px, py = point if not elem_list: - self.app.inform.emit('[WARNING_NOTCL] %s' % - _("No shape selected. Please Select a shape to rotate!")) + self.app.inform.emit('[WARNING_NOTCL] %s' %_("No shape selected.")) return with self.app.proc_container.new(_("Appying Rotate")): try: - # first get a bounding box to fit all; we use only the 'solids' as those should provide the biggest - # bounding box - for el_shape in elem_list: - el = el_shape.geo - if 'solid' in el: - xmin, ymin, xmax, ymax = el['solid'].bounds - xminlist.append(xmin) - yminlist.append(ymin) - xmaxlist.append(xmax) - ymaxlist.append(ymax) - - # get the minimum x,y and maximum x,y for all objects selected - xminimal = min(xminlist) - yminimal = min(yminlist) - xmaximal = max(xmaxlist) - ymaximal = max(ymaxlist) - - px = 0.5 * (xminimal + xmaximal) - py = 0.5 * (yminimal + ymaximal) - for sel_el_shape in elem_list: sel_el = sel_el_shape.geo if 'solid' in sel_el: - sel_el['solid'] = affinity.rotate(sel_el['solid'], angle=-num, origin=(px, py)) + sel_el['solid'] = affinity.rotate(sel_el['solid'], angle=-val, origin=(px, py)) if 'follow' in sel_el: - sel_el['follow'] = affinity.rotate(sel_el['follow'], angle=-num, origin=(px, py)) + sel_el['follow'] = affinity.rotate(sel_el['follow'], angle=-val, origin=(px, py)) if 'clear' in sel_el: - sel_el['clear'] = affinity.rotate(sel_el['clear'], angle=-num, origin=(px, py)) + sel_el['clear'] = affinity.rotate(sel_el['clear'], angle=-val, origin=(px, py)) self.draw_app.plot_all() self.app.inform.emit('[success] %s' % _("Done. Rotate completed.")) @@ -5982,50 +5986,24 @@ class TransformEditorTool(AppTool): self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Rotation action was not executed."), str(e))) return - def on_flip(self, axis): + def on_flip(self, axis, point): """ + Mirror (flip) geometry - :param axis: axis to be used as reference for mirroring(flip) + :param axis: Mirror on a known axis given by the axis parameter + :param point: Mirror reference point :return: """ + elem_list = self.draw_app.selected - xminlist = [] - yminlist = [] - xmaxlist = [] - ymaxlist = [] + px, py = point if not elem_list: - self.app.inform.emit('[WARNING_NOTCL] %s' % - _("No shape selected. Please Select a shape to flip!")) + self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected.")) return with self.app.proc_container.new(_("Applying Flip")): try: - # get mirroring coords from the point entry - if self.flip_ref_cb.isChecked(): - px, py = eval('{}'.format(self.flip_ref_entry.text())) - # get mirroing coords from the center of an all-enclosing bounding box - else: - # first get a bounding box to fit all; we use only the 'solids' as those should provide the biggest - # bounding box - for el_shape in elem_list: - el = el_shape.geo - if 'solid' in el: - xmin, ymin, xmax, ymax = el['solid'].bounds - xminlist.append(xmin) - yminlist.append(ymin) - xmaxlist.append(xmax) - ymaxlist.append(ymax) - - # get the minimum x,y and maximum x,y for all objects selected - xminimal = min(xminlist) - yminimal = min(yminlist) - xmaximal = max(xmaxlist) - ymaximal = max(ymaxlist) - - px = 0.5 * (xminimal + xmaximal) - py = 0.5 * (yminimal + ymaximal) - # execute mirroring for sel_el_shape in elem_list: sel_el = sel_el_shape.geo @@ -6036,8 +6014,7 @@ class TransformEditorTool(AppTool): sel_el['follow'] = affinity.scale(sel_el['follow'], xfact=1, yfact=-1, origin=(px, py)) if 'clear' in sel_el: sel_el['clear'] = affinity.scale(sel_el['clear'], xfact=1, yfact=-1, origin=(px, py)) - self.app.inform.emit('[success] %s...' % - _('Flip on the Y axis done')) + self.app.inform.emit('[success] %s...' % _('Flip on the Y axis done')) elif axis == 'Y': if 'solid' in sel_el: sel_el['solid'] = affinity.scale(sel_el['solid'], xfact=-1, yfact=1, origin=(px, py)) @@ -6045,117 +6022,72 @@ class TransformEditorTool(AppTool): sel_el['follow'] = affinity.scale(sel_el['follow'], xfact=-1, yfact=1, origin=(px, py)) if 'clear' in sel_el: sel_el['clear'] = affinity.scale(sel_el['clear'], xfact=-1, yfact=1, origin=(px, py)) - 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.draw_app.plot_all() except Exception as e: - self.app.inform.emit('[ERROR_NOTCL] %s: %s' % - (_("Flip action was not executed."), str(e))) + self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Flip action was not executed."), str(e))) return - def on_skew(self, axis, num): + def on_skew(self, axis, xval, yval, point): """ + Skew geometry - :param axis: axis by which to do the skeweing - :param num: angle value for skew + :param axis: Axis on which to deform, skew + :param xval: Skew value on X axis + :param yval: Skew value on Y axis + :param point: Point of reference for deformation: tuple :return: """ elem_list = self.draw_app.selected - xminlist = [] - yminlist = [] + px, py = point if not elem_list: - self.app.inform.emit('[WARNING_NOTCL] %s' % - _("No shape selected. Please Select a shape to shear/skew!")) + self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected.")) return - else: - with self.app.proc_container.new(_("Applying Skew")): - try: - # first get a bounding box to fit all; we use only the 'solids' as those should provide the biggest - # bounding box - for el_shape in elem_list: - el = el_shape.geo - if 'solid' in el: - xmin, ymin, xmax, ymax = el['solid'].bounds - xminlist.append(xmin) - yminlist.append(ymin) - # get the minimum x,y and maximum x,y for all objects selected - xminimal = min(xminlist) - yminimal = min(yminlist) + with self.app.proc_container.new(_("Applying Skew")): + try: - for sel_el_shape in elem_list: - sel_el = sel_el_shape.geo - if axis == 'X': - if 'solid' in sel_el: - sel_el['solid'] = affinity.skew(sel_el['solid'], num, 0, origin=(xminimal, yminimal)) - if 'follow' in sel_el: - sel_el['follow'] = affinity.skew(sel_el['follow'], num, 0, origin=(xminimal, yminimal)) - if 'clear' in sel_el: - sel_el['clear'] = affinity.skew(sel_el['clear'], num, 0, origin=(xminimal, yminimal)) - elif axis == 'Y': - if 'solid' in sel_el: - sel_el['solid'] = affinity.skew(sel_el['solid'], 0, num, origin=(xminimal, yminimal)) - if 'follow' in sel_el: - sel_el['follow'] = affinity.skew(sel_el['follow'], 0, num, origin=(xminimal, yminimal)) - if 'clear' in sel_el: - sel_el['clear'] = affinity.skew(sel_el['clear'], 0, num, origin=(xminimal, yminimal)) - self.draw_app.plot_all() + for sel_el_shape in elem_list: + sel_el = sel_el_shape.geo - if str(axis) == 'X': - 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')) - except Exception as e: - self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed."), str(e))) - return + if 'solid' in sel_el: + sel_el['solid'] = affinity.skew(sel_el['solid'], xval, yval, origin=(px, py)) + if 'follow' in sel_el: + sel_el['follow'] = affinity.skew(sel_el['follow'], xval, yval, origin=(px, py)) + if 'clear' in sel_el: + sel_el['clear'] = affinity.skew(sel_el['clear'], xval, yval, origin=(px, py)) + + self.draw_app.plot_all() + + if str(axis) == 'X': + 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')) + except Exception as e: + self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Skew action was not executed."), str(e))) + return def on_scale(self, axis, xfactor, yfactor, point=None): """ + Scale geometry + + :param axis: Axis on which to scale + :param xfactor: Factor for scaling on X axis + :param yfactor: Factor for scaling on Y axis + :param point: Point of origin for scaling - :param axis: axis by which to scale - :param xfactor: the scale factor on X axis - :param yfactor: the scale factor on Y axis - :param point: point of reference for scaling :return: """ elem_list = self.draw_app.selected - xminlist = [] - yminlist = [] - xmaxlist = [] - ymaxlist = [] + px, py = point if not elem_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.")) return else: with self.app.proc_container.new(_("Applying Scale")): try: - # first get a bounding box to fit all; we use only the 'solids' as those should provide the biggest - # bounding box - for el_shape in elem_list: - el = el_shape.geo - if 'solid' in el: - xmin, ymin, xmax, ymax = el['solid'].bounds - xminlist.append(xmin) - yminlist.append(ymin) - xmaxlist.append(xmax) - ymaxlist.append(ymax) - - # get the minimum x,y and maximum x,y for all objects selected - xminimal = min(xminlist) - yminimal = min(yminlist) - xmaximal = max(xmaxlist) - ymaximal = max(ymaxlist) - - if point is None: - px = 0.5 * (xminimal + xmaximal) - py = 0.5 * (yminimal + ymaximal) - else: - px = 0 - py = 0 - for sel_el_shape in elem_list: sel_el = sel_el_shape.geo if 'solid' in sel_el: @@ -6177,46 +6109,83 @@ class TransformEditorTool(AppTool): def on_offset(self, axis, num): """ + Offset geometry + + :param axis: Axis on which to apply offset + :param num: The translation factor - :param axis: axis to be used as reference for offset - :param num: the amount by which to do the offset :return: """ elem_list = self.draw_app.selected if not elem_list: - self.app.inform.emit('[WARNING_NOTCL] %s' % - _("No shape selected. Please Select a shape to offset!")) + self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected.")) return - else: - with self.app.proc_container.new(_("Applying Offset")): - try: - for sel_el_shape in elem_list: - sel_el = sel_el_shape.geo - if axis == 'X': - if 'solid' in sel_el: - sel_el['solid'] = affinity.translate(sel_el['solid'], num, 0) - if 'follow' in sel_el: - sel_el['follow'] = affinity.translate(sel_el['follow'], num, 0) - if 'clear' in sel_el: - sel_el['clear'] = affinity.translate(sel_el['clear'], num, 0) - elif axis == 'Y': - if 'solid' in sel_el: - sel_el['solid'] = affinity.translate(sel_el['solid'], 0, num) - if 'follow' in sel_el: - sel_el['follow'] = affinity.translate(sel_el['follow'], 0, num) - if 'clear' in sel_el: - sel_el['clear'] = affinity.translate(sel_el['clear'], 0, num) - self.draw_app.plot_all() - if str(axis) == 'X': - self.app.inform.emit('[success] %s...' % _('Offset on the X axis done')) + with self.app.proc_container.new(_("Applying Offset")): + try: + for sel_el_shape in elem_list: + sel_el = sel_el_shape.geo + if axis == 'X': + if 'solid' in sel_el: + sel_el['solid'] = affinity.translate(sel_el['solid'], num, 0) + if 'follow' in sel_el: + sel_el['follow'] = affinity.translate(sel_el['follow'], num, 0) + if 'clear' in sel_el: + sel_el['clear'] = affinity.translate(sel_el['clear'], num, 0) + elif axis == 'Y': + if 'solid' in sel_el: + sel_el['solid'] = affinity.translate(sel_el['solid'], 0, num) + if 'follow' in sel_el: + sel_el['follow'] = affinity.translate(sel_el['follow'], 0, num) + if 'clear' in sel_el: + sel_el['clear'] = affinity.translate(sel_el['clear'], 0, num) + self.draw_app.plot_all() + + if str(axis) == 'X': + 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')) + + except Exception as e: + self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Offset action was not executed."), str(e))) + return + + def on_buffer_action(self, value, join, factor=None): + elem_list = self.draw_app.selected + + if not elem_list: + self.app.inform.emit('[WARNING_NOTCL] %s' % _("No shape selected")) + return + + with self.app.proc_container.new(_("Applying Buffer")): + try: + for sel_el_shape in elem_list: + sel_el = sel_el_shape.geo + + if factor: + if 'solid' in sel_el: + sel_el['solid'] = affinity.scale(sel_el['solid'], value, value, origin='center') + if 'follow' in sel_el: + sel_el['follow'] = affinity.scale(sel_el['solid'], value, value, origin='center') + if 'clear' in sel_el: + sel_el['clear'] = affinity.scale(sel_el['solid'], value, value, origin='center') else: - self.app.inform.emit('[success] %s...' % _('Offset on the Y axis done')) + if 'solid' in sel_el: + sel_el['solid'] = sel_el['solid'].buffer( + value, resolution=self.app.defaults["gerber_circle_steps"], join_style=join) + if 'clear' in sel_el: + sel_el['clear'] = sel_el['clear'].buffer( + value, resolution=self.app.defaults["gerber_circle_steps"], join_style=join) - except Exception as e: - self.app.inform.emit('[ERROR_NOTCL] %s: %s' % (_("Offset action was not executed."), str(e))) - return + self.draw_app.plot_all() + + self.app.inform.emit('[success] %s...' % _('Buffer done')) + + except Exception as e: + self.app.log.debug("TransformEditorTool.on_buffer_action() --> %s" % str(e)) + self.app.inform.emit('[ERROR_NOTCL] %s: %s.' % (_("Action was not executed, due of"), str(e))) + return def on_rotate_key(self): val_box = FCInputDialog(title=_("Rotate ..."), @@ -6227,7 +6196,7 @@ class TransformEditorTool(AppTool): val, ok = val_box.get_value() if ok: - self.on_rotate(val=val) + self.on_rotate(val=val, ref=1) self.app.inform.emit('[success] %s...' % _("Geometry shape rotate done")) return else: @@ -6276,7 +6245,7 @@ class TransformEditorTool(AppTool): val, ok = val_box.get_value() if ok: - self.on_skewx(val=val) + self.on_skewx(val=val, ref=3) self.app.inform.emit('[success] %s...' % _("Geometry shape skew on X axis done")) return else: @@ -6291,12 +6260,39 @@ class TransformEditorTool(AppTool): val, ok = val_box.get_value() if ok: - self.on_skewx(val=val) + self.on_skewx(val=val, ref=3) self.app.inform.emit('[success] %s...' % _("Geometry shape skew on Y axis done")) return else: self.app.inform.emit('[WARNING_NOTCL] %s...' % _("Geometry shape skew Y cancelled")) + @staticmethod + def alt_bounds(shapelist): + """ + Returns coordinates of rectangular bounds of a selection of shapes + """ + + def bounds_rec(lst): + minx = np.Inf + miny = np.Inf + maxx = -np.Inf + maxy = -np.Inf + + try: + for shape in lst: + el = shape.geo + if 'solid' in el: + minx_, miny_, maxx_, maxy_ = bounds_rec(el['solid']) + minx = min(minx, minx_) + miny = min(miny, miny_) + maxx = max(maxx, maxx_) + maxy = max(maxy, maxy_) + return minx, miny, maxx, maxy + except TypeError: + # it's an object, return it's bounds + return lst.bounds + + return bounds_rec(shapelist) def get_shapely_list_bounds(geometry_list): xmin = np.Inf diff --git a/AppEditors/FlatCAMTextEditor.py b/appEditors/FlatCAMTextEditor.py similarity index 99% rename from AppEditors/FlatCAMTextEditor.py rename to appEditors/FlatCAMTextEditor.py index 21c8aa7e..5122aef2 100644 --- a/AppEditors/FlatCAMTextEditor.py +++ b/appEditors/FlatCAMTextEditor.py @@ -5,7 +5,7 @@ # MIT Licence # # ########################################################## -from AppGUI.GUIElements import FCFileSaveDialog, FCEntry, FCTextAreaExtended, FCTextAreaLineNumber +from appGUI.GUIElements import FCFileSaveDialog, FCEntry, FCTextAreaExtended, FCTextAreaLineNumber from PyQt5 import QtPrintSupport, QtWidgets, QtCore, QtGui from reportlab.platypus import SimpleDocTemplate, Paragraph @@ -15,7 +15,7 @@ from reportlab.lib.units import inch, mm # from io import StringIO import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppEditors/__init__.py b/appEditors/__init__.py similarity index 100% rename from AppEditors/__init__.py rename to appEditors/__init__.py diff --git a/AppGUI/ColumnarFlowLayout.py b/appGUI/ColumnarFlowLayout.py similarity index 100% rename from AppGUI/ColumnarFlowLayout.py rename to appGUI/ColumnarFlowLayout.py diff --git a/AppGUI/GUIElements.py b/appGUI/GUIElements.py similarity index 99% rename from AppGUI/GUIElements.py rename to appGUI/GUIElements.py index 1378d190..c0df10c7 100644 --- a/AppGUI/GUIElements.py +++ b/appGUI/GUIElements.py @@ -23,7 +23,7 @@ import html import sys import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins log = logging.getLogger('base') diff --git a/AppGUI/MainGUI.py b/appGUI/MainGUI.py similarity index 99% rename from AppGUI/MainGUI.py rename to appGUI/MainGUI.py index 84982e72..6d209a87 100644 --- a/AppGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -12,28 +12,28 @@ # ########################################################## import platform -from AppGUI.GUIElements import * -from AppGUI.preferences import settings -from AppGUI.preferences.cncjob.CNCJobPreferencesUI import CNCJobPreferencesUI -from AppGUI.preferences.excellon.ExcellonPreferencesUI import ExcellonPreferencesUI -from AppGUI.preferences.general.GeneralPreferencesUI import GeneralPreferencesUI -from AppGUI.preferences.geometry.GeometryPreferencesUI import GeometryPreferencesUI -from AppGUI.preferences.gerber.GerberPreferencesUI import GerberPreferencesUI -from AppEditors.FlatCAMGeoEditor import FCShapeTool +from appGUI.GUIElements import * +from appGUI.preferences import settings +from appGUI.preferences.cncjob.CNCJobPreferencesUI import CNCJobPreferencesUI +from appGUI.preferences.excellon.ExcellonPreferencesUI import ExcellonPreferencesUI +from appGUI.preferences.general.GeneralPreferencesUI import GeneralPreferencesUI +from appGUI.preferences.geometry.GeometryPreferencesUI import GeometryPreferencesUI +from appGUI.preferences.gerber.GerberPreferencesUI import GerberPreferencesUI +from appEditors.FlatCAMGeoEditor import FCShapeTool from matplotlib.backend_bases import KeyEvent as mpl_key_event import webbrowser -from AppGUI.preferences.tools.Tools2PreferencesUI import Tools2PreferencesUI -from AppGUI.preferences.tools.ToolsPreferencesUI import ToolsPreferencesUI -from AppGUI.preferences.utilities.UtilPreferencesUI import UtilPreferencesUI -from AppObjects.ObjectCollection import KeySensitiveListView +from appGUI.preferences.tools.Tools2PreferencesUI import Tools2PreferencesUI +from appGUI.preferences.tools.ToolsPreferencesUI import ToolsPreferencesUI +from appGUI.preferences.utilities.UtilPreferencesUI import UtilPreferencesUI +from appObjects.ObjectCollection import KeySensitiveListView import subprocess import os import sys import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -1733,7 +1733,7 @@ class MainGUI(QtWidgets.QMainWindow): self.app.defaults["global_def_win_h"]) self.splitter.setSizes([self.app.defaults["global_def_notebook_width"], 0]) except KeyError as e: - log.debug("AppGUI.MainGUI.restore_main_win_geom() --> %s" % str(e)) + log.debug("appGUI.MainGUI.restore_main_win_geom() --> %s" % str(e)) def restore_toolbar_view(self): """ @@ -2475,7 +2475,7 @@ class MainGUI(QtWidgets.QMainWindow): # Delete from canvas if key == 'Delete': # Delete via the application to - # ensure cleanup of the AppGUI + # ensure cleanup of the appGUI if active: active.app.on_delete() diff --git a/AppGUI/ObjectUI.py b/appGUI/ObjectUI.py similarity index 99% rename from AppGUI/ObjectUI.py rename to appGUI/ObjectUI.py index fed12b35..c753f266 100644 --- a/AppGUI/ObjectUI.py +++ b/appGUI/ObjectUI.py @@ -11,11 +11,11 @@ # Date: 3/10/2019 # # ########################################################## -from AppGUI.GUIElements import * +from appGUI.GUIElements import * import sys import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/PlotCanvas.py b/appGUI/PlotCanvas.py similarity index 99% rename from AppGUI/PlotCanvas.py rename to appGUI/PlotCanvas.py index 61730cd2..aa9d9696 100644 --- a/AppGUI/PlotCanvas.py +++ b/appGUI/PlotCanvas.py @@ -8,12 +8,12 @@ from PyQt5 import QtCore import logging -from AppGUI.VisPyCanvas import VisPyCanvas, Color -from AppGUI.VisPyVisuals import ShapeGroup, ShapeCollection, TextCollection, TextGroup, Cursor +from appGUI.VisPyCanvas import VisPyCanvas, Color +from appGUI.VisPyVisuals import ShapeGroup, ShapeCollection, TextCollection, TextGroup, Cursor from vispy.scene.visuals import InfiniteLine, Line, Rectangle, Text import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins import numpy as np diff --git a/AppGUI/PlotCanvasLegacy.py b/appGUI/PlotCanvasLegacy.py similarity index 99% rename from AppGUI/PlotCanvasLegacy.py rename to appGUI/PlotCanvasLegacy.py index ba614642..15021fc4 100644 --- a/AppGUI/PlotCanvasLegacy.py +++ b/appGUI/PlotCanvasLegacy.py @@ -22,7 +22,7 @@ import logging import numpy as np import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins # Prevent conflict with Qt5 and above. diff --git a/AppGUI/VisPyCanvas.py b/appGUI/VisPyCanvas.py similarity index 100% rename from AppGUI/VisPyCanvas.py rename to appGUI/VisPyCanvas.py diff --git a/AppGUI/VisPyData/data/fonts/opensans-regular.ttf b/appGUI/VisPyData/data/fonts/opensans-regular.ttf similarity index 100% rename from AppGUI/VisPyData/data/fonts/opensans-regular.ttf rename to appGUI/VisPyData/data/fonts/opensans-regular.ttf diff --git a/AppGUI/VisPyData/data/freetype/freetype253.dll b/appGUI/VisPyData/data/freetype/freetype253.dll similarity index 100% rename from AppGUI/VisPyData/data/freetype/freetype253.dll rename to appGUI/VisPyData/data/freetype/freetype253.dll diff --git a/AppGUI/VisPyData/data/freetype/freetype253_x64.dll b/appGUI/VisPyData/data/freetype/freetype253_x64.dll similarity index 100% rename from AppGUI/VisPyData/data/freetype/freetype253_x64.dll rename to appGUI/VisPyData/data/freetype/freetype253_x64.dll diff --git a/AppGUI/VisPyPatches.py b/appGUI/VisPyPatches.py similarity index 100% rename from AppGUI/VisPyPatches.py rename to appGUI/VisPyPatches.py diff --git a/AppGUI/VisPyTesselators.py b/appGUI/VisPyTesselators.py similarity index 100% rename from AppGUI/VisPyTesselators.py rename to appGUI/VisPyTesselators.py diff --git a/AppGUI/VisPyVisuals.py b/appGUI/VisPyVisuals.py similarity index 99% rename from AppGUI/VisPyVisuals.py rename to appGUI/VisPyVisuals.py index 3796f759..6e7e5312 100644 --- a/AppGUI/VisPyVisuals.py +++ b/appGUI/VisPyVisuals.py @@ -13,7 +13,7 @@ from vispy.color import Color from shapely.geometry import Polygon, LineString, LinearRing import threading import numpy as np -from AppGUI.VisPyTesselators import GLUTess +from appGUI.VisPyTesselators import GLUTess class FlatCAMLineVisual(LineVisual): diff --git a/AppGUI/__init__.py b/appGUI/__init__.py similarity index 100% rename from AppGUI/__init__.py rename to appGUI/__init__.py diff --git a/AppGUI/preferences/OptionUI.py b/appGUI/preferences/OptionUI.py similarity index 99% rename from AppGUI/preferences/OptionUI.py rename to appGUI/preferences/OptionUI.py index d05691d5..c1b680ce 100644 --- a/AppGUI/preferences/OptionUI.py +++ b/appGUI/preferences/OptionUI.py @@ -3,11 +3,11 @@ from typing import Union, Sequence, List from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import RadioSet, FCCheckBox, FCButton, FCComboBox, FCEntry, FCSpinner, FCColorEntry, \ +from appGUI.GUIElements import RadioSet, FCCheckBox, FCButton, FCComboBox, FCEntry, FCSpinner, FCColorEntry, \ FCSliderWithSpinner, FCDoubleSpinner, FloatEntry, FCTextArea import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/OptionsGroupUI.py b/appGUI/preferences/OptionsGroupUI.py similarity index 95% rename from AppGUI/preferences/OptionsGroupUI.py rename to appGUI/preferences/OptionsGroupUI.py index 22eede6a..f317bb58 100644 --- a/AppGUI/preferences/OptionsGroupUI.py +++ b/appGUI/preferences/OptionsGroupUI.py @@ -11,10 +11,10 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins -from AppGUI.preferences.OptionUI import OptionUI +from appGUI.preferences.OptionUI import OptionUI fcTranslate.apply_language('strings') if '_' not in builtins.__dict__: diff --git a/AppGUI/preferences/PreferencesSectionUI.py b/appGUI/preferences/PreferencesSectionUI.py similarity index 86% rename from AppGUI/preferences/PreferencesSectionUI.py rename to appGUI/preferences/PreferencesSectionUI.py index 6daae820..968bef75 100644 --- a/AppGUI/preferences/PreferencesSectionUI.py +++ b/appGUI/preferences/PreferencesSectionUI.py @@ -1,9 +1,9 @@ from typing import Dict from PyQt5 import QtWidgets, QtCore -from AppGUI.ColumnarFlowLayout import ColumnarFlowLayout -from AppGUI.preferences.OptionUI import OptionUI -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.ColumnarFlowLayout import ColumnarFlowLayout +from appGUI.preferences.OptionUI import OptionUI +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI class PreferencesSectionUI(QtWidgets.QWidget): diff --git a/AppGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py similarity index 98% rename from AppGUI/preferences/PreferencesUIManager.py rename to appGUI/preferences/PreferencesUIManager.py index 187e0a58..34ea91bc 100644 --- a/AppGUI/preferences/PreferencesUIManager.py +++ b/appGUI/preferences/PreferencesUIManager.py @@ -5,7 +5,7 @@ from defaults import FlatCAMDefaults import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -18,7 +18,7 @@ if settings.contains("machinist"): else: machinist_setting = 0 -log = logging.getLogger('PreferencesUIManager') +log = logging.getLogger('base2') class PreferencesUIManager: @@ -629,9 +629,9 @@ class PreferencesUIManager: Will set the values for all the GUI elements in Preferences GUI based on the values found in the self.defaults dictionary. - :param factor: will apply a factor to the values that written in the GUI elements - :param fl_units: current measuring units in FlatCAM: Metric or Inch - :param source_dict: the repository of options, usually is the self.defaults + :param factor: will apply a factor to the values that written in the GUI elements + :param fl_units: current measuring units in FlatCAM: Metric or Inch + :param source_dict: the repository of options, usually is the self.defaults :return: None """ @@ -647,18 +647,18 @@ class PreferencesUIManager: """ Basically it is the worker in the self.defaults_write_form() - :param field: the GUI element in Preferences GUI to be updated - :param factor: factor to be applied to the field parameter - :param units: current FlatCAM measuring units - :param defaults_dict: the defaults storage - :return: None, it updates GUI elements + :param field: the GUI element in Preferences GUI to be updated + :param factor: factor to be applied to the field parameter + :param units: current FlatCAM measuring units + :param defaults_dict: the defaults storage + :return: None, it updates GUI elements """ def_dict = self.defaults if defaults_dict is None else defaults_dict try: value = def_dict[field] - log.debug("value is " + str(value) + " and factor is "+str(factor)) + # log.debug("value is " + str(value) + " and factor is "+str(factor)) if factor is not None: value *= factor @@ -675,7 +675,7 @@ class PreferencesUIManager: def show_preferences_gui(self): """ - Called to initialize and show the Preferences AppGUI + Called to initialize and show the Preferences appGUI :return: None """ @@ -906,13 +906,13 @@ class PreferencesUIManager: self.ui.general_defaults_form.general_app_group.ge_radio.set_value(ge) if save_to_file or should_restart is True: + # Re-fresh project options + self.ui.app.on_options_app2project() + self.save_defaults(silent=False) # load the defaults so they are updated into the app self.defaults.load(filename=os.path.join(self.data_path, 'current_defaults.FlatConfig')) - # Re-fresh project options - self.ui.app.on_options_app2project() - settgs = QSettings("Open Source", "FlatCAM") # save the notebook font size @@ -1002,7 +1002,6 @@ class PreferencesUIManager: :param first_time: Boolean. If True will execute some code when the app is run first time :return: None """ - self.defaults.report_usage("save_defaults") log.debug("App.PreferencesUIManager.save_defaults()") if data_path is None: diff --git a/AppGUI/preferences/__init__.py b/appGUI/preferences/__init__.py similarity index 81% rename from AppGUI/preferences/__init__.py rename to appGUI/preferences/__init__.py index 193fef34..4932c17a 100644 --- a/AppGUI/preferences/__init__.py +++ b/appGUI/preferences/__init__.py @@ -1,6 +1,6 @@ -from AppGUI.GUIElements import * +from appGUI.GUIElements import * import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins diff --git a/AppGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py similarity index 97% rename from AppGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py rename to appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py index 53f7e0ae..24daf08f 100644 --- a/AppGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py @@ -1,10 +1,10 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings, Qt -from AppGUI.GUIElements import FCTextArea, FCCheckBox, FCComboBox, FCSpinner, FCColorEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCTextArea, FCCheckBox, FCComboBox, FCSpinner, FCColorEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py rename to appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py index 11a88763..f27d62c7 100644 --- a/AppGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py @@ -1,10 +1,10 @@ from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCCheckBox, RadioSet, FCSpinner, FCDoubleSpinner, FCSliderWithSpinner, FCColorEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCCheckBox, RadioSet, FCSpinner, FCDoubleSpinner, FCSliderWithSpinner, FCColorEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py similarity index 94% rename from AppGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py rename to appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py index 5dab3cff..60c16f44 100644 --- a/AppGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCTextArea -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCTextArea +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/cncjob/CNCJobPreferencesUI.py b/appGUI/preferences/cncjob/CNCJobPreferencesUI.py similarity index 83% rename from AppGUI/preferences/cncjob/CNCJobPreferencesUI.py rename to appGUI/preferences/cncjob/CNCJobPreferencesUI.py index 79760423..c919a8d8 100644 --- a/AppGUI/preferences/cncjob/CNCJobPreferencesUI.py +++ b/appGUI/preferences/cncjob/CNCJobPreferencesUI.py @@ -1,8 +1,8 @@ from PyQt5 import QtWidgets -from AppGUI.preferences.cncjob.CNCJobAdvOptPrefGroupUI import CNCJobAdvOptPrefGroupUI -from AppGUI.preferences.cncjob.CNCJobOptPrefGroupUI import CNCJobOptPrefGroupUI -from AppGUI.preferences.cncjob.CNCJobGenPrefGroupUI import CNCJobGenPrefGroupUI +from appGUI.preferences.cncjob.CNCJobAdvOptPrefGroupUI import CNCJobAdvOptPrefGroupUI +from appGUI.preferences.cncjob.CNCJobOptPrefGroupUI import CNCJobOptPrefGroupUI +from appGUI.preferences.cncjob.CNCJobGenPrefGroupUI import CNCJobGenPrefGroupUI class CNCJobPreferencesUI(QtWidgets.QWidget): diff --git a/AppGUI/preferences/cncjob/__init__.py b/appGUI/preferences/cncjob/__init__.py similarity index 100% rename from AppGUI/preferences/cncjob/__init__.py rename to appGUI/preferences/cncjob/__init__.py diff --git a/AppGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py similarity index 97% rename from AppGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py rename to appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py index dd267816..94d9986b 100644 --- a/AppGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py @@ -1,10 +1,10 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, RadioSet, FCCheckBox, NumericalEvalTupleEntry, NumericalEvalEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCCheckBox, NumericalEvalTupleEntry, NumericalEvalEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py rename to appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py index 25f38aea..83cbb6f7 100644 --- a/AppGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/excellon/ExcellonExpPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py similarity index 97% rename from AppGUI/preferences/excellon/ExcellonExpPrefGroupUI.py rename to appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py index 4cab1c6e..55a5cd15 100644 --- a/AppGUI/preferences/excellon/ExcellonExpPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py @@ -1,10 +1,10 @@ from PyQt5 import QtWidgets, QtCore from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import RadioSet, FCSpinner -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import RadioSet, FCSpinner +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/excellon/ExcellonGenPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py similarity index 99% rename from AppGUI/preferences/excellon/ExcellonGenPrefGroupUI.py rename to appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py index 93d4e9a4..c7cda214 100644 --- a/AppGUI/preferences/excellon/ExcellonGenPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py @@ -3,10 +3,10 @@ import platform from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCEntry, FCSliderWithSpinner, FCColorEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCEntry, FCSliderWithSpinner, FCColorEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/excellon/ExcellonOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/excellon/ExcellonOptPrefGroupUI.py rename to appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py index 93aec0b3..4d75b3bf 100644 --- a/AppGUI/preferences/excellon/ExcellonOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py @@ -1,12 +1,12 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import Qt, QSettings -from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCEntry, FCSpinner, OptionalInputSection, \ +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCEntry, FCSpinner, OptionalInputSection, \ FCComboBox, NumericalEvalTupleEntry -from AppGUI.preferences import machinist_setting -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.preferences import machinist_setting +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/excellon/ExcellonPreferencesUI.py b/appGUI/preferences/excellon/ExcellonPreferencesUI.py similarity index 83% rename from AppGUI/preferences/excellon/ExcellonPreferencesUI.py rename to appGUI/preferences/excellon/ExcellonPreferencesUI.py index dd1305d9..39bf5006 100644 --- a/AppGUI/preferences/excellon/ExcellonPreferencesUI.py +++ b/appGUI/preferences/excellon/ExcellonPreferencesUI.py @@ -1,14 +1,14 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.preferences.excellon.ExcellonEditorPrefGroupUI import ExcellonEditorPrefGroupUI -from AppGUI.preferences.excellon.ExcellonExpPrefGroupUI import ExcellonExpPrefGroupUI -from AppGUI.preferences.excellon.ExcellonAdvOptPrefGroupUI import ExcellonAdvOptPrefGroupUI -from AppGUI.preferences.excellon.ExcellonOptPrefGroupUI import ExcellonOptPrefGroupUI -from AppGUI.preferences.excellon.ExcellonGenPrefGroupUI import ExcellonGenPrefGroupUI +from appGUI.preferences.excellon.ExcellonEditorPrefGroupUI import ExcellonEditorPrefGroupUI +from appGUI.preferences.excellon.ExcellonExpPrefGroupUI import ExcellonExpPrefGroupUI +from appGUI.preferences.excellon.ExcellonAdvOptPrefGroupUI import ExcellonAdvOptPrefGroupUI +from appGUI.preferences.excellon.ExcellonOptPrefGroupUI import ExcellonOptPrefGroupUI +from appGUI.preferences.excellon.ExcellonGenPrefGroupUI import ExcellonGenPrefGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/excellon/__init__.py b/appGUI/preferences/excellon/__init__.py similarity index 100% rename from AppGUI/preferences/excellon/__init__.py rename to appGUI/preferences/excellon/__init__.py diff --git a/AppGUI/preferences/general/GeneralAPPSetGroupUI.py b/appGUI/preferences/general/GeneralAPPSetGroupUI.py similarity index 98% rename from AppGUI/preferences/general/GeneralAPPSetGroupUI.py rename to appGUI/preferences/general/GeneralAPPSetGroupUI.py index b73db634..8288a3f6 100644 --- a/AppGUI/preferences/general/GeneralAPPSetGroupUI.py +++ b/appGUI/preferences/general/GeneralAPPSetGroupUI.py @@ -1,13 +1,13 @@ from PyQt5 import QtCore, QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, RadioSet, OptionalInputSection, FCSpinner, \ +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, RadioSet, OptionalInputSection, FCSpinner, \ FCColorEntry -from AppGUI.preferences import settings -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.preferences import settings +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -193,7 +193,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): self.notebook_font_size_label = QtWidgets.QLabel('%s:' % _('Notebook')) self.notebook_font_size_label.setToolTip( _("This sets the font size for the elements found in the Notebook.\n" - "The notebook is the collapsible area in the left side of the AppGUI,\n" + "The notebook is the collapsible area in the left side of the appGUI,\n" "and include the Project, Selected and Tool tabs.") ) @@ -232,7 +232,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): # TextBox Font Size self.textbox_font_size_label = QtWidgets.QLabel('%s:' % _('Textbox')) self.textbox_font_size_label.setToolTip( - _("This sets the font size for the Textbox AppGUI\n" + _("This sets the font size for the Textbox appGUI\n" "elements that are used in the application.") ) diff --git a/AppGUI/preferences/general/GeneralAppPrefGroupUI.py b/appGUI/preferences/general/GeneralAppPrefGroupUI.py similarity index 99% rename from AppGUI/preferences/general/GeneralAppPrefGroupUI.py rename to appGUI/preferences/general/GeneralAppPrefGroupUI.py index 81d99b7d..e73017dd 100644 --- a/AppGUI/preferences/general/GeneralAppPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralAppPrefGroupUI.py @@ -3,12 +3,12 @@ import sys from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import RadioSet, FCSpinner, FCCheckBox, FCComboBox, FCButton, OptionalInputSection, \ +from appGUI.GUIElements import RadioSet, FCSpinner, FCCheckBox, FCComboBox, FCButton, OptionalInputSection, \ FCDoubleSpinner -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/general/GeneralAppSettingsGroupUI.py b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py similarity index 98% rename from AppGUI/preferences/general/GeneralAppSettingsGroupUI.py rename to appGUI/preferences/general/GeneralAppSettingsGroupUI.py index a35c247a..2cf301d1 100644 --- a/AppGUI/preferences/general/GeneralAppSettingsGroupUI.py +++ b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py @@ -1,13 +1,13 @@ from PyQt5 import QtCore from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import OptionalInputSection -from AppGUI.preferences import settings -from AppGUI.preferences.OptionUI import * -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI2 +from appGUI.GUIElements import OptionalInputSection +from appGUI.preferences import settings +from appGUI.preferences.OptionUI import * +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI2 import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') if '_' not in builtins.__dict__: diff --git a/AppGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py similarity index 99% rename from AppGUI/preferences/general/GeneralGUIPrefGroupUI.py rename to appGUI/preferences/general/GeneralGUIPrefGroupUI.py index 7339b9cc..92d77ea0 100644 --- a/AppGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import QSettings, Qt -from AppGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import RadioSet, FCCheckBox, FCComboBox, FCSliderWithSpinner, FCColorEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/general/GeneralPreferencesUI.py b/appGUI/preferences/general/GeneralPreferencesUI.py similarity index 84% rename from AppGUI/preferences/general/GeneralPreferencesUI.py rename to appGUI/preferences/general/GeneralPreferencesUI.py index 45ccf191..52e9053c 100644 --- a/AppGUI/preferences/general/GeneralPreferencesUI.py +++ b/appGUI/preferences/general/GeneralPreferencesUI.py @@ -1,12 +1,12 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.preferences.general.GeneralAppPrefGroupUI import GeneralAppPrefGroupUI -from AppGUI.preferences.general.GeneralAPPSetGroupUI import GeneralAPPSetGroupUI -from AppGUI.preferences.general.GeneralGUIPrefGroupUI import GeneralGUIPrefGroupUI +from appGUI.preferences.general.GeneralAppPrefGroupUI import GeneralAppPrefGroupUI +from appGUI.preferences.general.GeneralAPPSetGroupUI import GeneralAPPSetGroupUI +from appGUI.preferences.general.GeneralGUIPrefGroupUI import GeneralGUIPrefGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/general/__init__.py b/appGUI/preferences/general/__init__.py similarity index 100% rename from AppGUI/preferences/general/__init__.py rename to appGUI/preferences/general/__init__.py diff --git a/AppGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py rename to appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py index f122186c..a6d30aca 100644 --- a/AppGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py @@ -1,12 +1,12 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCLabel, NumericalEvalTupleEntry, \ +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCLabel, NumericalEvalTupleEntry, \ NumericalEvalEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/geometry/GeometryEditorPrefGroupUI.py b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py similarity index 94% rename from AppGUI/preferences/geometry/GeometryEditorPrefGroupUI.py rename to appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py index 1ac42f42..aca5a4ef 100644 --- a/AppGUI/preferences/geometry/GeometryEditorPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCSpinner, RadioSet -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCSpinner, RadioSet +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/geometry/GeometryGenPrefGroupUI.py b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py similarity index 95% rename from AppGUI/preferences/geometry/GeometryGenPrefGroupUI.py rename to appGUI/preferences/geometry/GeometryGenPrefGroupUI.py index b958fca1..7040a877 100644 --- a/AppGUI/preferences/geometry/GeometryGenPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCCheckBox, FCSpinner, FCEntry, FCColorEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCCheckBox, FCSpinner, FCEntry, FCColorEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/geometry/GeometryOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py similarity index 97% rename from AppGUI/preferences/geometry/GeometryOptPrefGroupUI.py rename to appGUI/preferences/geometry/GeometryOptPrefGroupUI.py index ebbe0c34..7ca13738 100644 --- a/AppGUI/preferences/geometry/GeometryOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py @@ -1,13 +1,13 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import Qt, QSettings -from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, OptionalInputSection, FCSpinner, FCComboBox, \ +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, OptionalInputSection, FCSpinner, FCComboBox, \ NumericalEvalTupleEntry -from AppGUI.preferences import machinist_setting -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.preferences import machinist_setting +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/geometry/GeometryPreferencesUI.py b/appGUI/preferences/geometry/GeometryPreferencesUI.py similarity index 84% rename from AppGUI/preferences/geometry/GeometryPreferencesUI.py rename to appGUI/preferences/geometry/GeometryPreferencesUI.py index fd1709ef..12a79ba2 100644 --- a/AppGUI/preferences/geometry/GeometryPreferencesUI.py +++ b/appGUI/preferences/geometry/GeometryPreferencesUI.py @@ -1,13 +1,13 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.preferences.geometry.GeometryEditorPrefGroupUI import GeometryEditorPrefGroupUI -from AppGUI.preferences.geometry.GeometryAdvOptPrefGroupUI import GeometryAdvOptPrefGroupUI -from AppGUI.preferences.geometry.GeometryOptPrefGroupUI import GeometryOptPrefGroupUI -from AppGUI.preferences.geometry.GeometryGenPrefGroupUI import GeometryGenPrefGroupUI +from appGUI.preferences.geometry.GeometryEditorPrefGroupUI import GeometryEditorPrefGroupUI +from appGUI.preferences.geometry.GeometryAdvOptPrefGroupUI import GeometryAdvOptPrefGroupUI +from appGUI.preferences.geometry.GeometryOptPrefGroupUI import GeometryOptPrefGroupUI +from appGUI.preferences.geometry.GeometryGenPrefGroupUI import GeometryGenPrefGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/geometry/__init__.py b/appGUI/preferences/geometry/__init__.py similarity index 100% rename from AppGUI/preferences/geometry/__init__.py rename to appGUI/preferences/geometry/__init__.py diff --git a/AppGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py similarity index 95% rename from AppGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py rename to appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py index e68fe32f..ba788e26 100644 --- a/AppGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCSpinner, OptionalInputSection -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCSpinner, OptionalInputSection +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/gerber/GerberEditorPrefGroupUI.py b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/gerber/GerberEditorPrefGroupUI.py rename to appGUI/preferences/gerber/GerberEditorPrefGroupUI.py index aee22e96..bc86e7e6 100644 --- a/AppGUI/preferences/gerber/GerberEditorPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCSpinner, FCDoubleSpinner, FCComboBox, FCEntry, RadioSet, NumericalEvalTupleEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, FCComboBox, FCEntry, RadioSet, NumericalEvalTupleEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/gerber/GerberExpPrefGroupUI.py b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py similarity index 96% rename from AppGUI/preferences/gerber/GerberExpPrefGroupUI.py rename to appGUI/preferences/gerber/GerberExpPrefGroupUI.py index edd41b45..75f7bfb9 100644 --- a/AppGUI/preferences/gerber/GerberExpPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtCore from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import RadioSet, FCSpinner -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import RadioSet, FCSpinner +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/gerber/GerberGenPrefGroupUI.py b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/gerber/GerberGenPrefGroupUI.py rename to appGUI/preferences/gerber/GerberGenPrefGroupUI.py index da893c53..fc20e80e 100644 --- a/AppGUI/preferences/gerber/GerberGenPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCEntry, FCSliderWithSpinner, FCColorEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCEntry, FCSliderWithSpinner, FCColorEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/gerber/GerberOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py similarity index 95% rename from AppGUI/preferences/gerber/GerberOptPrefGroupUI.py rename to appGUI/preferences/gerber/GerberOptPrefGroupUI.py index c619a3c1..a7040a87 100644 --- a/AppGUI/preferences/gerber/GerberOptPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox, FCComboBox -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox, FCComboBox +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/gerber/GerberPreferencesUI.py b/appGUI/preferences/gerber/GerberPreferencesUI.py similarity index 83% rename from AppGUI/preferences/gerber/GerberPreferencesUI.py rename to appGUI/preferences/gerber/GerberPreferencesUI.py index cee2a54c..6b6ad56f 100644 --- a/AppGUI/preferences/gerber/GerberPreferencesUI.py +++ b/appGUI/preferences/gerber/GerberPreferencesUI.py @@ -1,14 +1,14 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.preferences.gerber.GerberEditorPrefGroupUI import GerberEditorPrefGroupUI -from AppGUI.preferences.gerber.GerberExpPrefGroupUI import GerberExpPrefGroupUI -from AppGUI.preferences.gerber.GerberAdvOptPrefGroupUI import GerberAdvOptPrefGroupUI -from AppGUI.preferences.gerber.GerberOptPrefGroupUI import GerberOptPrefGroupUI -from AppGUI.preferences.gerber.GerberGenPrefGroupUI import GerberGenPrefGroupUI +from appGUI.preferences.gerber.GerberEditorPrefGroupUI import GerberEditorPrefGroupUI +from appGUI.preferences.gerber.GerberExpPrefGroupUI import GerberExpPrefGroupUI +from appGUI.preferences.gerber.GerberAdvOptPrefGroupUI import GerberAdvOptPrefGroupUI +from appGUI.preferences.gerber.GerberOptPrefGroupUI import GerberOptPrefGroupUI +from appGUI.preferences.gerber.GerberGenPrefGroupUI import GerberGenPrefGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/gerber/__init__.py b/appGUI/preferences/gerber/__init__.py similarity index 100% rename from AppGUI/preferences/gerber/__init__.py rename to appGUI/preferences/gerber/__init__.py diff --git a/AppGUI/preferences/tools/Tools2CThievingPrefGroupUI.py b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/tools/Tools2CThievingPrefGroupUI.py rename to appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py index 7ec00a3c..8ffc51f0 100644 --- a/AppGUI/preferences/tools/Tools2CThievingPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CThievingPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/Tools2CalPrefGroupUI.py b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py similarity index 96% rename from AppGUI/preferences/tools/Tools2CalPrefGroupUI.py rename to appGUI/preferences/tools/Tools2CalPrefGroupUI.py index 04d54387..23171c24 100644 --- a/AppGUI/preferences/tools/Tools2CalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2CalPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/Tools2EDrillsPrefGroupUI.py b/appGUI/preferences/tools/Tools2EDrillsPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/tools/Tools2EDrillsPrefGroupUI.py rename to appGUI/preferences/tools/Tools2EDrillsPrefGroupUI.py index 410bb655..b3cf9372 100644 --- a/AppGUI/preferences/tools/Tools2EDrillsPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2EDrillsPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py similarity index 97% rename from AppGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py rename to appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py index 77ff939c..a480af80 100644 --- a/AppGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2FiducialsPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, RadioSet -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner, RadioSet +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/Tools2InvertPrefGroupUI.py b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py similarity index 94% rename from AppGUI/preferences/tools/Tools2InvertPrefGroupUI.py rename to appGUI/preferences/tools/Tools2InvertPrefGroupUI.py index f7bb9f17..00fdd4c3 100644 --- a/AppGUI/preferences/tools/Tools2InvertPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2InvertPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, RadioSet -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner, RadioSet +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/Tools2OptimalPrefGroupUI.py b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py similarity index 91% rename from AppGUI/preferences/tools/Tools2OptimalPrefGroupUI.py rename to appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py index 6524d439..05d88af2 100644 --- a/AppGUI/preferences/tools/Tools2OptimalPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2OptimalPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCSpinner -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCSpinner +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/Tools2PreferencesUI.py b/appGUI/preferences/tools/Tools2PreferencesUI.py similarity index 83% rename from AppGUI/preferences/tools/Tools2PreferencesUI.py rename to appGUI/preferences/tools/Tools2PreferencesUI.py index 5101fc37..f114a80b 100644 --- a/AppGUI/preferences/tools/Tools2PreferencesUI.py +++ b/appGUI/preferences/tools/Tools2PreferencesUI.py @@ -1,18 +1,18 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.preferences.tools.Tools2InvertPrefGroupUI import Tools2InvertPrefGroupUI -from AppGUI.preferences.tools.Tools2PunchGerberPrefGroupUI import Tools2PunchGerberPrefGroupUI -from AppGUI.preferences.tools.Tools2EDrillsPrefGroupUI import Tools2EDrillsPrefGroupUI -from AppGUI.preferences.tools.Tools2CalPrefGroupUI import Tools2CalPrefGroupUI -from AppGUI.preferences.tools.Tools2FiducialsPrefGroupUI import Tools2FiducialsPrefGroupUI -from AppGUI.preferences.tools.Tools2CThievingPrefGroupUI import Tools2CThievingPrefGroupUI -from AppGUI.preferences.tools.Tools2QRCodePrefGroupUI import Tools2QRCodePrefGroupUI -from AppGUI.preferences.tools.Tools2OptimalPrefGroupUI import Tools2OptimalPrefGroupUI -from AppGUI.preferences.tools.Tools2RulesCheckPrefGroupUI import Tools2RulesCheckPrefGroupUI +from appGUI.preferences.tools.Tools2InvertPrefGroupUI import Tools2InvertPrefGroupUI +from appGUI.preferences.tools.Tools2PunchGerberPrefGroupUI import Tools2PunchGerberPrefGroupUI +from appGUI.preferences.tools.Tools2EDrillsPrefGroupUI import Tools2EDrillsPrefGroupUI +from appGUI.preferences.tools.Tools2CalPrefGroupUI import Tools2CalPrefGroupUI +from appGUI.preferences.tools.Tools2FiducialsPrefGroupUI import Tools2FiducialsPrefGroupUI +from appGUI.preferences.tools.Tools2CThievingPrefGroupUI import Tools2CThievingPrefGroupUI +from appGUI.preferences.tools.Tools2QRCodePrefGroupUI import Tools2QRCodePrefGroupUI +from appGUI.preferences.tools.Tools2OptimalPrefGroupUI import Tools2OptimalPrefGroupUI +from appGUI.preferences.tools.Tools2RulesCheckPrefGroupUI import Tools2RulesCheckPrefGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py rename to appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py index 073d4a68..99607448 100644 --- a/AppGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2PunchGerberPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/Tools2QRCodePrefGroupUI.py b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py similarity index 97% rename from AppGUI/preferences/tools/Tools2QRCodePrefGroupUI.py rename to appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py index 6a0efb4a..636d063e 100644 --- a/AppGUI/preferences/tools/Tools2QRCodePrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2QRCodePrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import Qt, QSettings -from AppGUI.GUIElements import FCSpinner, RadioSet, FCTextArea, FCEntry, FCColorEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCSpinner, RadioSet, FCTextArea, FCEntry, FCColorEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py rename to appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py index cc049d41..50f94489 100644 --- a/AppGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2RulesCheckPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCCheckBox, FCDoubleSpinner -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/Tools2sidedPrefGroupUI.py b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py similarity index 95% rename from AppGUI/preferences/tools/Tools2sidedPrefGroupUI.py rename to appGUI/preferences/tools/Tools2sidedPrefGroupUI.py index 4f9174f8..23b94587 100644 --- a/AppGUI/preferences/tools/Tools2sidedPrefGroupUI.py +++ b/appGUI/preferences/tools/Tools2sidedPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, RadioSet -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner, RadioSet +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py similarity index 97% rename from AppGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py rename to appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py index f1d8cec9..156a543f 100644 --- a/AppGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsCalculatorsPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsCornersPrefGroupUI.py b/appGUI/preferences/tools/ToolsCornersPrefGroupUI.py similarity index 94% rename from AppGUI/preferences/tools/ToolsCornersPrefGroupUI.py rename to appGUI/preferences/tools/ToolsCornersPrefGroupUI.py index 559eea86..b4bed9d8 100644 --- a/AppGUI/preferences/tools/ToolsCornersPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsCornersPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsCutoutPrefGroupUI.py b/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py similarity index 96% rename from AppGUI/preferences/tools/ToolsCutoutPrefGroupUI.py rename to appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py index 4e690474..e081586a 100644 --- a/AppGUI/preferences/tools/ToolsCutoutPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsCutoutPrefGroupUI.py @@ -1,12 +1,12 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox -from AppGUI.preferences import machinist_setting -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox +from appGUI.preferences import machinist_setting +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsFilmPrefGroupUI.py b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/tools/ToolsFilmPrefGroupUI.py rename to appGUI/preferences/tools/ToolsFilmPrefGroupUI.py index f2e2a528..419f300d 100644 --- a/AppGUI/preferences/tools/ToolsFilmPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsFilmPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import Qt, QSettings -from AppGUI.GUIElements import RadioSet, FCEntry, FCDoubleSpinner, FCCheckBox, FCComboBox, FCColorEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import RadioSet, FCEntry, FCDoubleSpinner, FCCheckBox, FCComboBox, FCColorEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsISOPrefGroupUI.py b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/tools/ToolsISOPrefGroupUI.py rename to appGUI/preferences/tools/ToolsISOPrefGroupUI.py index 0b9b68a5..860cbf13 100644 --- a/AppGUI/preferences/tools/ToolsISOPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsISOPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, NumericalEvalTupleEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, NumericalEvalTupleEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsNCCPrefGroupUI.py b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/tools/ToolsNCCPrefGroupUI.py rename to appGUI/preferences/tools/ToolsNCCPrefGroupUI.py index 28c300da..b0a10ab5 100644 --- a/AppGUI/preferences/tools/ToolsNCCPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsNCCPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, NumericalEvalTupleEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, NumericalEvalTupleEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsPaintPrefGroupUI.py b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/tools/ToolsPaintPrefGroupUI.py rename to appGUI/preferences/tools/ToolsPaintPrefGroupUI.py index b69d0106..7a967b1d 100644 --- a/AppGUI/preferences/tools/ToolsPaintPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPaintPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, NumericalEvalTupleEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, NumericalEvalTupleEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsPanelizePrefGroupUI.py b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py similarity index 97% rename from AppGUI/preferences/tools/ToolsPanelizePrefGroupUI.py rename to appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py index f217ec00..9189d88d 100644 --- a/AppGUI/preferences/tools/ToolsPanelizePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsPanelizePrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsPreferencesUI.py b/appGUI/preferences/tools/ToolsPreferencesUI.py similarity index 81% rename from AppGUI/preferences/tools/ToolsPreferencesUI.py rename to appGUI/preferences/tools/ToolsPreferencesUI.py index 9d30c9b9..a3133fe4 100644 --- a/AppGUI/preferences/tools/ToolsPreferencesUI.py +++ b/appGUI/preferences/tools/ToolsPreferencesUI.py @@ -1,22 +1,22 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.preferences.tools.ToolsSubPrefGroupUI import ToolsSubPrefGroupUI -from AppGUI.preferences.tools.ToolsSolderpastePrefGroupUI import ToolsSolderpastePrefGroupUI -from AppGUI.preferences.tools.ToolsCornersPrefGroupUI import ToolsCornersPrefGroupUI -from AppGUI.preferences.tools.ToolsTransformPrefGroupUI import ToolsTransformPrefGroupUI -from AppGUI.preferences.tools.ToolsCalculatorsPrefGroupUI import ToolsCalculatorsPrefGroupUI -from AppGUI.preferences.tools.ToolsPanelizePrefGroupUI import ToolsPanelizePrefGroupUI -from AppGUI.preferences.tools.ToolsFilmPrefGroupUI import ToolsFilmPrefGroupUI -from AppGUI.preferences.tools.Tools2sidedPrefGroupUI import Tools2sidedPrefGroupUI +from appGUI.preferences.tools.ToolsSubPrefGroupUI import ToolsSubPrefGroupUI +from appGUI.preferences.tools.ToolsSolderpastePrefGroupUI import ToolsSolderpastePrefGroupUI +from appGUI.preferences.tools.ToolsCornersPrefGroupUI import ToolsCornersPrefGroupUI +from appGUI.preferences.tools.ToolsTransformPrefGroupUI import ToolsTransformPrefGroupUI +from appGUI.preferences.tools.ToolsCalculatorsPrefGroupUI import ToolsCalculatorsPrefGroupUI +from appGUI.preferences.tools.ToolsPanelizePrefGroupUI import ToolsPanelizePrefGroupUI +from appGUI.preferences.tools.ToolsFilmPrefGroupUI import ToolsFilmPrefGroupUI +from appGUI.preferences.tools.Tools2sidedPrefGroupUI import Tools2sidedPrefGroupUI -from AppGUI.preferences.tools.ToolsCutoutPrefGroupUI import ToolsCutoutPrefGroupUI -from AppGUI.preferences.tools.ToolsNCCPrefGroupUI import ToolsNCCPrefGroupUI -from AppGUI.preferences.tools.ToolsPaintPrefGroupUI import ToolsPaintPrefGroupUI -from AppGUI.preferences.tools.ToolsISOPrefGroupUI import ToolsISOPrefGroupUI +from appGUI.preferences.tools.ToolsCutoutPrefGroupUI import ToolsCutoutPrefGroupUI +from appGUI.preferences.tools.ToolsNCCPrefGroupUI import ToolsNCCPrefGroupUI +from appGUI.preferences.tools.ToolsPaintPrefGroupUI import ToolsPaintPrefGroupUI +from appGUI.preferences.tools.ToolsISOPrefGroupUI import ToolsISOPrefGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py similarity index 98% rename from AppGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py rename to appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py index 832b76d9..3c6f3f88 100644 --- a/AppGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsSolderpastePrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, FCSpinner, FCComboBox, NumericalEvalTupleEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, FCComboBox, NumericalEvalTupleEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsSubPrefGroupUI.py b/appGUI/preferences/tools/ToolsSubPrefGroupUI.py similarity index 89% rename from AppGUI/preferences/tools/ToolsSubPrefGroupUI.py rename to appGUI/preferences/tools/ToolsSubPrefGroupUI.py index 2cc78d87..15aa4198 100644 --- a/AppGUI/preferences/tools/ToolsSubPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsSubPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCCheckBox -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCCheckBox +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/ToolsTransformPrefGroupUI.py b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py similarity index 98% rename from AppGUI/preferences/tools/ToolsTransformPrefGroupUI.py rename to appGUI/preferences/tools/ToolsTransformPrefGroupUI.py index d3bd0c88..e43335a8 100644 --- a/AppGUI/preferences/tools/ToolsTransformPrefGroupUI.py +++ b/appGUI/preferences/tools/ToolsTransformPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/tools/__init__.py b/appGUI/preferences/tools/__init__.py similarity index 100% rename from AppGUI/preferences/tools/__init__.py rename to appGUI/preferences/tools/__init__.py diff --git a/AppGUI/preferences/utilities/AutoCompletePrefGroupUI.py b/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py similarity index 94% rename from AppGUI/preferences/utilities/AutoCompletePrefGroupUI.py rename to appGUI/preferences/utilities/AutoCompletePrefGroupUI.py index 4f491f49..97c8f950 100644 --- a/AppGUI/preferences/utilities/AutoCompletePrefGroupUI.py +++ b/appGUI/preferences/utilities/AutoCompletePrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCButton, FCTextArea, FCEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCButton, FCTextArea, FCEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/utilities/FAExcPrefGroupUI.py b/appGUI/preferences/utilities/FAExcPrefGroupUI.py similarity index 95% rename from AppGUI/preferences/utilities/FAExcPrefGroupUI.py rename to appGUI/preferences/utilities/FAExcPrefGroupUI.py index 4cdd89f7..6feb9a53 100644 --- a/AppGUI/preferences/utilities/FAExcPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAExcPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import VerticalScrollArea, FCButton, FCTextArea, FCEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import VerticalScrollArea, FCButton, FCTextArea, FCEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/utilities/FAGcoPrefGroupUI.py b/appGUI/preferences/utilities/FAGcoPrefGroupUI.py similarity index 95% rename from AppGUI/preferences/utilities/FAGcoPrefGroupUI.py rename to appGUI/preferences/utilities/FAGcoPrefGroupUI.py index 9c367ed5..3ede6614 100644 --- a/AppGUI/preferences/utilities/FAGcoPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAGcoPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCButton, FCTextArea, FCEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCButton, FCTextArea, FCEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/utilities/FAGrbPrefGroupUI.py b/appGUI/preferences/utilities/FAGrbPrefGroupUI.py similarity index 95% rename from AppGUI/preferences/utilities/FAGrbPrefGroupUI.py rename to appGUI/preferences/utilities/FAGrbPrefGroupUI.py index 70e0aa78..55f8fce5 100644 --- a/AppGUI/preferences/utilities/FAGrbPrefGroupUI.py +++ b/appGUI/preferences/utilities/FAGrbPrefGroupUI.py @@ -1,11 +1,11 @@ from PyQt5 import QtWidgets, QtGui from PyQt5.QtCore import QSettings -from AppGUI.GUIElements import FCButton, FCTextArea, FCEntry -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.GUIElements import FCButton, FCTextArea, FCEntry +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppGUI/preferences/utilities/UtilPreferencesUI.py b/appGUI/preferences/utilities/UtilPreferencesUI.py similarity index 81% rename from AppGUI/preferences/utilities/UtilPreferencesUI.py rename to appGUI/preferences/utilities/UtilPreferencesUI.py index e227c924..be0b5265 100644 --- a/AppGUI/preferences/utilities/UtilPreferencesUI.py +++ b/appGUI/preferences/utilities/UtilPreferencesUI.py @@ -1,9 +1,9 @@ from PyQt5 import QtWidgets -from AppGUI.preferences.utilities.AutoCompletePrefGroupUI import AutoCompletePrefGroupUI -from AppGUI.preferences.utilities.FAGrbPrefGroupUI import FAGrbPrefGroupUI -from AppGUI.preferences.utilities.FAGcoPrefGroupUI import FAGcoPrefGroupUI -from AppGUI.preferences.utilities.FAExcPrefGroupUI import FAExcPrefGroupUI +from appGUI.preferences.utilities.AutoCompletePrefGroupUI import AutoCompletePrefGroupUI +from appGUI.preferences.utilities.FAGrbPrefGroupUI import FAGrbPrefGroupUI +from appGUI.preferences.utilities.FAGcoPrefGroupUI import FAGcoPrefGroupUI +from appGUI.preferences.utilities.FAExcPrefGroupUI import FAExcPrefGroupUI class UtilPreferencesUI(QtWidgets.QWidget): diff --git a/AppGUI/preferences/utilities/__init__.py b/appGUI/preferences/utilities/__init__.py similarity index 100% rename from AppGUI/preferences/utilities/__init__.py rename to appGUI/preferences/utilities/__init__.py diff --git a/AppObjects/AppObject.py b/appObjects/AppObject.py similarity index 97% rename from AppObjects/AppObject.py rename to appObjects/AppObject.py index cafc964d..82eb48af 100644 --- a/AppObjects/AppObject.py +++ b/appObjects/AppObject.py @@ -8,20 +8,20 @@ # ########################################################### from PyQt5 import QtCore -from AppObjects.ObjectCollection import * -from AppObjects.FlatCAMCNCJob import CNCJobObject -from AppObjects.FlatCAMDocument import DocumentObject -from AppObjects.FlatCAMExcellon import ExcellonObject -from AppObjects.FlatCAMGeometry import GeometryObject -from AppObjects.FlatCAMGerber import GerberObject -from AppObjects.FlatCAMScript import ScriptObject +from appObjects.ObjectCollection import * +from appObjects.FlatCAMCNCJob import CNCJobObject +from appObjects.FlatCAMDocument import DocumentObject +from appObjects.FlatCAMExcellon import ExcellonObject +from appObjects.FlatCAMGeometry import GeometryObject +from appObjects.FlatCAMGerber import GerberObject +from appObjects.FlatCAMScript import ScriptObject import time import traceback # FlatCAM Translation import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppObjects/FlatCAMCNCJob.py b/appObjects/FlatCAMCNCJob.py similarity index 99% rename from AppObjects/FlatCAMCNCJob.py rename to appObjects/FlatCAMCNCJob.py index 7f506e0f..bdfaca9f 100644 --- a/AppObjects/FlatCAMCNCJob.py +++ b/appObjects/FlatCAMCNCJob.py @@ -14,8 +14,8 @@ from copy import deepcopy from io import StringIO from datetime import datetime -from AppEditors.FlatCAMTextEditor import TextEditor -from AppObjects.FlatCAMObj import * +from appEditors.FlatCAMTextEditor import TextEditor +from appObjects.FlatCAMObj import * from camlib import CNCjob @@ -24,7 +24,7 @@ import sys import math import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppObjects/FlatCAMDocument.py b/appObjects/FlatCAMDocument.py similarity index 99% rename from AppObjects/FlatCAMDocument.py rename to appObjects/FlatCAMDocument.py index c9aadca9..47219abc 100644 --- a/AppObjects/FlatCAMDocument.py +++ b/appObjects/FlatCAMDocument.py @@ -10,11 +10,11 @@ # File modified by: Marius Stanciu # # ########################################################## -from AppEditors.FlatCAMTextEditor import TextEditor -from AppObjects.FlatCAMObj import * +from appEditors.FlatCAMTextEditor import TextEditor +from appObjects.FlatCAMObj import * import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppObjects/FlatCAMExcellon.py b/appObjects/FlatCAMExcellon.py similarity index 99% rename from AppObjects/FlatCAMExcellon.py rename to appObjects/FlatCAMExcellon.py index 71ce705c..613a3097 100644 --- a/AppObjects/FlatCAMExcellon.py +++ b/appObjects/FlatCAMExcellon.py @@ -15,14 +15,14 @@ from shapely.geometry import Point, LineString from copy import deepcopy -from AppParsers.ParseExcellon import Excellon -from AppObjects.FlatCAMObj import * +from appParsers.ParseExcellon import Excellon +from appObjects.FlatCAMObj import * import itertools import numpy as np import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -963,7 +963,7 @@ class ExcellonObject(FlatCAMObj, Excellon): def get_selected_tools_list(self): """ Returns the keys to the self.tools dictionary corresponding - to the selections on the tool list in the AppGUI. + to the selections on the tool list in the appGUI. :return: List of tools. :rtype: list diff --git a/AppObjects/FlatCAMGeometry.py b/appObjects/FlatCAMGeometry.py similarity index 99% rename from AppObjects/FlatCAMGeometry.py rename to appObjects/FlatCAMGeometry.py index cdb4b9ad..d32b1167 100644 --- a/AppObjects/FlatCAMGeometry.py +++ b/appObjects/FlatCAMGeometry.py @@ -15,7 +15,7 @@ import shapely.affinity as affinity from camlib import Geometry -from AppObjects.FlatCAMObj import * +from appObjects.FlatCAMObj import * import ezdxf import math @@ -24,7 +24,7 @@ from copy import deepcopy import traceback import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -940,7 +940,7 @@ class GeometryObject(FlatCAMObj, Geometry): self.ui_connect() self.build_ui() - # if there is no tool left in the Tools Table, enable the parameters AppGUI + # if there is no tool left in the Tools Table, enable the parameters appGUI if self.ui.geo_tools_table.rowCount() != 0: self.ui.geo_param_frame.setDisabled(False) @@ -1016,7 +1016,7 @@ class GeometryObject(FlatCAMObj, Geometry): self.ui_connect() self.build_ui() - # if there is no tool left in the Tools Table, enable the parameters AppGUI + # if there is no tool left in the Tools Table, enable the parameters appGUI if self.ui.geo_tools_table.rowCount() != 0: self.ui.geo_param_frame.setDisabled(False) @@ -1197,7 +1197,7 @@ class GeometryObject(FlatCAMObj, Geometry): obj_active.options['xmax'] = 0 obj_active.options['ymax'] = 0 - # if there is no tool left in the Tools Table, disable the parameters AppGUI + # if there is no tool left in the Tools Table, disable the parameters appGUI if self.ui.geo_tools_table.rowCount() == 0: self.ui.geo_param_frame.setDisabled(True) @@ -1759,7 +1759,7 @@ class GeometryObject(FlatCAMObj, Geometry): :param tools_dict: a dictionary that holds the whole data needed to create the Gcode (including the solid_geometry) :param tools_in_use: the tools that are used, needed by some preprocessors - :type tools_in_use list of lists, each list in the list is made out of row elements of tools table from AppGUI + :type tools_in_use list of lists, each list in the list is made out of row elements of tools table from appGUI :param segx: number of segments on the X axis, for auto-levelling :param segy: number of segments on the Y axis, for auto-levelling :param plot: if True the generated object will be plotted; if False will not be plotted diff --git a/AppObjects/FlatCAMGerber.py b/appObjects/FlatCAMGerber.py similarity index 99% rename from AppObjects/FlatCAMGerber.py rename to appObjects/FlatCAMGerber.py index c2ea8ce1..fdbb0f11 100644 --- a/AppObjects/FlatCAMGerber.py +++ b/appObjects/FlatCAMGerber.py @@ -14,15 +14,15 @@ from shapely.geometry import Point, Polygon, MultiPolygon, MultiLineString, LineString, LinearRing from shapely.ops import cascaded_union -from AppParsers.ParseGerber import Gerber -from AppObjects.FlatCAMObj import * +from appParsers.ParseGerber import Gerber +from appObjects.FlatCAMObj import * import math import numpy as np from copy import deepcopy import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppObjects/FlatCAMObj.py b/appObjects/FlatCAMObj.py similarity index 98% rename from AppObjects/FlatCAMObj.py rename to appObjects/FlatCAMObj.py index b2cf95d8..5c58d036 100644 --- a/AppObjects/FlatCAMObj.py +++ b/appObjects/FlatCAMObj.py @@ -12,15 +12,15 @@ import inspect # TODO: For debugging only. -from AppGUI.ObjectUI import * +from appGUI.ObjectUI import * from Common import LoudDict -from AppGUI.PlotCanvasLegacy import ShapeCollectionLegacy +from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy import sys import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -43,7 +43,7 @@ class ValidationError(Exception): class FlatCAMObj(QtCore.QObject): """ Base type of objects handled in FlatCAM. These become interactive - in the AppGUI, can be plotted, and their options can be modified + in the appGUI, can be plotted, and their options can be modified by the user in their respective forms. """ diff --git a/AppObjects/FlatCAMScript.py b/appObjects/FlatCAMScript.py similarity index 98% rename from AppObjects/FlatCAMScript.py rename to appObjects/FlatCAMScript.py index 93892715..27f6f8bd 100644 --- a/AppObjects/FlatCAMScript.py +++ b/appObjects/FlatCAMScript.py @@ -10,16 +10,16 @@ # File modified by: Marius Stanciu # # ########################################################## -from AppEditors.FlatCAMTextEditor import TextEditor -from AppObjects.FlatCAMObj import * -from AppGUI.ObjectUI import * +from appEditors.FlatCAMTextEditor import TextEditor +from appObjects.FlatCAMObj import * +from appGUI.ObjectUI import * import tkinter as tk import sys from copy import deepcopy import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppObjects/ObjectCollection.py b/appObjects/ObjectCollection.py similarity index 98% rename from AppObjects/ObjectCollection.py rename to appObjects/ObjectCollection.py index 477eb0e6..cc968e6d 100644 --- a/AppObjects/ObjectCollection.py +++ b/appObjects/ObjectCollection.py @@ -16,13 +16,13 @@ from PyQt5.QtCore import Qt, QSettings from PyQt5.QtGui import QColor # from PyQt5.QtCore import QModelIndex -from AppObjects.FlatCAMObj import FlatCAMObj -from AppObjects.FlatCAMCNCJob import CNCJobObject -from AppObjects.FlatCAMDocument import DocumentObject -from AppObjects.FlatCAMExcellon import ExcellonObject -from AppObjects.FlatCAMGeometry import GeometryObject -from AppObjects.FlatCAMGerber import GerberObject -from AppObjects.FlatCAMScript import ScriptObject +from appObjects.FlatCAMObj import FlatCAMObj +from appObjects.FlatCAMCNCJob import CNCJobObject +from appObjects.FlatCAMDocument import DocumentObject +from appObjects.FlatCAMExcellon import ExcellonObject +from appObjects.FlatCAMGeometry import GeometryObject +from appObjects.FlatCAMGerber import GerberObject +from appObjects.FlatCAMScript import ScriptObject import inspect # TODO: Remove @@ -32,7 +32,7 @@ from copy import deepcopy from numpy import Inf import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -56,7 +56,7 @@ class KeySensitiveListView(QtWidgets.QTreeView): # self.setRootIsDecorated(False) # self.setExpandsOnDoubleClick(False) - # Enable dragging and dropping onto the AppGUI + # Enable dragging and dropping onto the appGUI self.setAcceptDrops(True) self.filename = "" self.app = app diff --git a/AppObjects/__init__.py b/appObjects/__init__.py similarity index 100% rename from AppObjects/__init__.py rename to appObjects/__init__.py diff --git a/AppParsers/ParseDXF.py b/appParsers/ParseDXF.py similarity index 99% rename from AppParsers/ParseDXF.py rename to appParsers/ParseDXF.py index 698e87b8..44aff8b9 100644 --- a/AppParsers/ParseDXF.py +++ b/appParsers/ParseDXF.py @@ -12,8 +12,8 @@ import logging log = logging.getLogger('base2') -from AppParsers.ParseFont import * -from AppParsers.ParseDXF_Spline import * +from appParsers.ParseFont import * +from appParsers.ParseDXF_Spline import * def distance(pt1, pt2): diff --git a/AppParsers/ParseDXF_Spline.py b/appParsers/ParseDXF_Spline.py similarity index 100% rename from AppParsers/ParseDXF_Spline.py rename to appParsers/ParseDXF_Spline.py diff --git a/AppParsers/ParseExcellon.py b/appParsers/ParseExcellon.py similarity index 98% rename from AppParsers/ParseExcellon.py rename to appParsers/ParseExcellon.py index fbf1bb6f..45b51b03 100644 --- a/AppParsers/ParseExcellon.py +++ b/appParsers/ParseExcellon.py @@ -966,7 +966,7 @@ class Excellon(Geometry): :return: None """ - log.debug("AppParsers.ParseExcellon.Excellon.create_geometry()") + log.debug("appParsers.ParseExcellon.Excellon.create_geometry()") self.solid_geometry = [] try: # clear the solid_geometry in self.tools @@ -981,7 +981,7 @@ class Excellon(Geometry): _("Excellon.create_geometry() -> a drill location was skipped " "due of not having a tool associated.\n" "Check the resulting GCode.")) - log.debug("AppParsers.ParseExcellon.Excellon.create_geometry() -> a drill location was skipped " + log.debug("appParsers.ParseExcellon.Excellon.create_geometry() -> a drill location was skipped " "due of not having a tool associated") continue tooldia = self.tools[drill['tool']]['C'] @@ -1005,7 +1005,7 @@ class Excellon(Geometry): self.tools[tool_in_slots]['solid_geometry'].append(poly) self.tools[tool_in_slots]['data'] = deepcopy(self.default_data) except Exception as e: - log.debug("AppParsers.ParseExcellon.Excellon.create_geometry() -> " + log.debug("appParsers.ParseExcellon.Excellon.create_geometry() -> " "Excellon geometry creation failed due of ERROR: %s" % str(e)) return "fail" @@ -1017,10 +1017,10 @@ class Excellon(Geometry): :param flatten: No used """ - log.debug("AppParsers.ParseExcellon.Excellon.bounds()") + log.debug("appParsers.ParseExcellon.Excellon.bounds()") if self.solid_geometry is None or not self.tools: - log.debug("AppParsers.ParseExcellon.Excellon -> solid_geometry is None") + log.debug("appParsers.ParseExcellon.Excellon -> solid_geometry is None") return 0, 0, 0, 0 def bounds_rec(obj): @@ -1091,7 +1091,7 @@ class Excellon(Geometry): else: log.error("Unsupported units: %s" % str(obj_units)) factor = 1.0 - log.debug("AppParsers.ParseExcellon.Excellon.convert_units() --> Factor: %s" % str(factor)) + log.debug("appParsers.ParseExcellon.Excellon.convert_units() --> Factor: %s" % str(factor)) self.units = obj_units self.scale(factor, factor) @@ -1117,7 +1117,7 @@ class Excellon(Geometry): :return: None :rtype: None """ - log.debug("AppParsers.ParseExcellon.Excellon.scale()") + log.debug("appParsers.ParseExcellon.Excellon.scale()") if yfactor is None: yfactor = xfactor @@ -1182,7 +1182,7 @@ class Excellon(Geometry): :type vect: tuple :return: None """ - log.debug("AppParsers.ParseExcellon.Excellon.offset()") + log.debug("appParsers.ParseExcellon.Excellon.offset()") dx, dy = vect @@ -1242,7 +1242,7 @@ class Excellon(Geometry): :type point: list :return: None """ - log.debug("AppParsers.ParseExcellon.Excellon.mirror()") + log.debug("appParsers.ParseExcellon.Excellon.mirror()") px, py = point xscale, yscale = {"X": (1.0, -1.0), "Y": (-1.0, 1.0)}[axis] @@ -1308,7 +1308,7 @@ class Excellon(Geometry): See shapely manual for more information: http://toblerity.org/shapely/manual.html#affine-transformations """ - log.debug("AppParsers.ParseExcellon.Excellon.skew()") + log.debug("appParsers.ParseExcellon.Excellon.skew()") if angle_x is None: angle_x = 0.0 @@ -1395,7 +1395,7 @@ class Excellon(Geometry): :param point: tuple of coordinates (x, y) :return: None """ - log.debug("AppParsers.ParseExcellon.Excellon.rotate()") + log.debug("appParsers.ParseExcellon.Excellon.rotate()") if angle == 0: return @@ -1478,7 +1478,7 @@ class Excellon(Geometry): :param join: The type of line joint used by the shapely buffer method: round, square, bevel :return: None """ - log.debug("AppParsers.ParseExcellon.Excellon.buffer()") + log.debug("appParsers.ParseExcellon.Excellon.buffer()") if distance == 0: return diff --git a/AppParsers/ParseFont.py b/appParsers/ParseFont.py similarity index 99% rename from AppParsers/ParseFont.py rename to appParsers/ParseFont.py index 7fa2b0d0..89ba9ef4 100644 --- a/AppParsers/ParseFont.py +++ b/appParsers/ParseFont.py @@ -22,7 +22,7 @@ from fontTools import ttLib import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppParsers/ParseGerber.py b/appParsers/ParseGerber.py similarity index 99% rename from AppParsers/ParseGerber.py rename to appParsers/ParseGerber.py index 385a042b..a2d3a20b 100644 --- a/AppParsers/ParseGerber.py +++ b/appParsers/ParseGerber.py @@ -14,8 +14,8 @@ import shapely.affinity as affinity from shapely.geometry import box as shply_box, Polygon, LineString, Point, MultiPolygon from lxml import etree as ET -from AppParsers.ParseSVG import svgparselength, getsvggeo -import AppTranslation as fcTranslate +from appParsers.ParseSVG import svgparselength, getsvggeo +import appTranslation as fcTranslate import gettext import builtins @@ -1763,7 +1763,7 @@ class Gerber(Geometry): :return: None """ - log.debug("AppParsers.ParseGerber.Gerber.import_svg()") + log.debug("appParsers.ParseGerber.Gerber.import_svg()") # Parse into list of shapely objects svg_tree = ET.parse(filename) @@ -2389,7 +2389,7 @@ class Gerber(Geometry): geo_p = shply_box(minx, miny, maxx, maxy) new_geo_el['solid'] = geo_p else: - log.debug("AppParsers.ParseGerber.Gerber.buffer() --> " + log.debug("appParsers.ParseGerber.Gerber.buffer() --> " "ap type not supported") else: new_geo_el['solid'] = geo_el['follow'].buffer( diff --git a/AppParsers/ParseHPGL2.py b/appParsers/ParseHPGL2.py similarity index 100% rename from AppParsers/ParseHPGL2.py rename to appParsers/ParseHPGL2.py diff --git a/AppParsers/ParsePDF.py b/appParsers/ParsePDF.py similarity index 100% rename from AppParsers/ParsePDF.py rename to appParsers/ParsePDF.py diff --git a/AppParsers/ParseSVG.py b/appParsers/ParseSVG.py similarity index 99% rename from AppParsers/ParseSVG.py rename to appParsers/ParseSVG.py index 713d50f1..d553c139 100644 --- a/AppParsers/ParseSVG.py +++ b/appParsers/ParseSVG.py @@ -27,7 +27,7 @@ from shapely.geometry import LineString, LinearRing, MultiLineString from shapely.affinity import skew, affine_transform, rotate import numpy as np -from AppParsers.ParseFont import * +from appParsers.ParseFont import * log = logging.getLogger('base2') diff --git a/AppParsers/__init__.py b/appParsers/__init__.py similarity index 100% rename from AppParsers/__init__.py rename to appParsers/__init__.py diff --git a/AppPool.py b/appPool.py similarity index 100% rename from AppPool.py rename to appPool.py diff --git a/AppPreProcessor.py b/appPreProcessor.py similarity index 100% rename from AppPreProcessor.py rename to appPreProcessor.py diff --git a/AppProcess.py b/appProcess.py similarity index 98% rename from AppProcess.py rename to appProcess.py index 313e8581..d74847d8 100644 --- a/AppProcess.py +++ b/appProcess.py @@ -6,12 +6,12 @@ # MIT Licence # # ########################################################## -from AppGUI.GUIElements import FlatCAMActivityView +from appGUI.GUIElements import FlatCAMActivityView from PyQt5 import QtCore import weakref import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTool.py b/appTool.py similarity index 98% rename from AppTool.py rename to appTool.py index f288cdf0..7fc4e36c 100644 --- a/AppTool.py +++ b/appTool.py @@ -11,7 +11,7 @@ from PyQt5 import QtCore, QtWidgets from shapely.geometry import Polygon, LineString import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -27,7 +27,7 @@ class AppTool(QtWidgets.QWidget): """ :param app: The application this tool will run in. - :type app: App_Main.App + :type app: app_Main.App :param parent: Qt Parent :return: AppTool """ @@ -87,10 +87,10 @@ class AppTool(QtWidgets.QWidget): if self.app.tool_tab_locked is True: return - # Remove anything else in the AppGUI + # Remove anything else in the appGUI self.app.ui.tool_scroll_area.takeWidget() - # Put ourself in the AppGUI + # Put ourself in the appGUI self.app.ui.tool_scroll_area.setWidget(self) # Switch notebook to tool page diff --git a/AppTools/ToolAlignObjects.py b/appTools/ToolAlignObjects.py similarity index 99% rename from AppTools/ToolAlignObjects.py rename to appTools/ToolAlignObjects.py index 4c4249ae..5e13dd30 100644 --- a/AppTools/ToolAlignObjects.py +++ b/appTools/ToolAlignObjects.py @@ -6,9 +6,9 @@ # ########################################################## from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from appTool import AppTool -from AppGUI.GUIElements import FCComboBox, RadioSet +from appGUI.GUIElements import FCComboBox, RadioSet import math @@ -16,7 +16,7 @@ from shapely.geometry import Point from shapely.affinity import translate import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins import logging diff --git a/AppTools/ToolCalculators.py b/appTools/ToolCalculators.py similarity index 99% rename from AppTools/ToolCalculators.py rename to appTools/ToolCalculators.py index 08edc27d..b26ae9fb 100644 --- a/AppTools/ToolCalculators.py +++ b/appTools/ToolCalculators.py @@ -6,12 +6,12 @@ # ########################################################## from PyQt5 import QtWidgets -from AppTool import AppTool -from AppGUI.GUIElements import FCSpinner, FCDoubleSpinner, FCEntry +from appTool import AppTool +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, FCEntry import math import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolCalibration.py b/appTools/ToolCalibration.py similarity index 99% rename from AppTools/ToolCalibration.py rename to appTools/ToolCalibration.py index 456674bf..815acf7b 100644 --- a/AppTools/ToolCalibration.py +++ b/appTools/ToolCalibration.py @@ -7,10 +7,10 @@ from PyQt5 import QtWidgets, QtCore, QtGui -from AppTool import AppTool -from AppGUI.GUIElements import FCDoubleSpinner, EvalEntry, FCCheckBox, OptionalInputSection, FCEntry -from AppGUI.GUIElements import FCTable, FCComboBox, RadioSet -from AppEditors.FlatCAMTextEditor import TextEditor +from appTool import AppTool +from appGUI.GUIElements import FCDoubleSpinner, EvalEntry, FCCheckBox, OptionalInputSection, FCEntry +from appGUI.GUIElements import FCTable, FCComboBox, RadioSet +from appEditors.FlatCAMTextEditor import TextEditor from shapely.geometry import Point from shapely.geometry.base import * @@ -22,7 +22,7 @@ import logging from copy import deepcopy import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolCopperThieving.py b/appTools/ToolCopperThieving.py similarity index 99% rename from AppTools/ToolCopperThieving.py rename to appTools/ToolCopperThieving.py index 79362948..468073bf 100644 --- a/AppTools/ToolCopperThieving.py +++ b/appTools/ToolCopperThieving.py @@ -8,8 +8,8 @@ from PyQt5 import QtWidgets, QtCore from camlib import grace -from AppTool import AppTool -from AppGUI.GUIElements import FCDoubleSpinner, RadioSet, FCEntry, FCComboBox +from appTool import AppTool +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, FCEntry, FCComboBox import shapely.geometry.base as base from shapely.ops import cascaded_union, unary_union @@ -23,7 +23,7 @@ import numpy as np from collections import Iterable import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolCorners.py b/appTools/ToolCorners.py similarity index 99% rename from AppTools/ToolCorners.py rename to appTools/ToolCorners.py index 53ea72b0..0a735940 100644 --- a/AppTools/ToolCorners.py +++ b/appTools/ToolCorners.py @@ -7,8 +7,8 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, FCButton +from appTool import AppTool +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCComboBox, FCButton from shapely.geometry import MultiPolygon, LineString @@ -16,7 +16,7 @@ from copy import deepcopy import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolCutOut.py b/appTools/ToolCutOut.py similarity index 99% rename from AppTools/ToolCutOut.py rename to appTools/ToolCutOut.py index 990daf55..64eb4349 100644 --- a/AppTools/ToolCutOut.py +++ b/appTools/ToolCutOut.py @@ -6,8 +6,8 @@ # ########################################################## from PyQt5 import QtWidgets, QtGui, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, OptionalInputSection, FCButton +from appTool import AppTool +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, OptionalInputSection, FCButton from shapely.geometry import box, MultiPolygon, Polygon, LineString, LinearRing from shapely.ops import cascaded_union, unary_union @@ -20,7 +20,7 @@ from copy import deepcopy import math import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolDblSided.py b/appTools/ToolDblSided.py similarity index 99% rename from AppTools/ToolDblSided.py rename to appTools/ToolDblSided.py index 23bb781f..48f750ff 100644 --- a/AppTools/ToolDblSided.py +++ b/appTools/ToolDblSided.py @@ -1,8 +1,8 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, EvalEntry, FCEntry, FCButton, FCComboBox +from appTool import AppTool +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, EvalEntry, FCEntry, FCButton, FCComboBox from numpy import Inf @@ -11,7 +11,7 @@ from shapely import affinity import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolDistance.py b/appTools/ToolDistance.py similarity index 98% rename from AppTools/ToolDistance.py rename to appTools/ToolDistance.py index 58c51c1f..ba660075 100644 --- a/AppTools/ToolDistance.py +++ b/appTools/ToolDistance.py @@ -7,15 +7,15 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.VisPyVisuals import * -from AppGUI.GUIElements import FCEntry, FCButton, FCCheckBox +from appTool import AppTool +from appGUI.VisPyVisuals import * +from appGUI.GUIElements import FCEntry, FCButton, FCCheckBox from shapely.geometry import Point, MultiLineString, Polygon -import AppTranslation as fcTranslate +import appTranslation as fcTranslate from camlib import FlatCAMRTreeStorage -from AppEditors.FlatCAMGeoEditor import DrawToolShape +from appEditors.FlatCAMGeoEditor import DrawToolShape from copy import copy import math @@ -176,7 +176,7 @@ class Distance(AppTool): if self.app.is_legacy is False: self.sel_shapes = ShapeCollection(parent=self.app.plotcanvas.view.scene, layers=1) else: - from AppGUI.PlotCanvasLegacy import ShapeCollectionLegacy + from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy self.sel_shapes = ShapeCollectionLegacy(obj=self, app=self.app, name='measurement') self.measure_btn.clicked.connect(self.activate_measure_tool) @@ -211,10 +211,10 @@ class Distance(AppTool): AppTool.install(self, icon, separator, shortcut='Ctrl+M', **kwargs) def set_tool_ui(self): - # Remove anything else in the AppGUI + # Remove anything else in the appGUI self.app.ui.tool_scroll_area.takeWidget() - # Put ourselves in the AppGUI + # Put ourselves in the appGUI self.app.ui.tool_scroll_area.setWidget(self) # Switch notebook to tool page diff --git a/AppTools/ToolDistanceMin.py b/appTools/ToolDistanceMin.py similarity index 98% rename from AppTools/ToolDistanceMin.py rename to appTools/ToolDistanceMin.py index 0e932863..3beaf244 100644 --- a/AppTools/ToolDistanceMin.py +++ b/appTools/ToolDistanceMin.py @@ -6,8 +6,8 @@ # ########################################################## from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import FCEntry +from appTool import AppTool +from appGUI.GUIElements import FCEntry from shapely.ops import nearest_points from shapely.geometry import Point, MultiPolygon @@ -16,7 +16,7 @@ from shapely.ops import cascaded_union import math import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -157,10 +157,10 @@ class DistanceMin(AppTool): AppTool.install(self, icon, separator, shortcut='Shift+M', **kwargs) def set_tool_ui(self): - # Remove anything else in the AppGUI + # Remove anything else in the appGUI self.app.ui.tool_scroll_area.takeWidget() - # Put oneself in the AppGUI + # Put oneself in the appGUI self.app.ui.tool_scroll_area.setWidget(self) # Switch notebook to tool page diff --git a/AppTools/ToolEtchCompensation.py b/appTools/ToolEtchCompensation.py similarity index 99% rename from AppTools/ToolEtchCompensation.py rename to appTools/ToolEtchCompensation.py index ac49a539..0243ff6a 100644 --- a/AppTools/ToolEtchCompensation.py +++ b/appTools/ToolEtchCompensation.py @@ -7,8 +7,8 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import FCButton, FCDoubleSpinner, RadioSet, FCComboBox, NumericalEvalEntry, FCEntry +from appTool import AppTool +from appGUI.GUIElements import FCButton, FCDoubleSpinner, RadioSet, FCComboBox, NumericalEvalEntry, FCEntry from shapely.ops import unary_union @@ -17,7 +17,7 @@ import math import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -429,7 +429,7 @@ class ToolEtchCompensation(AppTool): :param new_obj: New object :type new_obj: ObjectCollection :param app_obj: App - :type app_obj: App_Main.App + :type app_obj: app_Main.App :return: None :rtype: """ diff --git a/AppTools/ToolExtractDrills.py b/appTools/ToolExtractDrills.py similarity index 99% rename from AppTools/ToolExtractDrills.py rename to appTools/ToolExtractDrills.py index 71e8fb41..2fd6ca78 100644 --- a/AppTools/ToolExtractDrills.py +++ b/appTools/ToolExtractDrills.py @@ -7,14 +7,14 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox +from appTool import AppTool +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox from shapely.geometry import Point import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolFiducials.py b/appTools/ToolFiducials.py similarity index 99% rename from AppTools/ToolFiducials.py rename to appTools/ToolFiducials.py index 4aa8598a..1a8fa8fd 100644 --- a/AppTools/ToolFiducials.py +++ b/appTools/ToolFiducials.py @@ -7,8 +7,8 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import FCDoubleSpinner, RadioSet, EvalEntry, FCTable, FCComboBox +from appTool import AppTool +from appGUI.GUIElements import FCDoubleSpinner, RadioSet, EvalEntry, FCTable, FCComboBox from shapely.geometry import Point, Polygon, MultiPolygon, LineString from shapely.geometry import box as box @@ -18,7 +18,7 @@ import logging from copy import deepcopy import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolFilm.py b/appTools/ToolFilm.py similarity index 99% rename from AppTools/ToolFilm.py rename to appTools/ToolFilm.py index 9da564da..e0304522 100644 --- a/AppTools/ToolFilm.py +++ b/appTools/ToolFilm.py @@ -7,8 +7,8 @@ from PyQt5 import QtCore, QtWidgets -from AppTool import AppTool -from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, \ +from appTool import AppTool +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, \ OptionalHideInputSection, OptionalInputSection, FCComboBox, FCFileSaveDialog from copy import deepcopy @@ -27,7 +27,7 @@ from lxml import etree as ET from io import StringIO import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolImage.py b/appTools/ToolImage.py similarity index 98% rename from AppTools/ToolImage.py rename to appTools/ToolImage.py index 5d520c78..f29f1267 100644 --- a/AppTools/ToolImage.py +++ b/appTools/ToolImage.py @@ -7,11 +7,11 @@ from PyQt5 import QtGui, QtWidgets -from AppTool import AppTool -from AppGUI.GUIElements import RadioSet, FCComboBox, FCSpinner +from appTool import AppTool +from appGUI.GUIElements import RadioSet, FCComboBox, FCSpinner import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolInvertGerber.py b/appTools/ToolInvertGerber.py similarity index 98% rename from AppTools/ToolInvertGerber.py rename to appTools/ToolInvertGerber.py index 96e771b4..cf57cc5f 100644 --- a/AppTools/ToolInvertGerber.py +++ b/appTools/ToolInvertGerber.py @@ -7,8 +7,8 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import FCButton, FCDoubleSpinner, RadioSet, FCComboBox +from appTool import AppTool +from appGUI.GUIElements import FCButton, FCDoubleSpinner, RadioSet, FCComboBox from shapely.geometry import box @@ -16,7 +16,7 @@ from copy import deepcopy import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolIsolation.py b/appTools/ToolIsolation.py similarity index 99% rename from AppTools/ToolIsolation.py rename to appTools/ToolIsolation.py index 34938fd7..ff4ee51c 100644 --- a/AppTools/ToolIsolation.py +++ b/appTools/ToolIsolation.py @@ -7,10 +7,10 @@ from PyQt5 import QtWidgets, QtCore, QtGui -from AppTool import AppTool -from AppGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCInputDialog, FCButton, \ +from appTool import AppTool +from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCInputDialog, FCButton, \ FCComboBox, OptionalInputSection, FCSpinner -from AppParsers.ParseGerber import Gerber +from appParsers.ParseGerber import Gerber from copy import deepcopy @@ -24,7 +24,7 @@ from matplotlib.backend_bases import KeyEvent as mpl_key_event import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolMove.py b/appTools/ToolMove.py similarity index 98% rename from AppTools/ToolMove.py rename to appTools/ToolMove.py index e02fed57..3a3ef404 100644 --- a/AppTools/ToolMove.py +++ b/appTools/ToolMove.py @@ -6,13 +6,13 @@ # ########################################################## from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.VisPyVisuals import * +from appTool import AppTool +from appGUI.VisPyVisuals import * from copy import copy import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -50,7 +50,7 @@ class ToolMove(AppTool): if self.app.is_legacy is False: self.sel_shapes = ShapeCollection(parent=self.app.plotcanvas.view.scene, layers=1) else: - from AppGUI.PlotCanvasLegacy import ShapeCollectionLegacy + from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy self.sel_shapes = ShapeCollectionLegacy(obj=self, app=self.app, name="move") self.mm = None diff --git a/AppTools/ToolNCC.py b/appTools/ToolNCC.py similarity index 99% rename from AppTools/ToolNCC.py rename to appTools/ToolNCC.py index b49acaa9..7fba13b6 100644 --- a/AppTools/ToolNCC.py +++ b/appTools/ToolNCC.py @@ -7,10 +7,10 @@ from PyQt5 import QtWidgets, QtCore, QtGui -from AppTool import AppTool -from AppGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCInputDialog, FCButton,\ +from appTool import AppTool +from appGUI.GUIElements import FCCheckBox, FCDoubleSpinner, RadioSet, FCTable, FCInputDialog, FCButton,\ FCComboBox, OptionalInputSection -from AppParsers.ParseGerber import Gerber +from appParsers.ParseGerber import Gerber from camlib import grace @@ -27,7 +27,7 @@ from matplotlib.backend_bases import KeyEvent as mpl_key_event import logging import traceback import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolOptimal.py b/appTools/ToolOptimal.py similarity index 99% rename from AppTools/ToolOptimal.py rename to appTools/ToolOptimal.py index 234ec2e7..3c16e797 100644 --- a/AppTools/ToolOptimal.py +++ b/appTools/ToolOptimal.py @@ -7,8 +7,8 @@ from PyQt5 import QtWidgets, QtCore, QtGui -from AppTool import AppTool -from AppGUI.GUIElements import OptionalHideInputSection, FCTextArea, FCEntry, FCSpinner, FCCheckBox, FCComboBox +from appTool import AppTool +from appGUI.GUIElements import OptionalHideInputSection, FCTextArea, FCEntry, FCSpinner, FCCheckBox, FCComboBox from camlib import grace from shapely.geometry import MultiPolygon @@ -18,7 +18,7 @@ import numpy as np import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolPDF.py b/appTools/ToolPDF.py similarity index 99% rename from AppTools/ToolPDF.py rename to appTools/ToolPDF.py index 59f4f7a6..b0100d17 100644 --- a/AppTools/ToolPDF.py +++ b/appTools/ToolPDF.py @@ -7,9 +7,9 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool +from appTool import AppTool -from AppParsers.ParsePDF import PdfParser, grace +from appParsers.ParsePDF import PdfParser, grace from shapely.geometry import Point, MultiPolygon from shapely.ops import unary_union @@ -22,7 +22,7 @@ import logging import traceback import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -351,7 +351,7 @@ class ToolPDF(AppTool): self.app.worker_task.emit({'fcn': self.layer_rendering_as_gerber, 'params': [filename, ap_dict, layer_nr]}) # delete the object already processed so it will not be processed again for other objects - # that were opened at the same time; like in drag & drop on AppGUI + # that were opened at the same time; like in drag & drop on appGUI for obj_name in obj_to_delete: if obj_name in self.pdf_parsed: self.pdf_parsed.pop(obj_name) diff --git a/AppTools/ToolPaint.py b/appTools/ToolPaint.py similarity index 99% rename from AppTools/ToolPaint.py rename to appTools/ToolPaint.py index 50c22076..7de88450 100644 --- a/AppTools/ToolPaint.py +++ b/appTools/ToolPaint.py @@ -8,12 +8,12 @@ from PyQt5 import QtWidgets, QtGui, QtCore from PyQt5.QtCore import Qt -from AppTool import AppTool +from appTool import AppTool from copy import deepcopy # from ObjectCollection import * -from AppParsers.ParseGerber import Gerber +from appParsers.ParseGerber import Gerber from camlib import Geometry, FlatCAMRTreeStorage, grace -from AppGUI.GUIElements import FCTable, FCDoubleSpinner, FCCheckBox, FCInputDialog, RadioSet, FCButton, FCComboBox +from appGUI.GUIElements import FCTable, FCDoubleSpinner, FCCheckBox, FCInputDialog, RadioSet, FCButton, FCComboBox from shapely.geometry import base, Polygon, MultiPolygon, LinearRing, Point from shapely.ops import cascaded_union, unary_union, linemerge @@ -27,7 +27,7 @@ import traceback import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolPanelize.py b/appTools/ToolPanelize.py similarity index 99% rename from AppTools/ToolPanelize.py rename to appTools/ToolPanelize.py index 7c2325e1..0db27472 100644 --- a/AppTools/ToolPanelize.py +++ b/appTools/ToolPanelize.py @@ -6,9 +6,9 @@ # ########################################################## from PyQt5 import QtWidgets, QtGui, QtCore -from AppTool import AppTool +from appTool import AppTool -from AppGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCCheckBox, OptionalInputSection, FCComboBox +from appGUI.GUIElements import FCSpinner, FCDoubleSpinner, RadioSet, FCCheckBox, OptionalInputSection, FCComboBox from camlib import grace from copy import deepcopy @@ -19,7 +19,7 @@ from shapely.ops import unary_union from shapely.geometry import LineString import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins import logging diff --git a/AppTools/ToolPcbWizard.py b/appTools/ToolPcbWizard.py similarity index 99% rename from AppTools/ToolPcbWizard.py rename to appTools/ToolPcbWizard.py index a9fc6075..0cb93bd8 100644 --- a/AppTools/ToolPcbWizard.py +++ b/appTools/ToolPcbWizard.py @@ -7,8 +7,8 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import RadioSet, FCSpinner, FCButton, FCTable +from appTool import AppTool +from appGUI.GUIElements import RadioSet, FCSpinner, FCButton, FCTable import re import os @@ -16,7 +16,7 @@ from datetime import datetime from io import StringIO import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolProperties.py b/appTools/ToolProperties.py similarity index 99% rename from AppTools/ToolProperties.py rename to appTools/ToolProperties.py index 59d73a8c..77d9065c 100644 --- a/AppTools/ToolProperties.py +++ b/appTools/ToolProperties.py @@ -6,8 +6,8 @@ # ########################################################## from PyQt5 import QtGui, QtCore, QtWidgets -from AppTool import AppTool -from AppGUI.GUIElements import FCTree +from appTool import AppTool +from appGUI.GUIElements import FCTree from shapely.geometry import MultiPolygon, Polygon from shapely.ops import cascaded_union @@ -17,7 +17,7 @@ import math import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolPunchGerber.py b/appTools/ToolPunchGerber.py similarity index 99% rename from AppTools/ToolPunchGerber.py rename to appTools/ToolPunchGerber.py index 819d9407..3c9f8fde 100644 --- a/AppTools/ToolPunchGerber.py +++ b/appTools/ToolPunchGerber.py @@ -7,15 +7,15 @@ from PyQt5 import QtCore, QtWidgets -from AppTool import AppTool -from AppGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox +from appTool import AppTool +from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, FCComboBox from copy import deepcopy import logging from shapely.geometry import MultiPolygon, Point import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolQRCode.py b/appTools/ToolQRCode.py similarity index 99% rename from AppTools/ToolQRCode.py rename to appTools/ToolQRCode.py index f9d5c894..5c79a7be 100644 --- a/AppTools/ToolQRCode.py +++ b/appTools/ToolQRCode.py @@ -8,9 +8,9 @@ from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtCore import Qt -from AppTool import AppTool -from AppGUI.GUIElements import RadioSet, FCTextArea, FCSpinner, FCEntry, FCCheckBox, FCComboBox, FCFileSaveDialog -from AppParsers.ParseSVG import * +from appTool import AppTool +from appGUI.GUIElements import RadioSet, FCTextArea, FCSpinner, FCEntry, FCCheckBox, FCComboBox, FCFileSaveDialog +from appParsers.ParseSVG import * from shapely.geometry.base import * from shapely.ops import unary_union @@ -28,7 +28,7 @@ import qrcode.image.pil from lxml import etree as ET import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolRulesCheck.py b/appTools/ToolRulesCheck.py similarity index 99% rename from AppTools/ToolRulesCheck.py rename to appTools/ToolRulesCheck.py index 2761e1a9..aa7d95a4 100644 --- a/AppTools/ToolRulesCheck.py +++ b/appTools/ToolRulesCheck.py @@ -7,18 +7,18 @@ from PyQt5 import QtWidgets -from AppTool import AppTool -from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, OptionalInputSection, FCComboBox +from appTool import AppTool +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, OptionalInputSection, FCComboBox from copy import deepcopy -from AppPool import * +from appPool import * # from os import getpid from shapely.ops import nearest_points from shapely.geometry import MultiPolygon, Polygon import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolShell.py b/appTools/ToolShell.py similarity index 99% rename from AppTools/ToolShell.py rename to appTools/ToolShell.py index aa5a5e87..7185c84a 100644 --- a/AppTools/ToolShell.py +++ b/appTools/ToolShell.py @@ -10,7 +10,7 @@ from PyQt5.QtCore import Qt from PyQt5.QtGui import QTextCursor, QPixmap from PyQt5.QtWidgets import QVBoxLayout, QWidget, QHBoxLayout, QLabel -from AppGUI.GUIElements import _BrowserTextEdit, _ExpandableTextEdit, FCLabel +from appGUI.GUIElements import _BrowserTextEdit, _ExpandableTextEdit, FCLabel import html import sys import traceback @@ -19,7 +19,7 @@ import tkinter as tk import tclCommands import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolSolderPaste.py b/appTools/ToolSolderPaste.py similarity index 99% rename from AppTools/ToolSolderPaste.py rename to appTools/ToolSolderPaste.py index 85bf636b..bc0e29d4 100644 --- a/AppTools/ToolSolderPaste.py +++ b/appTools/ToolSolderPaste.py @@ -5,13 +5,13 @@ # MIT Licence # # ########################################################## -from AppTool import AppTool +from appTool import AppTool from Common import LoudDict -from AppGUI.GUIElements import FCComboBox, FCEntry, FCTable, \ +from appGUI.GUIElements import FCComboBox, FCEntry, FCTable, \ FCInputDialog, FCDoubleSpinner, FCSpinner, FCFileSaveDialog -from App_Main import log +from app_Main import log from camlib import distance -from AppEditors.FlatCAMTextEditor import TextEditor +from appEditors.FlatCAMTextEditor import TextEditor from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5.QtCore import Qt @@ -25,7 +25,7 @@ import traceback from io import StringIO import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolSub.py b/appTools/ToolSub.py similarity index 99% rename from AppTools/ToolSub.py rename to appTools/ToolSub.py index c2072bfd..5a178173 100644 --- a/AppTools/ToolSub.py +++ b/appTools/ToolSub.py @@ -7,8 +7,8 @@ from PyQt5 import QtWidgets, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import FCCheckBox, FCButton, FCComboBox +from appTool import AppTool +from appGUI.GUIElements import FCCheckBox, FCButton, FCComboBox from shapely.geometry import Polygon, MultiPolygon, MultiLineString, LineString from shapely.ops import cascaded_union @@ -18,7 +18,7 @@ from copy import deepcopy import time import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/AppTools/ToolTransform.py b/appTools/ToolTransform.py similarity index 98% rename from AppTools/ToolTransform.py rename to appTools/ToolTransform.py index 9cd28afc..61ccf5fa 100644 --- a/AppTools/ToolTransform.py +++ b/appTools/ToolTransform.py @@ -6,14 +6,14 @@ # ########################################################## from PyQt5 import QtWidgets, QtGui, QtCore -from AppTool import AppTool -from AppGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCButton, OptionalInputSection, FCEntry, FCComboBox, \ +from appTool import AppTool +from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, FCButton, OptionalInputSection, FCEntry, FCComboBox, \ NumericalEvalTupleEntry import numpy as np import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -713,7 +713,7 @@ class ToolTransform(AppTool): self.app.worker_task.emit({'fcn': self.on_buffer_action, 'params': [value, join]}) def on_buffer_by_factor(self): - value = self.buffer_factor_entry.get_value() / 100.0 + value = 1 + self.buffer_factor_entry.get_value() / 100.0 join = 1 if self.buffer_rounded_cb.get_value() else 2 # tell the buffer method to use the factor @@ -875,8 +875,8 @@ class ToolTransform(AppTool): self.app.inform.emit('[success] %s %s %s...' % (_('Offset 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."))) + self.app.inform.emit('[ERROR_NOTCL] %s: %s.' % + (_("Action was not executed, due of"), str(e))) return def on_buffer_action(self, value, join, factor=None): @@ -911,8 +911,8 @@ class ToolTransform(AppTool): except Exception as e: self.app.log.debug("ToolTransform.on_buffer_action() --> %s" % str(e)) - self.app.inform.emit('[ERROR_NOTCL] %s %s, %s.' % - (_("Due of"), str(e), _("action was not executed."))) + self.app.inform.emit('[ERROR_NOTCL] %s: %s.' % + (_("Action was not executed, due of"), str(e))) return @staticmethod diff --git a/appTools/__init__.py b/appTools/__init__.py new file mode 100644 index 00000000..edb12c5a --- /dev/null +++ b/appTools/__init__.py @@ -0,0 +1,45 @@ + +from appTools.ToolCalculators import ToolCalculator +from appTools.ToolCalibration import ToolCalibration + +from appTools.ToolDblSided import DblSidedTool +from appTools.ToolExtractDrills import ToolExtractDrills +from appTools.ToolAlignObjects import AlignObjects + +from appTools.ToolFilm import Film + +from appTools.ToolImage import ToolImage + +from appTools.ToolDistance import Distance +from appTools.ToolDistanceMin import DistanceMin + +from appTools.ToolMove import ToolMove + +from appTools.ToolCutOut import CutOut +from appTools.ToolNCC import NonCopperClear +from appTools.ToolPaint import ToolPaint +from appTools.ToolIsolation import ToolIsolation + +from appTools.ToolOptimal import ToolOptimal + +from appTools.ToolPanelize import Panelize +from appTools.ToolPcbWizard import PcbWizard +from appTools.ToolPDF import ToolPDF +from appTools.ToolProperties import Properties + +from appTools.ToolQRCode import QRCode +from appTools.ToolRulesCheck import RulesCheck + +from appTools.ToolCopperThieving import ToolCopperThieving +from appTools.ToolFiducials import ToolFiducials + +from appTools.ToolShell import FCShell +from appTools.ToolSolderPaste import SolderPaste +from appTools.ToolSub import ToolSub + +from appTools.ToolTransform import ToolTransform +from appTools.ToolPunchGerber import ToolPunchGerber + +from appTools.ToolInvertGerber import ToolInvertGerber +from appTools.ToolCorners import ToolCorners +from appTools.ToolEtchCompensation import ToolEtchCompensation \ No newline at end of file diff --git a/AppTranslation.py b/appTranslation.py similarity index 100% rename from AppTranslation.py rename to appTranslation.py diff --git a/AppWorker.py b/appWorker.py similarity index 100% rename from AppWorker.py rename to appWorker.py diff --git a/AppWorkerStack.py b/appWorkerStack.py similarity index 98% rename from AppWorkerStack.py rename to appWorkerStack.py index fc8cd6d2..1f0a3478 100644 --- a/AppWorkerStack.py +++ b/appWorkerStack.py @@ -1,5 +1,5 @@ from PyQt5 import QtCore -from AppWorker import Worker +from appWorker import Worker import multiprocessing diff --git a/App_Main.py b/app_Main.py similarity index 99% rename from App_Main.py rename to app_Main.py index 9e43fc29..387d7b2c 100644 --- a/App_Main.py +++ b/app_Main.py @@ -48,7 +48,7 @@ from Common import color_variant from Common import ExclusionAreas from Bookmark import BookmarkManager -from AppDatabase import ToolsDB2 +from appDatabase import ToolsDB2 from vispy.gloo.util import _screenshot from vispy.io import write_png @@ -57,43 +57,43 @@ from vispy.io import write_png from defaults import FlatCAMDefaults # FlatCAM Objects -from AppGUI.preferences.OptionsGroupUI import OptionsGroupUI -from AppGUI.preferences.PreferencesUIManager import PreferencesUIManager -from AppObjects.ObjectCollection import * -from AppObjects.FlatCAMObj import FlatCAMObj -from AppObjects.AppObject import AppObject +from appGUI.preferences.OptionsGroupUI import OptionsGroupUI +from appGUI.preferences.PreferencesUIManager import PreferencesUIManager +from appObjects.ObjectCollection import * +from appObjects.FlatCAMObj import FlatCAMObj +from appObjects.AppObject import AppObject # FlatCAM Parsing files -from AppParsers.ParseExcellon import Excellon -from AppParsers.ParseGerber import Gerber +from appParsers.ParseExcellon import Excellon +from appParsers.ParseGerber import Gerber from camlib import to_dict, dict2obj, ET, ParseError, Geometry, CNCjob -# FlatCAM AppGUI -from AppGUI.PlotCanvas import * -from AppGUI.PlotCanvasLegacy import * -from AppGUI.MainGUI import * -from AppGUI.GUIElements import FCFileSaveDialog, message_dialog, FlatCAMSystemTray +# FlatCAM appGUI +from appGUI.PlotCanvas import * +from appGUI.PlotCanvasLegacy import * +from appGUI.MainGUI import * +from appGUI.GUIElements import FCFileSaveDialog, message_dialog, FlatCAMSystemTray # FlatCAM Pre-processors -from AppPreProcessor import load_preprocessors +from appPreProcessor import load_preprocessors -# FlatCAM AppEditors -from AppEditors.FlatCAMGeoEditor import FlatCAMGeoEditor -from AppEditors.FlatCAMExcEditor import FlatCAMExcEditor -from AppEditors.FlatCAMGrbEditor import FlatCAMGrbEditor -from AppEditors.FlatCAMTextEditor import TextEditor -from AppParsers.ParseHPGL2 import HPGL2 +# FlatCAM appEditors +from appEditors.FlatCAMGeoEditor import FlatCAMGeoEditor +from appEditors.FlatCAMExcEditor import FlatCAMExcEditor +from appEditors.FlatCAMGrbEditor import FlatCAMGrbEditor +from appEditors.FlatCAMTextEditor import TextEditor +from appParsers.ParseHPGL2 import HPGL2 # FlatCAM Workers -from AppProcess import * -from AppWorkerStack import WorkerStack +from appProcess import * +from appWorkerStack import WorkerStack # FlatCAM Tools -from AppTools import * +from appTools import * # FlatCAM Translation import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins if sys.platform == 'win32': @@ -380,7 +380,7 @@ class App(QtCore.QObject): json.dump({}, f) f.close() - # Write factory_defaults.FlatConfig file to disk + # the factory defaults are written only once at the first launch of the application after installation FlatCAMDefaults.save_factory_defaults(os.path.join(self.data_path, "factory_defaults.FlatConfig"), self.version) # create a recent files json file if there is none @@ -568,6 +568,7 @@ class App(QtCore.QObject): self.preferencesUiManager = PreferencesUIManager(defaults=self.defaults, data_path=self.data_path, ui=self.ui, inform=self.inform) + self.preferencesUiManager.defaults_write_form() # When the self.defaults dictionary changes will update the Preferences GUI forms @@ -1051,7 +1052,7 @@ class App(QtCore.QObject): # ########################################## Other setups ################################################### # ########################################################################################################### - # to use for tools like Distance tool who depends on the event sources who are changed inside the AppEditors + # to use for tools like Distance tool who depends on the event sources who are changed inside the appEditors # depending on from where those tools are called different actions can be done self.call_source = 'app' @@ -1527,7 +1528,7 @@ class App(QtCore.QObject): except AttributeError: self.tool_shapes = None else: - from AppGUI.PlotCanvasLegacy import ShapeCollectionLegacy + from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy self.tool_shapes = ShapeCollectionLegacy(obj=self, app=self, name="tool") # used in the delayed shutdown self.start_delayed_quit() method @@ -1541,18 +1542,18 @@ class App(QtCore.QObject): # at the first launch of the App , the editors will not be functional. try: self.geo_editor = FlatCAMGeoEditor(self) - except AttributeError: - pass + except Exception as es: + log.debug("app_Main.__init__() --> Geo Editor Error: %s" % str(es)) try: self.exc_editor = FlatCAMExcEditor(self) - except AttributeError: - pass + except Exception as es: + log.debug("app_Main.__init__() --> Excellon Editor Error: %s" % str(es)) try: self.grb_editor = FlatCAMGrbEditor(self) - except AttributeError: - pass + except Exception as es: + log.debug("app_Main.__init__() --> Gerber Editor Error: %s" % str(es)) self.log.debug("Finished adding FlatCAM Editor's.") self.set_ui_title(name=_("New Project - Not saved")) @@ -1682,7 +1683,7 @@ class App(QtCore.QObject): try: shutil.copytree(from_path, to_path) except FileNotFoundError: - from_new_path = os.path.dirname(os.path.realpath(__file__)) + '\\AppGUI\\VisPyData\\data' + from_new_path = os.path.dirname(os.path.realpath(__file__)) + '\\appGUI\\VisPyData\\data' shutil.copytree(from_new_path, to_path) def on_startup_args(self, args, silent=False): @@ -2104,7 +2105,7 @@ class App(QtCore.QObject): """ self.defaults.report_usage("object2editor()") - # disable the objects menu as it may interfere with the AppEditors + # disable the objects menu as it may interfere with the appEditors self.ui.menuobjects.setDisabled(True) edited_object = self.collection.get_active() @@ -2240,7 +2241,7 @@ class App(QtCore.QObject): # self.geo_editor.update_options(edited_obj) # restore GUI to the Selected TAB - # Remove anything else in the AppGUI + # Remove anything else in the appGUI self.ui.tool_scroll_area.takeWidget() # update the geo object options so it is including the bounding box values @@ -2277,7 +2278,7 @@ class App(QtCore.QObject): self.inform.emit('[success] %s' % _("Editor exited. Editor content saved.")) # restore GUI to the Selected TAB - # Remove anything else in the AppGUI + # Remove anything else in the appGUI self.ui.selected_scroll_area.takeWidget() elif isinstance(edited_obj, ExcellonObject): @@ -2286,7 +2287,7 @@ class App(QtCore.QObject): # self.exc_editor.update_options(edited_obj) # restore GUI to the Selected TAB - # Remove anything else in the AppGUI + # Remove anything else in the appGUI self.ui.tool_scroll_area.takeWidget() # delete the old object (the source object) if it was an empty one @@ -5914,7 +5915,7 @@ class App(QtCore.QObject): else: self.selection_type = None - # hover effect - enabled in Preferences -> General -> AppGUI Settings + # hover effect - enabled in Preferences -> General -> appGUI Settings if self.defaults['global_hover']: for obj in self.collection.get_list(): try: @@ -6503,7 +6504,7 @@ class App(QtCore.QObject): # Init FlatCAMTools self.init_tools() - # Try to close all tabs in the PlotArea but only if the AppGUI is active (CLI is None) + # Try to close all tabs in the PlotArea but only if the appGUI is active (CLI is None) if cli is None: # we need to go in reverse because once we remove a tab then the index changes # meaning that removing the first tab (idx = 0) then the tab at former idx = 1 will assume idx = 0 @@ -8382,7 +8383,7 @@ class App(QtCore.QObject): # Register recent file self.file_opened.emit("svg", filename) - # AppGUI feedback + # appGUI feedback self.inform.emit('[success] %s: %s' % (_("Opened"), filename)) def import_dxf(self, filename, geo_type='geometry', outname=None, plot=True): @@ -8428,7 +8429,7 @@ class App(QtCore.QObject): # Register recent file self.file_opened.emit("dxf", filename) - # AppGUI feedback + # appGUI feedback self.inform.emit('[success] %s: %s' % (_("Opened"), filename)) def open_gerber(self, filename, outname=None, plot=True, from_tcl=False): @@ -8492,7 +8493,7 @@ class App(QtCore.QObject): # Register recent file self.file_opened.emit("gerber", filename) - # AppGUI feedback + # appGUI feedback self.inform.emit('[success] %s: %s' % (_("Opened"), filename)) def open_excellon(self, filename, outname=None, plot=True, from_tcl=False): @@ -8559,7 +8560,7 @@ class App(QtCore.QObject): # Register recent file self.file_opened.emit("excellon", filename) - # AppGUI feedback + # appGUI feedback self.inform.emit('[success] %s: %s' % (_("Opened"), filename)) def open_gcode(self, filename, outname=None, force_parsing=None, plot=True, from_tcl=False): @@ -8625,7 +8626,7 @@ class App(QtCore.QObject): # Register recent file self.file_opened.emit("cncjob", filename) - # AppGUI feedback + # appGUI feedback self.inform.emit('[success] %s: %s' % (_("Opened"), filename)) def open_hpgl2(self, filename, outname=None): @@ -8690,7 +8691,7 @@ class App(QtCore.QObject): # Register recent file self.file_opened.emit("geometry", filename) - # AppGUI feedback + # appGUI feedback self.inform.emit('[success] %s: %s' % (_("Opened"), filename)) def open_script(self, filename, outname=None, silent=False): @@ -8747,7 +8748,7 @@ class App(QtCore.QObject): # Register recent file self.file_opened.emit("script", filename) - # AppGUI feedback + # appGUI feedback self.inform.emit('[success] %s: %s' % (_("Opened"), filename)) def open_config_file(self, filename, run_from_arg=None): @@ -9176,11 +9177,11 @@ class App(QtCore.QObject): #
  • Loat/Import a Gerber, Excellon, Gcode, DXF, Raster Image or SVG # file into # FlatCAM using either the menu's, toolbars, key shortcuts or - # even dragging and dropping the files on the AppGUI.
    + # even dragging and dropping the files on the appGUI.
    #
    # You can also load a FlatCAM project by double clicking on the project file, drag & # drop of the - # file into the FLATCAM AppGUI or through the menu/toolbar links offered within the app.

    + # file into the FLATCAM appGUI or through the menu/toolbar links offered within the app.
    #  
  • #
  • Once an object is available in the Project Tab, by selecting it # and then @@ -9239,9 +9240,9 @@ class App(QtCore.QObject): s1=_("The normal flow when working with the application is the following:"), s2=_("Load/Import a Gerber, Excellon, Gcode, DXF, Raster Image or SVG file into the application " "using either the toolbars, key shortcuts or even dragging and dropping the " - "files on the AppGUI."), + "files on the appGUI."), s3=_("You can also load a project by double clicking on the project file, " - "drag and drop of the file into the AppGUI or through the menu (or toolbar) " + "drag and drop of the file into the appGUI or through the menu (or toolbar) " "actions offered within the app."), s4=_("Once an object is available in the Project Tab, by selecting it and then focusing " "on SELECTED TAB (more simpler is to double click the object name in the Project Tab, " @@ -9936,7 +9937,7 @@ class ArgsThread(QtCore.QObject): address = ('/tmp/testipc', 'AF_UNIX') def __init__(self): - super(ArgsThread, self).__init__() + super().__init__() self.listener = None self.thread_exit = False diff --git a/camlib.py b/camlib.py index 5f304dfe..b28cea9c 100644 --- a/camlib.py +++ b/camlib.py @@ -50,8 +50,8 @@ from Common import GracefulException as grace # from scipy.spatial import KDTree, Delaunay # from scipy.spatial import Delaunay -from AppParsers.ParseSVG import * -from AppParsers.ParseDXF import * +from appParsers.ParseSVG import * +from appParsers.ParseDXF import * if platform.architecture()[0] == '64bit': from ortools.constraint_solver import pywrapcp @@ -60,7 +60,7 @@ if platform.architecture()[0] == '64bit': import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') @@ -500,7 +500,7 @@ class Geometry(object): if self.app.is_legacy is False: self.temp_shapes = self.app.plotcanvas.new_shape_collection(layers=1) else: - from AppGUI.PlotCanvasLegacy import ShapeCollectionLegacy + from appGUI.PlotCanvasLegacy import ShapeCollectionLegacy self.temp_shapes = ShapeCollectionLegacy(obj=self, app=self.app, name='camlib.geometry') def plot_temp_shapes(self, element, color='red'): @@ -3086,7 +3086,7 @@ class CNCjob(Geometry): ) # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - # APPLY Offset only when using the AppGUI, for TclCommand this will create an error + # APPLY Offset only when using the appGUI, for TclCommand this will create an error # because the values for Z offset are created in build_ui() # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! try: @@ -3339,7 +3339,7 @@ class CNCjob(Geometry): ) # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - # APPLY Offset only when using the AppGUI, for TclCommand this will create an error + # APPLY Offset only when using the appGUI, for TclCommand this will create an error # because the values for Z offset are created in build_ui() # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! try: @@ -3537,7 +3537,7 @@ class CNCjob(Geometry): ) # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - # APPLY Offset only when using the AppGUI, for TclCommand this will create an error + # APPLY Offset only when using the appGUI, for TclCommand this will create an error # because the values for Z offset are created in build_ui() # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! try: diff --git a/defaults.py b/defaults.py index 15c7824a..51990d80 100644 --- a/defaults.py +++ b/defaults.py @@ -7,11 +7,11 @@ from camlib import to_dict, CNCjob, Geometry import simplejson import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins -from AppParsers.ParseExcellon import Excellon -from AppParsers.ParseGerber import Gerber +from appParsers.ParseExcellon import Excellon +from appParsers.ParseGerber import Gerber fcTranslate.apply_language('strings') if '_' not in builtins.__dict__: @@ -707,6 +707,13 @@ class FlatCAMDefaults: """Writes the factory defaults to a file at the given path, overwriting any existing file.""" # Delete any existing factory defaults file if os.path.isfile(file_path): + # check if it has content other than an empty dict, because if it does we don't need it to be updated + # each time the app starts + with open(file_path, "r") as file: + f_defaults = simplejson.loads(file.read()) + if f_defaults: + return + os.chmod(file_path, stat.S_IRWXO | stat.S_IWRITE | stat.S_IWGRP) os.remove(file_path) diff --git a/make_freezed.py b/make_freezed.py index 170fc7a7..0ec9742a 100644 --- a/make_freezed.py +++ b/make_freezed.py @@ -63,7 +63,7 @@ include_files.append(("assets/examples", "lib/assets/examples")) include_files.append(("assets/linux", "lib/assets/linux")) include_files.append(("assets/resources", "lib/assets/resources")) # include_files.append(("share", "lib/share")) -include_files.append(("AppGUI/VisPyData", "lib/vispy")) +include_files.append(("appGUI/VisPyData", "lib/vispy")) include_files.append(("config", "lib/config")) include_files.append(("README.md", "README.md")) diff --git a/preprocessors/Berta_CNC.py b/preprocessors/Berta_CNC.py index c17028c1..43c553e2 100644 --- a/preprocessors/Berta_CNC.py +++ b/preprocessors/Berta_CNC.py @@ -10,7 +10,7 @@ # MIT Licence # ############################################################## -from AppPreProcessor import * +from appPreProcessor import * class Berta_CNC(PreProc): @@ -102,7 +102,7 @@ class Berta_CNC(PreProc): gcode += '(Spindle Speed: %s RPM)\n' % str(p['spindlespeed']) gcode += ( - # This line allow you to sets the machine to METRIC / INCH in the AppGUI + # This line allow you to sets the machine to METRIC / INCH in the appGUI 'G20\n' if p.units.upper() == 'IN' else 'G21\n') + '\n' # gcode += 'G21\n' # This line sets the machine to METRIC ONLY # gcode += 'G20\n' # This line sets the machine to INCH ONLY diff --git a/preprocessors/GRBL_laser.py b/preprocessors/GRBL_laser.py index 052a4898..62797122 100644 --- a/preprocessors/GRBL_laser.py +++ b/preprocessors/GRBL_laser.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * # This post processor is configured to output code that # is compatible with almost any version of Grbl. diff --git a/preprocessors/ISEL_CNC.py b/preprocessors/ISEL_CNC.py index 3d27a12e..bf2ffd2e 100644 --- a/preprocessors/ISEL_CNC.py +++ b/preprocessors/ISEL_CNC.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class ISEL_CNC(PreProc): diff --git a/preprocessors/ISEL_ICP_CNC.py b/preprocessors/ISEL_ICP_CNC.py index e2690279..3732cd4e 100644 --- a/preprocessors/ISEL_ICP_CNC.py +++ b/preprocessors/ISEL_ICP_CNC.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class ISEL_ICP_CNC(PreProc): diff --git a/preprocessors/Marlin.py b/preprocessors/Marlin.py index a88e8e7d..aea09f12 100644 --- a/preprocessors/Marlin.py +++ b/preprocessors/Marlin.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class Marlin(PreProc): diff --git a/preprocessors/Marlin_laser_FAN_pin.py b/preprocessors/Marlin_laser_FAN_pin.py index 94223295..982fb933 100644 --- a/preprocessors/Marlin_laser_FAN_pin.py +++ b/preprocessors/Marlin_laser_FAN_pin.py @@ -6,7 +6,7 @@ # License: MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class Marlin_laser_FAN_pin(PreProc): diff --git a/preprocessors/Marlin_laser_Spindle_pin.py b/preprocessors/Marlin_laser_Spindle_pin.py index 9e98c5c3..1d3ca4cf 100644 --- a/preprocessors/Marlin_laser_Spindle_pin.py +++ b/preprocessors/Marlin_laser_Spindle_pin.py @@ -6,7 +6,7 @@ # License: MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class Marlin_laser_Spindle_pin(PreProc): diff --git a/preprocessors/Paste_1.py b/preprocessors/Paste_1.py index 4de695d2..9cff6016 100644 --- a/preprocessors/Paste_1.py +++ b/preprocessors/Paste_1.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class Paste_1(AppPreProcTools): diff --git a/preprocessors/Repetier.py b/preprocessors/Repetier.py index eace3dff..71d5daea 100644 --- a/preprocessors/Repetier.py +++ b/preprocessors/Repetier.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class Repetier(PreProc): diff --git a/preprocessors/Roland_MDX_20.py b/preprocessors/Roland_MDX_20.py index aaafb9b8..199c76b0 100644 --- a/preprocessors/Roland_MDX_20.py +++ b/preprocessors/Roland_MDX_20.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * # for Roland Preprocessors it is mandatory for the preprocessor name (python file and class name, both of them must be diff --git a/preprocessors/Toolchange_Custom.py b/preprocessors/Toolchange_Custom.py index da299c4e..b2bd0067 100644 --- a/preprocessors/Toolchange_Custom.py +++ b/preprocessors/Toolchange_Custom.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class Toolchange_Custom(PreProc): diff --git a/preprocessors/Toolchange_Manual.py b/preprocessors/Toolchange_Manual.py index ba2e8fda..7040c73f 100644 --- a/preprocessors/Toolchange_Manual.py +++ b/preprocessors/Toolchange_Manual.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class Toolchange_Manual(PreProc): diff --git a/preprocessors/Toolchange_Probe_MACH3.py b/preprocessors/Toolchange_Probe_MACH3.py index 4872b12b..5014116a 100644 --- a/preprocessors/Toolchange_Probe_MACH3.py +++ b/preprocessors/Toolchange_Probe_MACH3.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class Toolchange_Probe_MACH3(PreProc): diff --git a/preprocessors/default.py b/preprocessors/default.py index 7da50390..79488f67 100644 --- a/preprocessors/default.py +++ b/preprocessors/default.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class default(PreProc): diff --git a/preprocessors/grbl_11.py b/preprocessors/grbl_11.py index 21aed110..8bc32441 100644 --- a/preprocessors/grbl_11.py +++ b/preprocessors/grbl_11.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class grbl_11(PreProc): diff --git a/preprocessors/hpgl.py b/preprocessors/hpgl.py index 5126d01d..019af04c 100644 --- a/preprocessors/hpgl.py +++ b/preprocessors/hpgl.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * # for Roland Preprocessors it is mandatory for the preprocessor name (python file and class name, both of them must be diff --git a/preprocessors/line_xyz.py b/preprocessors/line_xyz.py index 8bdbc97c..d883abf9 100644 --- a/preprocessors/line_xyz.py +++ b/preprocessors/line_xyz.py @@ -6,7 +6,7 @@ # MIT Licence # # ########################################################## -from AppPreProcessor import * +from appPreProcessor import * class line_xyz(PreProc): diff --git a/tclCommands/TclCommand.py b/tclCommands/TclCommand.py index 9d0ecc8d..2c927ebd 100644 --- a/tclCommands/TclCommand.py +++ b/tclCommands/TclCommand.py @@ -1,6 +1,6 @@ import sys import re -import App_Main +import app_Main 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, App_Main.App): + if not isinstance(self.app, app_Main.App): raise TypeError('Expected FlatCAMApp, got %s.' % type(app)) self.log = self.app.log diff --git a/tclCommands/TclCommandBbox.py b/tclCommands/TclCommandBbox.py index c8fd1273..57be664d 100644 --- a/tclCommands/TclCommandBbox.py +++ b/tclCommands/TclCommandBbox.py @@ -4,7 +4,7 @@ from tclCommands.TclCommand import TclCommand from shapely.ops import cascaded_union import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandBounds.py b/tclCommands/TclCommandBounds.py index e4d68d9b..1d2e94a7 100644 --- a/tclCommands/TclCommandBounds.py +++ b/tclCommands/TclCommandBounds.py @@ -3,7 +3,7 @@ import collections import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandCopperClear.py b/tclCommands/TclCommandCopperClear.py index 0e849ee5..33b0fcc4 100644 --- a/tclCommands/TclCommandCopperClear.py +++ b/tclCommands/TclCommandCopperClear.py @@ -4,7 +4,7 @@ import collections import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandDrillcncjob.py b/tclCommands/TclCommandDrillcncjob.py index 95b271d8..74bcae18 100644 --- a/tclCommands/TclCommandDrillcncjob.py +++ b/tclCommands/TclCommandDrillcncjob.py @@ -4,7 +4,7 @@ import collections import math import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandGeoCutout.py b/tclCommands/TclCommandGeoCutout.py index 9a1c29bc..99d18797 100644 --- a/tclCommands/TclCommandGeoCutout.py +++ b/tclCommands/TclCommandGeoCutout.py @@ -7,7 +7,7 @@ from shapely.ops import cascaded_union from shapely.geometry import Polygon, LineString, LinearRing import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins log = logging.getLogger('base') diff --git a/tclCommands/TclCommandGetNames.py b/tclCommands/TclCommandGetNames.py index ca6c17b4..b2a7aa06 100644 --- a/tclCommands/TclCommandGetNames.py +++ b/tclCommands/TclCommandGetNames.py @@ -5,7 +5,7 @@ import collections class TclCommandGetNames(TclCommand): """ - Tcl shell command to set an object as active in the AppGUI. + Tcl shell command to set an object as active in the appGUI. example: diff --git a/tclCommands/TclCommandGetPath.py b/tclCommands/TclCommandGetPath.py index 346a9243..91c1276f 100644 --- a/tclCommands/TclCommandGetPath.py +++ b/tclCommands/TclCommandGetPath.py @@ -11,7 +11,7 @@ import collections import os import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandHelp.py b/tclCommands/TclCommandHelp.py index ff1e9d12..f4f36906 100644 --- a/tclCommands/TclCommandHelp.py +++ b/tclCommands/TclCommandHelp.py @@ -11,7 +11,7 @@ from tclCommands.TclCommand import TclCommand import collections import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandJoinExcellon.py b/tclCommands/TclCommandJoinExcellon.py index e3c342e8..ba473b06 100644 --- a/tclCommands/TclCommandJoinExcellon.py +++ b/tclCommands/TclCommandJoinExcellon.py @@ -1,5 +1,5 @@ from tclCommands.TclCommand import TclCommand -from AppObjects.FlatCAMExcellon import ExcellonObject +from appObjects.FlatCAMExcellon import ExcellonObject import collections diff --git a/tclCommands/TclCommandJoinGeometry.py b/tclCommands/TclCommandJoinGeometry.py index 44cfd9b2..5703f8b3 100644 --- a/tclCommands/TclCommandJoinGeometry.py +++ b/tclCommands/TclCommandJoinGeometry.py @@ -1,5 +1,5 @@ from tclCommands.TclCommand import TclCommand -from AppObjects.FlatCAMGeometry import GeometryObject +from appObjects.FlatCAMGeometry import GeometryObject import collections diff --git a/tclCommands/TclCommandNregions.py b/tclCommands/TclCommandNregions.py index e4ba7ac5..00a169e6 100644 --- a/tclCommands/TclCommandNregions.py +++ b/tclCommands/TclCommandNregions.py @@ -5,7 +5,7 @@ from shapely.ops import cascaded_union import collections import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandPaint.py b/tclCommands/TclCommandPaint.py index 617057b0..4ea0d958 100644 --- a/tclCommands/TclCommandPaint.py +++ b/tclCommands/TclCommandPaint.py @@ -4,7 +4,7 @@ import collections import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandPlotAll.py b/tclCommands/TclCommandPlotAll.py index 001afb36..c9b63e7f 100644 --- a/tclCommands/TclCommandPlotAll.py +++ b/tclCommands/TclCommandPlotAll.py @@ -14,7 +14,7 @@ class TclCommandPlotAll(TclCommandSignaled): # List of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon) aliases = ['plot_all'] - description = '%s %s' % ("--", "Plots all objects on AppGUI.") + description = '%s %s' % ("--", "Plots all objects on appGUI.") # Dictionary of types from Tcl command, needs to be ordered arg_names = collections.OrderedDict([ @@ -32,7 +32,7 @@ class TclCommandPlotAll(TclCommandSignaled): # structured help for current command, args needs to be ordered help = { - 'main': "Plots all objects on AppGUI.", + 'main': "Plots all objects on appGUI.", 'args': collections.OrderedDict([ ('plot_status', 'If to display or not the objects: True (1) or False (0).'), ('use_thread', 'If to use multithreading: True (1) or False (0).') diff --git a/tclCommands/TclCommandPlotObjects.py b/tclCommands/TclCommandPlotObjects.py index 5fce3216..1a230b3b 100644 --- a/tclCommands/TclCommandPlotObjects.py +++ b/tclCommands/TclCommandPlotObjects.py @@ -21,7 +21,7 @@ class TclCommandPlotObjects(TclCommand): # List of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon) aliases = ['plot_objects'] - description = '%s %s' % ("--", "Plot a specified list of objects in AppGUI.") + description = '%s %s' % ("--", "Plot a specified list of objects in appGUI.") # Dictionary of types from Tcl command, needs to be ordered arg_names = collections.OrderedDict([ @@ -38,7 +38,7 @@ class TclCommandPlotObjects(TclCommand): # structured help for current command, args needs to be ordered help = { - 'main': "Plot a specified list of objects in AppGUI.", + 'main': "Plot a specified list of objects in appGUI.", 'args': collections.OrderedDict([ ('names', "A list of object names to be plotted separated by comma. Required.\n" "WARNING: no spaces are allowed. If unsure enclose the entire list with quotes."), diff --git a/tclCommands/TclCommandScale.py b/tclCommands/TclCommandScale.py index b447db8c..4c7e4491 100644 --- a/tclCommands/TclCommandScale.py +++ b/tclCommands/TclCommandScale.py @@ -4,7 +4,7 @@ import collections import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandSetActive.py b/tclCommands/TclCommandSetActive.py index febe927b..24979e5a 100644 --- a/tclCommands/TclCommandSetActive.py +++ b/tclCommands/TclCommandSetActive.py @@ -5,7 +5,7 @@ import collections class TclCommandSetActive(TclCommand): """ - Tcl shell command to set an object as active in the AppGUI. + Tcl shell command to set an object as active in the appGUI. example: diff --git a/tclCommands/TclCommandSetOrigin.py b/tclCommands/TclCommandSetOrigin.py index d2c9681c..2a5f5d18 100644 --- a/tclCommands/TclCommandSetOrigin.py +++ b/tclCommands/TclCommandSetOrigin.py @@ -13,7 +13,7 @@ from camlib import get_bounds import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandSetPath.py b/tclCommands/TclCommandSetPath.py index 09b30e43..7a8ae872 100644 --- a/tclCommands/TclCommandSetPath.py +++ b/tclCommands/TclCommandSetPath.py @@ -11,7 +11,7 @@ import collections import os import logging import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings') diff --git a/tclCommands/TclCommandSubtractRectangle.py b/tclCommands/TclCommandSubtractRectangle.py index 95d66bd2..b7b30037 100644 --- a/tclCommands/TclCommandSubtractRectangle.py +++ b/tclCommands/TclCommandSubtractRectangle.py @@ -3,7 +3,7 @@ from tclCommands.TclCommand import TclCommandSignaled import collections import gettext -import AppTranslation as fcTranslate +import appTranslation as fcTranslate import builtins fcTranslate.apply_language('strings')