diff --git a/FlatCAMApp.py b/FlatCAMApp.py
index 0e5c5e02..f2570f42 100644
--- a/FlatCAMApp.py
+++ b/FlatCAMApp.py
@@ -1,10 +1,10 @@
-# ###########################################################
+# ######################################################### ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-# ###########################################################
+# ######################################################### ##
import urllib.request, urllib.parse, urllib.error
import getopt
@@ -25,9 +25,9 @@ import gc
from xml.dom.minidom import parseString as parse_xml_string
-# #######################################
-# # Imports part of FlatCAM ##
-# #######################################
+# ##################################### ##
+# # Imports part of FlatCAM # ##
+# ##################################### ##
from ObjectCollection import *
from FlatCAMObj import *
from flatcamGUI.PlotCanvas import *
@@ -58,9 +58,9 @@ fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__:
_ = gettext.gettext
-# #######################################
-# # App ##
-# #######################################
+# ##################################### ##
+# # App # ##
+# ##################################### ##
class App(QtCore.QObject):
@@ -84,7 +84,7 @@ class App(QtCore.QObject):
elif opt == '--shellfile':
cmd_line_shellfile = arg
- # Logging ##
+ # Logging # ##
log = logging.getLogger('base')
log.setLevel(logging.DEBUG)
# log.setLevel(logging.WARNING)
@@ -94,8 +94,8 @@ class App(QtCore.QObject):
log.addHandler(handler)
# Version
- version = 8.917
- version_date = "2019/05/22"
+ version = 8.918
+ version_date = "2019/06/11"
beta = True
# current date now
@@ -120,9 +120,9 @@ class App(QtCore.QObject):
# flag is True if saving action has been triggered
save_in_progress = False
- # #################
- # # Signals ##
- # #################
+ # ############### ##
+ # # Signals # ##
+ # ############### ##
# Inform the user
# Handled by:
@@ -191,9 +191,9 @@ class App(QtCore.QObject):
self.main_thread = QtWidgets.QApplication.instance().thread()
- # ##################
- # ## OS-specific ###
- # ##################
+ # ################ ##
+ # # ## OS-specific # ##
+ # ################ ##
# Folder for user settings.
if sys.platform == 'win32':
@@ -209,9 +209,9 @@ class App(QtCore.QObject):
self.data_path = os.path.expanduser('~') + '/.FlatCAM'
self.os = 'unix'
- # ##############################
- # ## Setup folders and files ###
- # ##############################
+ # ############################ ##
+ # # ## Setup folders and files # ##
+ # ############################ ##
if not os.path.exists(self.data_path):
os.makedirs(self.data_path)
@@ -272,9 +272,9 @@ class App(QtCore.QObject):
# variable to store mouse coordinates
self.mouse = [0, 0]
- # ###################
- # # Initialize GUI ##
- # ###################
+ # ################# ##
+ # # Initialize GUI # ##
+ # ################# ##
# FlatCAM colors used in plotting
self.FC_light_green = '#BBF268BF'
@@ -291,9 +291,9 @@ class App(QtCore.QObject):
self.ui.geom_update[int, int, int, int, int].connect(self.save_geometry)
self.ui.final_save.connect(self.final_save)
- # #############
- # ### Data ####
- # #############
+ # ########### ##
+ # # ## Data ## ##
+ # ########### ##
self.recent = []
self.clipboard = QtWidgets.QApplication.clipboard()
self.proc_container = FCVisibleProcessContainer(self.ui.activity_view)
@@ -566,9 +566,9 @@ class App(QtCore.QObject):
}
- # ############################
- # ### LOAD POSTPROCESSORS ####
- # ############################
+ # ########################## ##
+ # # ## LOAD POSTPROCESSORS ## ##
+ # ########################## ##
self.postprocessors = load_postprocessors(self)
@@ -585,9 +585,9 @@ class App(QtCore.QObject):
self.ui.excellon_defaults_form.excellon_opt_group.pp_excellon_name_cb.addItem(name)
- # ############################
- # ### LOAD LANGUAGES ####
- # ############################
+ # ########################## ##
+ # # ## LOAD LANGUAGES ## ##
+ # ########################## ##
self.languages = fcTranslate.load_languages()
for name in sorted(self.languages.values()):
@@ -880,16 +880,16 @@ class App(QtCore.QObject):
"tools_solderpaste_pp": 'Paste_1'
})
- # ##############################
- # ## Load defaults from file ###
- # ##############################
+ # ############################ ##
+ # # ## Load defaults from file # ##
+ # ############################ ##
if user_defaults:
self.load_defaults(filename='current_defaults')
- # ###########################
- # #### APPLY APP LANGUAGE ###
- # ###########################
+ # ######################### ##
+ # #### APPLY APP LANGUAGE # ##
+ # ######################### ##
ret_val = fcTranslate.apply_language('strings')
@@ -902,9 +902,9 @@ class App(QtCore.QObject):
log.debug("App.__init__() --> Applied %s language." % str(ret_val).capitalize())
- # ##################################
- # ## CREATE UNIQUE SERIAL NUMBER ###
- # ##################################
+ # ################################ ##
+ # # ## CREATE UNIQUE SERIAL NUMBER # ##
+ # ################################ ##
chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
if self.defaults['global_serial'] == 0 or len(str(self.defaults['global_serial'])) < 10:
@@ -1171,14 +1171,14 @@ class App(QtCore.QObject):
self.tools_form = None
self.on_options_combo_change(0) # Will show the initial form
- # ## Define OBJECT COLLECTION ###
+ # # ## Define OBJECT COLLECTION # ##
self.collection = ObjectCollection(self)
self.ui.project_tab_layout.addWidget(self.collection.view)
- # ##
+ # # ##
self.log.debug("Finished creating Object Collection.")
- # ## Initialize the color box's color in Preferences -> Global -> Color
+ # # ## Initialize the color box's color in Preferences -> Global -> Color
# Init Plot Colors
self.ui.general_defaults_form.general_gui_group.pf_color_entry.set_value(self.defaults['global_plot_fill'])
self.ui.general_defaults_form.general_gui_group.pf_color_button.setStyleSheet(
@@ -1241,9 +1241,9 @@ class App(QtCore.QObject):
self.defaults['global_proj_item_dis_color'])
self.ui.general_defaults_form.general_gui_group.proj_color_dis_button.setStyleSheet(
"background-color:%s" % str(self.defaults['global_proj_item_dis_color'])[:7])
- # ### End of Data ####
+ # # ## End of Data ## ##
- # ### Plot Area ####
+ # # ## Plot Area ## ##
start_plot_time = time.time() # debug
self.plotcanvas = PlotCanvas(self.ui.right_layout, self)
@@ -1270,27 +1270,27 @@ class App(QtCore.QObject):
end_plot_time = time.time()
self.log.debug("Finished Canvas initialization in %s seconds." % (str(end_plot_time - start_plot_time)))
- # ## EDITOR section
+ # # ## EDITOR section
self.geo_editor = FlatCAMGeoEditor(self, disabled=True)
self.exc_editor = FlatCAMExcEditor(self)
self.grb_editor = FlatCAMGrbEditor(self)
- # ### Adjust tabs width ####
+ # # ## Adjust tabs width ## ##
# self.collection.view.setMinimumWidth(self.ui.options_scroll_area.widget().sizeHint().width() +
# self.ui.options_scroll_area.verticalScrollBar().sizeHint().width())
self.collection.view.setMinimumWidth(290)
self.log.debug("Finished adding FlatCAM Editor's.")
- # ### Worker ####
+ # # ## Worker ## ##
if self.defaults["global_worker_number"]:
self.workers = WorkerStack(workers_number=int(self.defaults["global_worker_number"]))
else:
self.workers = WorkerStack(workers_number=2)
self.worker_task.connect(self.workers.add_task)
- # ## Signal handling ###
- # ## Custom signals
+ # # ## Signal handling # ##
+ # # ## Custom signals
self.inform.connect(self.info)
self.app_quit.connect(self.quit_application)
self.message.connect(self.message_dialog)
@@ -1303,8 +1303,8 @@ class App(QtCore.QObject):
self.file_opened.connect(lambda kind, filename: self.register_folder(filename))
self.file_saved.connect(lambda kind, filename: self.register_save_folder(filename))
- # ## Standard signals
- # ## Menu
+ # # ## Standard signals
+ # # ## Menu
self.ui.menufilenewproject.triggered.connect(self.on_file_new_click)
self.ui.menufilenewgeo.triggered.connect(self.new_geometry_object)
self.ui.menufilenewgrb.triggered.connect(self.new_gerber_object)
@@ -1445,9 +1445,9 @@ class App(QtCore.QObject):
self.ui.pref_export_button.clicked.connect(self.on_export_preferences)
self.ui.pref_open_button.clicked.connect(self.on_preferences_open_folder)
- # ##############################
- # ## GUI PREFERENCES SIGNALS ###
- # ##############################
+ # ############################ ##
+ # # ## GUI PREFERENCES SIGNALS # ##
+ # ############################ ##
self.ui.general_options_form.general_app_group.units_radio.group_toggle_fn = self.on_toggle_units
self.ui.general_defaults_form.general_app_group.language_apply_btn.clicked.connect(
lambda: fcTranslate.on_language_apply_click(self, restart=True)
@@ -1455,9 +1455,9 @@ class App(QtCore.QObject):
self.ui.general_defaults_form.general_app_group.units_radio.activated_custom.connect(
lambda: self.on_toggle_units(no_pref=False))
- # ##############################
- # ## GUI PREFERENCES SIGNALS ###
- # ##############################
+ # ############################ ##
+ # # ## GUI PREFERENCES SIGNALS # ##
+ # ############################ ##
# Setting plot colors signals
self.ui.general_defaults_form.general_gui_group.pf_color_entry.editingFinished.connect(
@@ -1559,20 +1559,20 @@ class App(QtCore.QObject):
else:
self.ui.splitter.setSizes([0, 1])
- # ###################
- # ## Other setups ###
- # ###################
+ # ################# ##
+ # # ## Other setups # ##
+ # ################# ##
# Sets up FlatCAMObj, FCProcess and FCProcessContainer.
self.setup_obj_classes()
self.setup_recent_items()
self.setup_component_editor()
- # ############
- # ## Shell ###
- # ############
+ # ########## ##
+ # # ## Shell # ##
+ # ########## ##
- # ##
+ # # ##
# Auto-complete KEYWORDS
self.tcl_commands_list = ['add_circle', 'add_poly', 'add_polygon', 'add_polyline', 'add_rectangle',
'aligndrill', 'clear',
@@ -1809,9 +1809,9 @@ class App(QtCore.QObject):
else:
self.ui.shell_dock.hide()
- # ########################
- # ## Tools and Plugins ###
- # ########################
+ # ###################### ##
+ # # ## Tools and Plugins # ##
+ # ###################### ##
self.dblsidedtool = None
self.measurement_tool = None
@@ -1833,7 +1833,7 @@ class App(QtCore.QObject):
# always install tools only after the shell is initialized because the self.inform.emit() depends on shell
self.install_tools()
- # ## System Font Parsing ###
+ # # ## System Font Parsing # ##
# self.f_parse = ParseFont(self)
# self.parse_system_fonts()
@@ -1847,9 +1847,9 @@ class App(QtCore.QObject):
print("ERROR: ", ext)
sys.exit(2)
- # ##########################
- # ### Check for updates ####
- # ##########################
+ # ######################## ##
+ # # ## Check for updates ## ##
+ # ######################## ##
# Separate thread (Not worker)
# Check for updates on startup but only if the user consent and the app is not in Beta version
@@ -1862,9 +1862,9 @@ class App(QtCore.QObject):
'params': []})
self.thr2.start(QtCore.QThread.LowPriority)
- # ###################################
- # ### Variables for global usage ####
- # ###################################
+ # ################################# ##
+ # # ## Variables for global usage ## ##
+ # ################################# ##
# coordinates for relative position display
self.rel_point1 = (0, 0)
@@ -1936,8 +1936,8 @@ class App(QtCore.QObject):
self.isHovering = False
self.notHovering = True
- # ## Save defaults to factory_defaults.FlatConfig file ###
- # ## It's done only once after install #############
+ # # ## Save defaults to factory_defaults.FlatConfig file # ##
+ # # ## It's done only once after install ########### ##
factory_file = open(self.data_path + '/factory_defaults.FlatConfig')
fac_def_from_file = factory_file.read()
factory_defaults = json.loads(fac_def_from_file)
@@ -2754,6 +2754,10 @@ class App(QtCore.QObject):
defaults_file_content = None
+ self.date = str(datetime.today()).rpartition('.')[0]
+ self.date = ''.join(c for c in self.date if c not in ':-')
+ self.date = self.date.replace(' ', '_')
+
filter = "Config File (*.FlatConfig);;All Files (*.*)"
try:
filename, _f = QtWidgets.QFileDialog.getSaveFileName(
@@ -2894,7 +2898,7 @@ class App(QtCore.QObject):
t0 = time.time() # Debug
- ## Create object
+ # ## Create object
classdict = {
"gerber": FlatCAMGerber,
"excellon": FlatCAMExcellon,
@@ -4229,7 +4233,7 @@ class App(QtCore.QObject):
pass
if current_layout == 'standard':
- ### TOOLBAR INSTALLATION ###
+ # ## TOOLBAR INSTALLATION # ##
self.ui.toolbarfile = QtWidgets.QToolBar('File Toolbar')
self.ui.toolbarfile.setObjectName('File_TB')
self.ui.addToolBar(self.ui.toolbarfile)
@@ -4273,7 +4277,7 @@ class App(QtCore.QObject):
self.ui.corner_snap_btn.setVisible(False)
self.ui.snap_magnet.setVisible(False)
elif current_layout == 'compact':
- ### TOOLBAR INSTALLATION ###
+ # ## TOOLBAR INSTALLATION # ##
self.ui.toolbarfile = QtWidgets.QToolBar('File Toolbar')
self.ui.toolbarfile.setObjectName('File_TB')
self.ui.addToolBar(Qt.LeftToolBarArea, self.ui.toolbarfile)
@@ -4379,7 +4383,7 @@ class App(QtCore.QObject):
self.ui.code_editor.setPlainText(self.gcode_edited)
file.close()
- def handleSaveGCode(self,name=None, filt=None):
+ def handleSaveGCode(self, name=None, filt=None):
self.report_usage("handleSaveGCode()")
if filt:
@@ -4469,7 +4473,7 @@ class App(QtCore.QObject):
cursor.endEditBlock()
def on_tool_add_keypress(self):
- ## Current application units in Upper Case
+ # ## Current application units in Upper Case
self.units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
notebook_widget_name = self.ui.notebook.currentWidget().objectName()
@@ -5218,7 +5222,7 @@ class App(QtCore.QObject):
self.ui.grid_gap_y_entry.setText(self.sender().text())
def on_grid_add(self):
- ## Current application units in lower Case
+ # ## Current application units in lower Case
units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
grid_add_popup = FCInputDialog(title=_("New Grid ..."),
@@ -5245,7 +5249,7 @@ class App(QtCore.QObject):
_("[WARNING_NOTCL] Adding New Grid cancelled ..."))
def on_grid_delete(self):
- ## Current application units in lower Case
+ # ## Current application units in lower Case
units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
grid_del_popup = FCInputDialog(title="Delete Grid ...",
@@ -5843,7 +5847,7 @@ class App(QtCore.QObject):
if self.call_source != 'app':
self.editor2object(cleanup=True)
- ### EDITOR section
+ # ## EDITOR section
self.geo_editor = FlatCAMGeoEditor(self, disabled=True)
self.exc_editor = FlatCAMExcEditor(self)
self.grb_editor = FlatCAMGrbEditor(self)
@@ -6114,10 +6118,13 @@ class App(QtCore.QObject):
self.file_saved.emit("SVG", filename)
def on_file_exportpng(self):
-
self.report_usage("on_file_exportpng")
App.log.debug("on_file_exportpng()")
+ self.date = str(datetime.today()).rpartition('.')[0]
+ self.date = ''.join(c for c in self.date if c not in ':-')
+ self.date = self.date.replace(' ', '_')
+
image = _screenshot()
data = np.asarray(image)
if not data.ndim == 3 and data.shape[-1] in (3, 4):
@@ -6425,9 +6432,9 @@ class App(QtCore.QObject):
self.worker_task.emit({'fcn': self.import_dxf,
'params': [filename, type_of_obj]})
- # ##################################################################################################################
- # ## The following section has the functions that are displayed and call the Editor tab CNCJob Tab #################
- # ##################################################################################################################
+ # ################################################################################################################ ##
+ # # ## The following section has the functions that are displayed and call the Editor tab CNCJob Tab ############### ##
+ # ################################################################################################################ ##
def init_code_editor(self, name):
# Signals section
@@ -6634,6 +6641,10 @@ class App(QtCore.QObject):
self.report_usage("on_file_saveprojectas")
+ self.date = str(datetime.today()).rpartition('.')[0]
+ self.date = ''.join(c for c in self.date if c not in ':-')
+ self.date = self.date.replace(' ', '_')
+
filter_ = "FlatCAM Project (*.FlatPrj);; All Files (*.*)"
try:
filename, _f = QtWidgets.QFileDialog.getSaveFileName(
@@ -7481,7 +7492,7 @@ class App(QtCore.QObject):
# Object name
name = outname or filename.split('/')[-1].split('\\')[-1]
- # ## Object creation ###
+ # # ## Object creation # ##
ret = self.new_object("gerber", name, obj_init, autoselected=False)
if ret == 'fail':
self.inform.emit(_('[ERROR_NOTCL] Open Gerber failed. Probable not a Gerber file.'))
@@ -7696,7 +7707,7 @@ class App(QtCore.QObject):
self.file_opened.emit("project", filename)
# Clear the current project
- # # NOT THREAD SAFE ##
+ # # NOT THREAD SAFE # ##
if run_from_arg is True:
pass
else:
@@ -7896,7 +7907,7 @@ class App(QtCore.QObject):
if timeout is not None:
QtCore.QTimer.singleShot(timeout, report_quit)
- # ### Block ####
+ # # ## Block ## ##
loop.exec_()
# Restore exception management
@@ -8201,7 +8212,7 @@ The normal flow when working in FlatCAM is the following:
"&" + urllib.parse.urlencode(no_ststs_dict["global_ststs"])
App.log.debug("Checking for updates @ %s" % full_url)
- ### Get the data
+ # ## Get the data
try:
f = urllib.request.urlopen(full_url)
except:
@@ -8221,7 +8232,7 @@ The normal flow when working in FlatCAM is the following:
f.close()
- ### Latest version?
+ # ## Latest version?
if self.version >= data["version"]:
App.log.debug("FlatCAM is up to date!")
self.inform.emit(_("[success] FlatCAM is up to date!"))
@@ -8375,7 +8386,7 @@ The normal flow when working in FlatCAM is the following:
self.save_in_progress = True
with self.proc_container.new(_("Saving FlatCAM Project")) as proc:
- ## Capture the latest changes
+ # Capture the latest changes
# Current object
try:
self.collection.get_active().read_form()
diff --git a/FlatCAMCommon.py b/FlatCAMCommon.py
index 0e401044..c619acf2 100644
--- a/FlatCAMCommon.py
+++ b/FlatCAMCommon.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
class LoudDict(dict):
diff --git a/FlatCAMObj.py b/FlatCAMObj.py
index 7607a6eb..e5dc3409 100644
--- a/FlatCAMObj.py
+++ b/FlatCAMObj.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
import copy
import inspect # TODO: For debugging only.
@@ -35,9 +35,9 @@ class ValidationError(Exception):
self.errors = errors
-# #######################################
-# # FlatCAMObj ##
-# #######################################
+# ##################################### ##
+# # FlatCAMObj # ##
+# ##################################### ##
class FlatCAMObj(QtCore.QObject):
@@ -2342,7 +2342,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
app_obj.progress.emit(20)
- ### Add properties to the object
+ # ## Add properties to the object
# get the tool_table items in a list of row items
tool_table_items = self.get_selected_tools_table_items()
@@ -2436,7 +2436,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
app_obj.progress.emit(20)
- ### Add properties to the object
+ # ## Add properties to the object
# get the tool_table items in a list of row items
tool_table_items = self.get_selected_tools_table_items()
@@ -2561,7 +2561,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
# insert an information only element in the front
tool_table_items.insert(0, [_("Tool_nr"), _("Diameter"), _("Drills_Nr"), _("Slots_Nr")])
- ### Add properties to the object
+ # ## Add properties to the object
job_obj.origin_kind = 'excellon'
@@ -2932,18 +2932,18 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
"""
pts = []
- ## Iterable: descend into each item.
+ # Iterable: descend into each item.
try:
for subo in o:
pts += FlatCAMGeometry.get_pts(subo)
- ## Non-iterable
+ # Non-iterable
except TypeError:
if o is not None:
if type(o) == MultiPolygon:
for poly in o:
pts += FlatCAMGeometry.get_pts(poly)
- ## Descend into .exerior and .interiors
+ # ## Descend into .exerior and .interiors
elif type(o) == Polygon:
pts += FlatCAMGeometry.get_pts(o.exterior)
for i in o.interiors:
@@ -2951,7 +2951,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
elif type(o) == MultiLineString:
for line in o:
pts += FlatCAMGeometry.get_pts(line)
- ## Has .coords: list them.
+ # ## Has .coords: list them.
else:
pts += list(o.coords)
else:
@@ -3033,6 +3033,9 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
# engine of FlatCAM. Most likely are generated by some of tools and are special cases of geometries.
self. special_group = None
+ self.old_pp_state = ''
+ self.old_toolchangeg_state = ''
+
# Attributes to be included in serialization
# Always append to it because it carries contents
# from predecessors.
@@ -3101,7 +3104,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
self.ui.geo_tools_table.setCellWidget(row_no, 3, type_item)
self.ui.geo_tools_table.setCellWidget(row_no, 4, tool_type_item)
- ### REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY ###
+ # ## REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY # ##
self.ui.geo_tools_table.setItem(row_no, 5, tool_uid_item) # Tool unique ID
self.ui.geo_tools_table.setCellWidget(row_no, 6, plot_item)
@@ -5379,7 +5382,7 @@ class FlatCAMCNCjob(FlatCAMObj, CNCjob):
self.ui.cnc_tools_table.setItem(row_no, 3, type_item) # Toolpath Type
self.ui.cnc_tools_table.setItem(row_no, 4, tool_type_item) # Tool Type
- ### REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY ###
+ # ## REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY # ##
self.ui.cnc_tools_table.setItem(row_no, 5, tool_uid_item) # Tool unique ID)
self.ui.cnc_tools_table.setCellWidget(row_no, 6, plot_item)
diff --git a/FlatCAMPostProc.py b/FlatCAMPostProc.py
index 80c4e9b7..26eb0e8d 100644
--- a/FlatCAMPostProc.py
+++ b/FlatCAMPostProc.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Matthieu Berthomé #
# Date: 5/26/2017 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from importlib.machinery import SourceFileLoader
import os
diff --git a/FlatCAMProcess.py b/FlatCAMProcess.py
index 1556ab4a..8e902f97 100644
--- a/FlatCAMProcess.py
+++ b/FlatCAMProcess.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from flatcamGUI.FlatCAMGUI import FlatCAMActivityView
from PyQt5 import QtCore
diff --git a/FlatCAMTool.py b/FlatCAMTool.py
index db313cac..f5c77497 100644
--- a/FlatCAMTool.py
+++ b/FlatCAMTool.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets, QtWidgets
from PyQt5.QtCore import Qt
diff --git a/FlatCAMTranslation.py b/FlatCAMTranslation.py
index 99ef91e4..48406897 100644
--- a/FlatCAMTranslation.py
+++ b/FlatCAMTranslation.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
import os
import sys
diff --git a/FlatCAMWorker.py b/FlatCAMWorker.py
index 2ccb0d9a..b7041379 100644
--- a/FlatCAMWorker.py
+++ b/FlatCAMWorker.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from PyQt5 import QtCore
diff --git a/ObjectCollection.py b/ObjectCollection.py
index d7706a4b..8454be93 100644
--- a/ObjectCollection.py
+++ b/ObjectCollection.py
@@ -1,14 +1,14 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
-############################################################
+# ########################################################## ##
# File modified by: Dennis Hayrullin #
-############################################################
+# ########################################################## ##
# from PyQt5.QtCore import QModelIndex
from FlatCAMObj import *
@@ -210,7 +210,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
QtCore.QAbstractItemModel.__init__(self)
- ### Icons for the list view
+ # ## Icons for the list view
self.icons = {}
for kind in ObjectCollection.icon_files:
self.icons[kind] = QtGui.QPixmap(ObjectCollection.icon_files[kind])
@@ -230,7 +230,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
# print i.data(0)
# i.append_child(TreeItem(["empty"]))
- ### Data ###
+ # ## Data # ##
self.checked_indexes = []
# Names of objects that are expected to become available.
@@ -245,7 +245,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
self.app = app
- ### View
+ # ## View
self.view = KeySensitiveListView(app)
self.view.setModel(self)
@@ -261,7 +261,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
font.setFamily("Seagoe UI")
self.view.setFont(font)
- ## GUI Events
+ # ## GUI Events
self.view.selectionModel().selectionChanged.connect(self.on_list_selection_change)
self.view.activated.connect(self.on_item_activated)
# self.view.keyPressed.connect(self.on_key)
@@ -399,11 +399,11 @@ class ObjectCollection(QtCore.QAbstractItemModel):
if index.isValid():
obj = index.internalPointer().obj
if obj:
- old_name = str(obj.options['name'])
+ old_name = obj.options['name']
new_name = str(data)
if old_name != new_name and new_name != '':
# rename the object
- obj.options["name"] = str(data)
+ obj.options["name"] = deepcopy(data)
# update the SHELL auto-completer model data
try:
@@ -411,11 +411,12 @@ class ObjectCollection(QtCore.QAbstractItemModel):
self.app.myKeywords.append(new_name)
self.app.shell._edit.set_model_data(self.app.myKeywords)
self.app.ui.code_editor.set_model_data(self.app.myKeywords)
- except:
+ except Exception as e:
log.debug(
- "setData() --> Could not remove the old object name from auto-completer model list")
+ "setData() --> Could not remove the old object name from auto-completer model list. %s" %
+ str(e))
- obj.build_ui()
+ # obj.build_ui()
self.app.inform.emit(_("Object renamed from {old} to {new}").format(old=old_name,
new=new_name))
@@ -452,7 +453,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
# Prevent same name
while name in self.get_names():
- ## Create a new name
+ # ## Create a new name
# Ends with number?
FlatCAMApp.App.log.debug("new_object(): Object name (%s) exists, changing." % name)
match = re.search(r'(.*[^\d])?(\d+)$', name)
diff --git a/README.md b/README.md
index 680098d3..80dfca43 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,13 @@ CAD program, and create G-Code for Isolation routing.
=================================================
+30.05.2019
+
+- editing a multi geometry will no longer pop-up a Tcl window
+- solved issue #292 where a new geometry renamed with many underscores failed to store the name in a saved project
+- the name for the saved projects are updated to the current time and not to the time of the app startup
+- some PEP8 changes related to comments starting with only one '#' symbol
+
24.05.2019
- added a toggle Grid button to the canvas context menu in the Grids submenu
diff --git a/camlib.py b/camlib.py
index a2b1051a..fc2956f0 100644
--- a/camlib.py
+++ b/camlib.py
@@ -1,12 +1,11 @@
-############################################################
-# FlatCAM: 2D Post-processing for Manufacturing #
-# http://flatcam.org #
-# Author: Juan Pablo Caram (c) #
-# Date: 2/5/2014 #
-# MIT Licence #
-############################################################
+# ########################################################## ##
+# FlatCAM: 2D Post-processing for Manufacturing #
+# http://flatcam.org #
+# Author: Juan Pablo Caram (c) #
+# Date: 2/5/2014 #
+# MIT Licence #
+# ########################################################## ##
-#import traceback
from io import StringIO
@@ -58,6 +57,12 @@ if platform.architecture()[0] == '64bit':
from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import routing_enums_pb2
+import gettext
+import FlatCAMTranslation as fcTranslate
+
+fcTranslate.apply_language('strings')
+import builtins
+
log = logging.getLogger('base2')
log.setLevel(logging.DEBUG)
@@ -66,11 +71,6 @@ handler = logging.StreamHandler()
handler.setFormatter(formatter)
log.addHandler(handler)
-import gettext
-import FlatCAMTranslation as fcTranslate
-
-fcTranslate.apply_language('strings')
-import builtins
if '_' not in builtins.__dict__:
_ = gettext.gettext
@@ -132,21 +132,20 @@ class Geometry(object):
:param radius: Radius of the circle.
:return: None
"""
- # TODO: Decide what solid_geometry is supposed to be and how we append to it.
if self.solid_geometry is None:
self.solid_geometry = []
if type(self.solid_geometry) is list:
- self.solid_geometry.append(Point(origin).buffer(radius, int(int(self.geo_steps_per_circle) / 4)))
+ self.solid_geometry.append(Point(origin).buffer(
+ radius, int(int(self.geo_steps_per_circle) / 4)))
return
try:
- self.solid_geometry = self.solid_geometry.union(Point(origin).buffer(radius,
- int(int(self.geo_steps_per_circle) / 4)))
- except:
- #print "Failed to run union on polygons."
- log.error("Failed to run union on polygons.")
+ self.solid_geometry = self.solid_geometry.union(Point(origin).buffer(
+ radius, int(int(self.geo_steps_per_circle) / 4)))
+ except Exception as e:
+ log.error("Failed to run union on polygons. %s" % str(e))
return
def add_polygon(self, points):
@@ -165,9 +164,8 @@ class Geometry(object):
try:
self.solid_geometry = self.solid_geometry.union(Polygon(points))
- except:
- #print "Failed to run union on polygons."
- log.error("Failed to run union on polygons.")
+ except Exception as e:
+ log.error("Failed to run union on polygons. %s" % str(e))
return
def add_polyline(self, points):
@@ -186,13 +184,11 @@ class Geometry(object):
try:
self.solid_geometry = self.solid_geometry.union(LineString(points))
- except:
- #print "Failed to run union on polygons."
- log.error("Failed to run union on polylines.")
+ except Exception as e:
+ log.error("Failed to run union on polylines. %s" % str(e))
return
def is_empty(self):
-
if isinstance(self.solid_geometry, BaseGeometry):
return self.solid_geometry.is_empty
@@ -213,18 +209,18 @@ class Geometry(object):
if self.solid_geometry is None:
self.solid_geometry = []
- #pathonly should be allways True, otherwise polygons are not subtracted
+ # pathonly should be allways True, otherwise polygons are not subtracted
flat_geometry = self.flatten(pathonly=True)
log.debug("%d paths" % len(flat_geometry))
- polygon=Polygon(points)
- toolgeo=cascaded_union(polygon)
- diffs=[]
+ polygon = Polygon(points)
+ toolgeo = cascaded_union(polygon)
+ diffs = []
for target in flat_geometry:
if type(target) == LineString or type(target) == LinearRing:
diffs.append(target.difference(toolgeo))
else:
log.warning("Not implemented.")
- self.solid_geometry=cascaded_union(diffs)
+ self.solid_geometry = cascaded_union(diffs)
def bounds(self):
"""
@@ -336,7 +332,8 @@ class Geometry(object):
poly, which can can be iterable, contain iterable of, or
be itself an implementer of .contains().
- :param poly: See description
+ :param point: See description
+ :param geoset: a polygon or list of polygons where to find if the param point is contained
:return: Polygon containing point or None.
"""
@@ -366,12 +363,12 @@ class Geometry(object):
if geometry is None:
geometry = self.solid_geometry
- ## If iterable, expand recursively.
+ # ## If iterable, expand recursively.
try:
for geo in geometry:
interiors.extend(self.get_interiors(geometry=geo))
- ## Not iterable, get the interiors if polygon.
+ # ## Not iterable, get the interiors if polygon.
except TypeError:
if type(geometry) == Polygon:
interiors.extend(geometry.interiors)
@@ -393,12 +390,12 @@ class Geometry(object):
if geometry is None:
geometry = self.solid_geometry
- ## If iterable, expand recursively.
+ # ## If iterable, expand recursively.
try:
for geo in geometry:
exteriors.extend(self.get_exteriors(geometry=geo))
- ## Not iterable, get the exterior if polygon.
+ # ## Not iterable, get the exterior if polygon.
except TypeError:
if type(geometry) == Polygon:
exteriors.append(geometry.exterior)
@@ -423,7 +420,7 @@ class Geometry(object):
if reset:
self.flat_geometry = []
- ## If iterable, expand recursively.
+ # ## If iterable, expand recursively.
try:
for geo in geometry:
if geo is not None:
@@ -431,7 +428,7 @@ class Geometry(object):
reset=False,
pathonly=pathonly)
- ## Not iterable, do the actual indexing and add.
+ # ## Not iterable, do the actual indexing and add.
except TypeError:
if pathonly and type(geometry) == Polygon:
self.flat_geometry.append(geometry.exterior)
@@ -480,18 +477,18 @@ class Geometry(object):
# if reset:
# self.flat_geometry = []
#
- # ## If iterable, expand recursively.
+ # # ## If iterable, expand recursively.
# try:
# for geo in geometry:
# self.flatten_to_paths(geometry=geo, reset=False)
#
- # ## Not iterable, do the actual indexing and add.
+ # # ## Not iterable, do the actual indexing and add.
# except TypeError:
# if type(geometry) == Polygon:
# g = geometry.exterior
# self.flat_geometry.append(g)
#
- # ## Add first and last points of the path to the index.
+ # # ## Add first and last points of the path to the index.
# self.flat_geometry_rtree.insert(len(self.flat_geometry) - 1, g.coords[0])
# self.flat_geometry_rtree.insert(len(self.flat_geometry) - 1, g.coords[-1])
#
@@ -694,7 +691,6 @@ class Geometry(object):
else:
scale_factor = 1 / dpi
-
geos = []
unscaled_geos = []
@@ -715,7 +711,7 @@ class Geometry(object):
pass
try:
- blue= src.read(3)
+ blue = src.read(3)
except:
pass
@@ -807,7 +803,7 @@ class Geometry(object):
assert type(polygon) == Polygon or type(polygon) == MultiPolygon, \
"Expected a Polygon or MultiPolygon, got %s" % type(polygon)
- ## The toolpaths
+ # ## The toolpaths
# Index first and last points in paths
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@@ -893,7 +889,7 @@ class Geometry(object):
# Current buffer radius
radius = tooldia / 2 * (1 - overlap)
- ## The toolpaths
+ # ## The toolpaths
# Index first and last points in paths
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@@ -973,7 +969,7 @@ class Geometry(object):
# log.debug("camlib.clear_polygon3()")
- ## The toolpaths
+ # ## The toolpaths
# Index first and last points in paths
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@@ -1071,7 +1067,7 @@ class Geometry(object):
# Assuming geolist is a flat list of flat elements
- ## Index first and last points in paths
+ # ## Index first and last points in paths
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@@ -1085,7 +1081,7 @@ class Geometry(object):
# storage.insert(LineString(shape))
# #storage.insert(shape)
- ## Iterate over geometry paths getting the nearest each time.
+ # ## Iterate over geometry paths getting the nearest each time.
#optimized_paths = []
optimized_paths = FlatCAMRTreeStorage()
optimized_paths.get_points = get_pts
@@ -1129,15 +1125,15 @@ class Geometry(object):
else:
# Have to lift tool. End path.
- #log.debug("Path #%d not within boundary. Next." % path_count)
- #optimized_paths.append(geo)
+ # log.debug("Path #%d not within boundary. Next." % path_count)
+ # optimized_paths.append(geo)
optimized_paths.insert(geo)
geo = candidate
current_pt = geo.coords[-1]
# Next
- #pt, geo = storage.nearest(current_pt)
+ # pt, geo = storage.nearest(current_pt)
except StopIteration: # Nothing left in storage.
#pass
@@ -1159,7 +1155,7 @@ class Geometry(object):
log.debug("path_connect()")
- ## Index first and last points in paths
+ # ## Index first and last points in paths
def get_pts(o):
return [o.coords[0], o.coords[-1]]
#
@@ -1173,18 +1169,14 @@ class Geometry(object):
path_count = 0
pt, geo = storage.nearest(origin)
storage.remove(geo)
- #optimized_geometry = [geo]
+ # optimized_geometry = [geo]
optimized_geometry = FlatCAMRTreeStorage()
optimized_geometry.get_points = get_pts
- #optimized_geometry.insert(geo)
+ # optimized_geometry.insert(geo)
try:
while True:
path_count += 1
-
- #print "geo is", geo
-
_, left = storage.nearest(geo.coords[0])
- #print "left is", left
# If left touches geo, remove left from original
# storage and append to geo.
@@ -1210,7 +1202,6 @@ class Geometry(object):
continue
_, right = storage.nearest(geo.coords[-1])
- #print "right is", right
# If right touches geo, remove left from original
# storage and append to geo.
@@ -1243,7 +1234,7 @@ class Geometry(object):
if type(right) == LinearRing:
optimized_geometry.insert(right)
else:
- # Cannot exteng geo any further. Put it away.
+ # Cannot extend geo any further. Put it away.
optimized_geometry.insert(geo)
# Continue with right.
@@ -1252,7 +1243,7 @@ class Geometry(object):
except StopIteration: # Nothing found in storage.
optimized_geometry.insert(geo)
- #print path_count
+ # print path_count
log.debug("path_count = %d" % path_count)
return optimized_geometry
@@ -1288,7 +1279,7 @@ class Geometry(object):
def to_dict(self):
"""
- Returns a respresentation of the object as a dictionary.
+ Returns a representation of the object as a dictionary.
Attributes to include are listed in ``self.ser_attrs``.
:return: A dictionary-encoded copy of the object.
@@ -1485,7 +1476,7 @@ class ApertureMacro:
: 0
"""
- ## Regular expressions
+ # ## Regular expressions
am1_re = re.compile(r'^%AM([^\*]+)\*(.+)?(%)?$')
am2_re = re.compile(r'(.*)%$')
amcomm_re = re.compile(r'^0(.*)')
@@ -1496,8 +1487,8 @@ class ApertureMacro:
self.name = name
self.raw = ""
- ## These below are recomputed for every aperture
- ## definition, in other words, are temporary variables.
+ # ## These below are recomputed for every aperture
+ # ## definition, in other words, are temporary variables.
self.primitives = []
self.locvars = {}
self.geometry = None
@@ -1543,14 +1534,14 @@ class ApertureMacro:
# Separate parts
parts = self.raw.split('*')
- #### Every part in the macro ####
+ #### Every part in the macro ## ##
for part in parts:
- ### Comments. Ignored.
+ # ## Comments. Ignored.
match = ApertureMacro.amcomm_re.search(part)
if match:
continue
- ### Variables
+ # ## Variables
# These are variables defined locally inside the macro. They can be
# numerical constant or defind in terms of previously define
# variables, which can be defined locally or in an aperture
@@ -1575,14 +1566,14 @@ class ApertureMacro:
self.locvars[var] = eval(val)
continue
- ### Primitives
+ # ## Primitives
# Each is an array. The first identifies the primitive, while the
# rest depend on the primitive. All are strings representing a
# number and may contain variable definition. The values of these
# variables are defined in an aperture definition.
match = ApertureMacro.amprim_re.search(part)
if match:
- ## Replace all variables
+ # ## Replace all variables
for v in self.locvars:
# replaced the following line with the next to fix Mentor custom apertures not parsed OK
# part = re.sub(r'\$' + str(v) + r'(?![0-9a-zA-Z])', str(self.locvars[v]), part)
@@ -1594,7 +1585,7 @@ class ApertureMacro:
# Change x with *
part = re.sub(r'[xX]', "*", part)
- ## Store
+ # ## Store
elements = part.split(",")
self.primitives.append([eval(x) for x in elements])
continue
@@ -1754,8 +1745,8 @@ class ApertureMacro:
i = 1 # Number of rings created so far
- ## If the ring does not have an interior it means that it is
- ## a disk. Then stop.
+ # ## If the ring does not have an interior it means that it is
+ # ## a disk. Then stop.
while len(ring.interiors) > 0 and i < nrings:
r -= thickness + gap
if r <= 0:
@@ -1764,7 +1755,7 @@ class ApertureMacro:
result = cascaded_union([result, ring])
i += 1
- ## Crosshair
+ # ## Crosshair
hor = LineString([(x - cross_len, y), (x + cross_len, y)]).buffer(cross_th/2.0, cap_style=2)
ver = LineString([(x, y-cross_len), (x, y + cross_len)]).buffer(cross_th/2.0, cap_style=2)
result = cascaded_union([result, hor, ver])
@@ -1802,7 +1793,7 @@ class ApertureMacro:
:rtype: shapely.geometry.polygon
"""
- ## Primitive makers
+ # ## Primitive makers
makers = {
"1": ApertureMacro.make_circle,
"2": ApertureMacro.make_vectorline,
@@ -1815,19 +1806,19 @@ class ApertureMacro:
"7": ApertureMacro.make_thermal
}
- ## Store modifiers as local variables
+ # ## Store modifiers as local variables
modifiers = modifiers or []
modifiers = [float(m) for m in modifiers]
self.locvars = {}
for i in range(0, len(modifiers)):
self.locvars[str(i + 1)] = modifiers[i]
- ## Parse
+ # ## Parse
self.primitives = [] # Cleanup
self.geometry = Polygon()
self.parse_content()
- ## Make the geometry
+ # ## Make the geometry
for primitive in self.primitives:
# Make the primitive
prim_geo = makers[str(int(primitive[0]))](primitive[1:])
@@ -1898,9 +1889,7 @@ class Gerber (Geometry):
:rtype: Gerber
"""
- # How to discretize a circle.
- # if steps_per_circle is None:
- # steps_per_circle = int(Gerber.defaults['steps_per_circle'])
+ # How to approximate a circle with lines.
self.steps_per_circle = int(self.app.defaults["gerber_circle_steps"])
# Initialize parent
@@ -1917,7 +1906,7 @@ class Gerber (Geometry):
"""Zeros in Gerber numbers. If 'L' then remove leading zeros, if 'T' remove trailing zeros. Used during parsing.
"""
- ## Gerber elements ##
+ # ## Gerber elements # ##
'''
apertures = {
'id':{
@@ -1963,7 +1952,7 @@ class Gerber (Geometry):
self.ser_attrs += ['int_digits', 'frac_digits', 'apertures',
'aperture_macros', 'solid_geometry', 'source_file']
- #### Parser patterns ####
+ # ### Parser patterns ## ##
# FS - Format Specification
# The format of X and Y must be the same!
# L-omit leading zeros, T-omit trailing zeros, D-no zero supression
@@ -1985,7 +1974,7 @@ class Gerber (Geometry):
# AM - Aperture Macro
# Beginning of macro (Ends with *%):
- #self.am_re = re.compile(r'^%AM([a-zA-Z0-9]*)\*')
+ # self.am_re = re.compile(r'^%AM([a-zA-Z0-9]*)\*')
# Tool change
# May begin with G54 but that is deprecated
@@ -2159,7 +2148,7 @@ class Gerber (Geometry):
self.parse_lines(line_generator())
- #@profile
+ # @profile
def parse_lines(self, glines):
"""
Main Gerber parser. Reads Gerber and populates ``self.paths``, ``self.apertures``,
@@ -2228,7 +2217,7 @@ class Gerber (Geometry):
# If a region is being defined
making_region = False
- #### Parsing starts here ####
+ # ### Parsing starts here ## ##
line_num = 0
gline = ""
try:
@@ -2240,15 +2229,15 @@ class Gerber (Geometry):
gline = gline.strip(' \r\n')
# log.debug("Line=%3s %s" % (line_num, gline))
- # ###############################################################
+ # ############################################################# ##
# Ignored lines #
- # Comments ######
- # ###############################################################
+ # Comments #### ##
+ # ############################################################# ##
match = self.comm_re.search(gline)
if match:
continue
- # Polarity change ########
+ # Polarity change ###### ##
# Example: %LPD*% or %LPC*%
# If polarity changes, creates geometry from current
# buffer, then adds or subtracts accordingly.
@@ -2303,10 +2292,10 @@ class Gerber (Geometry):
current_polarity = new_polarity
continue
- # ###############################################################
- # Number format ##################
+ # ############################################################# ##
+ # Number format ############################################### ##
# Example: %FSLAX24Y24*%
- # ###############################################################
+ # ############################################################# ##
# TODO: This is ignoring most of the format. Implement the rest.
match = self.fmt_re.search(gline)
if match:
@@ -2322,7 +2311,7 @@ class Gerber (Geometry):
log.debug("Gerber format found. Coordinates type = %s (Absolute or Relative)" % absolute)
continue
- ### Mode (IN/MM)
+ # ## Mode (IN/MM)
# Example: %MOIN*%
match = self.mode_re.search(gline)
if match:
@@ -2332,9 +2321,9 @@ class Gerber (Geometry):
self.convert_units(match.group(1))
continue
- # ###############################################################
- # Combined Number format and Mode --- Allegro does this #########
- # ###############################################################
+ # ############################################################# ##
+ # Combined Number format and Mode --- Allegro does this ####### ##
+ # ############################################################# ##
match = self.fmt_re_alt.search(gline)
if match:
absolute = {'A': 'Absolute', 'I': 'Relative'}[match.group(2)]
@@ -2353,9 +2342,9 @@ class Gerber (Geometry):
self.convert_units(match.group(5))
continue
- # ###############################################################
+ # ############################################################# ##
# Search for OrCAD way for having Number format
- # ###############################################################
+ # ############################################################# ##
match = self.fmt_re_orcad.search(gline)
if match:
if match.group(1) is not None:
@@ -2379,9 +2368,9 @@ class Gerber (Geometry):
self.convert_units(match.group(5))
continue
- # ###############################################################
+ # ############################################################# ##
# Units (G70/1) OBSOLETE
- # ###############################################################
+ # ############################################################# ##
match = self.units_re.search(gline)
if match:
obs_gerber_units = {'0': 'IN', '1': 'MM'}[match.group(1)]
@@ -2390,21 +2379,21 @@ class Gerber (Geometry):
self.convert_units({'0': 'IN', '1': 'MM'}[match.group(1)])
continue
- # ###############################################################
- # Absolute/relative coordinates G90/1 OBSOLETE ##########
- # #######################################################
+ # ############################################################# ##
+ # Absolute/relative coordinates G90/1 OBSOLETE ######## ##
+ # ##################################################### ##
match = self.absrel_re.search(gline)
if match:
absolute = {'0': "Absolute", '1': "Relative"}[match.group(1)]
log.warning("Gerber obsolete coordinates type found = %s (Absolute or Relative) " % absolute)
continue
- # ###############################################################
- # Aperture Macros #######################################
+ # ############################################################# ##
+ # Aperture Macros ##################################### ##
# Having this at the beginning will slow things down
# but macros can have complicated statements than could
# be caught by other patterns.
- # ###############################################################
+ # ############################################################# ##
if current_macro is None: # No macro started yet
match = self.am1_re.search(gline)
# Start macro if match, else not an AM, carry on.
@@ -2431,18 +2420,18 @@ class Gerber (Geometry):
self.aperture_macros[current_macro].append(gline)
continue
- ### Aperture definitions %ADD...
+ # ## Aperture definitions %ADD...
match = self.ad_re.search(gline)
if match:
# log.info("Found aperture definition. Line %d: %s" % (line_num, gline))
self.aperture_parse(match.group(1), match.group(2), match.group(3))
continue
- # ###############################################################
- # Operation code alone ########################
+ # ############################################################# ##
+ # Operation code alone ###################### ##
# Operation code alone, usually just D03 (Flash)
# self.opcode_re = re.compile(r'^D0?([123])\*$')
- # ###############################################################
+ # ############################################################# ##
match = self.opcode_re.search(gline)
if match:
current_operation_code = int(match.group(1))
@@ -2479,10 +2468,10 @@ class Gerber (Geometry):
continue
- # ###############################################################
+ # ############################################################# ##
# Tool/aperture change
# Example: D12*
- # ###############################################################
+ # ############################################################# ##
match = self.tool_re.search(gline)
if match:
current_aperture = match.group(1)
@@ -2529,9 +2518,9 @@ class Gerber (Geometry):
continue
- # ###############################################################
+ # ############################################################# ##
# G36* - Begin region
- # ###############################################################
+ # ############################################################# ##
if self.regionon_re.search(gline):
if len(path) > 1:
# Take care of what is left in the path
@@ -2563,9 +2552,9 @@ class Gerber (Geometry):
making_region = True
continue
- # ###############################################################
+ # ############################################################# ##
# G37* - End region
- # ###############################################################
+ # ############################################################# ##
if self.regionoff_re.search(gline):
making_region = False
@@ -2632,7 +2621,7 @@ class Gerber (Geometry):
path = [[current_x, current_y]] # Start new path
continue
- ### G01/2/3* - Interpolation mode change
+ # ## G01/2/3* - Interpolation mode change
# Can occur along with coordinates and operation code but
# sometimes by itself (handled here).
# Example: G01*
@@ -2641,7 +2630,7 @@ class Gerber (Geometry):
current_interpolation_mode = int(match.group(1))
continue
- ### G01 - Linear interpolation plus flashes
+ # ## G01 - Linear interpolation plus flashes
# Operation code (D0x) missing is deprecated... oh well I will support it.
# REGEX: r'^(?:G0?(1))?(?:X(-?\d+))?(?:Y(-?\d+))?(?:D0([123]))?\*$'
match = self.lin_re.search(gline)
@@ -2896,7 +2885,7 @@ class Gerber (Geometry):
# log.debug("Line_number=%3s X=%s Y=%s (%s)" % (line_num, linear_x, linear_y, gline))
continue
- ### G74/75* - Single or multiple quadrant arcs
+ # ## G74/75* - Single or multiple quadrant arcs
match = self.quad_re.search(gline)
if match:
if match.group(1) == '4':
@@ -2905,7 +2894,7 @@ class Gerber (Geometry):
quadrant_mode = 'MULTI'
continue
- ### G02/3 - Circular interpolation
+ # ## G02/3 - Circular interpolation
# 2-clockwise, 3-counterclockwise
# Ex. format: G03 X0 Y50 I-50 J0 where the X, Y coords are the coords of the End Point
match = self.circ_re.search(gline)
@@ -3084,12 +3073,12 @@ class Gerber (Geometry):
else:
log.warning("Invalid arc in line %d." % line_num)
- ## EOF
+ # ## EOF
match = self.eof_re.search(gline)
if match:
continue
- ### Line did not match any pattern. Warn user.
+ # ## Line did not match any pattern. Warn user.
log.warning("Line ignored (%d): %s" % (line_num, gline))
if len(path) > 1:
@@ -3100,7 +3089,7 @@ class Gerber (Geometry):
pass
else:
# EOF, create shapely LineString if something still in path
- ## --- Buffered ---
+ # ## --- Buffered ---
geo_dict = dict()
# this treats the case when we are storing geometry as paths
@@ -3392,7 +3381,7 @@ class Gerber (Geometry):
self.app.inform.emit(_("[success] Gerber Scale done."))
- ## solid_geometry ???
+ # ## solid_geometry ???
# It's a cascaded union of objects.
# self.solid_geometry = affinity.scale(self.solid_geometry, factor,
# factor, origin=(0, 0))
@@ -3435,7 +3424,7 @@ class Gerber (Geometry):
else:
return affinity.translate(obj, xoff=dx, yoff=dy)
- ## Solid geometry
+ # ## Solid geometry
self.solid_geometry = offset_geom(self.solid_geometry)
self.follow_geometry = offset_geom(self.follow_geometry)
@@ -3677,7 +3666,7 @@ class Excellon(Geometry):
self.num_tools = [] # List for keeping the tools sorted
self.index_per_tool = {} # Dictionary to store the indexed points for each tool
- ## IN|MM -> Units are inherited from Geometry
+ # ## IN|MM -> Units are inherited from Geometry
#self.units = units
# Trailing "T" or leading "L" (default)
@@ -3708,7 +3697,7 @@ class Excellon(Geometry):
'excellon_format_upper_in', 'excellon_format_lower_in', 'excellon_units', 'slots',
'source_file']
- #### Patterns ####
+ #### Patterns ## ##
# Regex basics:
# ^ - beginning
# $ - end
@@ -3855,7 +3844,7 @@ class Excellon(Geometry):
line_units = ''
- #### Parsing starts here ####
+ #### Parsing starts here ## ##
line_num = 0 # Line number
eline = ""
try:
@@ -3946,7 +3935,7 @@ class Excellon(Geometry):
log.warning("Found end of the header: %s" % eline)
continue
- ## Alternative units format M71/M72
+ # ## Alternative units format M71/M72
# Supposed to be just in the body (yes, the body)
# but some put it in the header (PADS for example).
# Will detect anywhere. Occurrence will change the
@@ -3966,10 +3955,10 @@ class Excellon(Geometry):
':' + str(self.excellon_format_lower_in))
continue
- #### Body ####
+ #### Body ## ##
if not in_header:
- ## Tool change ##
+ # ## Tool change # ##
match = self.toolsel_re.search(eline)
if match:
current_tool = str(int(match.group(1)))
@@ -4009,7 +3998,7 @@ class Excellon(Geometry):
continue
- ## Allegro Type Tool change ##
+ # ## Allegro Type Tool change # ##
if allegro_warning is True:
match = self.absinc_re.search(eline)
match1 = self.stop_re.search(eline)
@@ -4019,7 +4008,7 @@ class Excellon(Geometry):
log.debug(" Tool change for Allegro type of Excellon: %s" % current_tool)
continue
- ## Slots parsing for drilled slots (contain G85)
+ # ## Slots parsing for drilled slots (contain G85)
# a Excellon drilled slot line may look like this:
# X01125Y0022244G85Y0027756
match = self.slots_re.search(eline)
@@ -4032,7 +4021,7 @@ class Excellon(Geometry):
start_coords_match = match.group(1)
stop_coords_match = match.group(2)
- # Slot coordinates without period ##
+ # Slot coordinates without period # ##
# get the coordinates for slot start and for slot stop into variables
start_coords_noperiod = self.coordsnoperiod_re.search(start_coords_match)
stop_coords_noperiod = self.coordsnoperiod_re.search(stop_coords_match)
@@ -4101,7 +4090,7 @@ class Excellon(Geometry):
)
continue
- # Slot coordinates with period: Use literally. ##
+ # Slot coordinates with period: Use literally. # ##
# get the coordinates for slot start and for slot stop into variables
start_coords_period = self.coordsperiod_re.search(start_coords_match)
stop_coords_period = self.coordsperiod_re.search(stop_coords_match)
@@ -4170,7 +4159,7 @@ class Excellon(Geometry):
)
continue
- ## Coordinates without period ##
+ # ## Coordinates without period # ##
match = self.coordsnoperiod_re.search(eline)
if match:
matchr = self.repeat_re.search(eline)
@@ -4201,7 +4190,7 @@ class Excellon(Geometry):
log.error("Missing coordinates")
continue
- ## Excellon Routing parse
+ # ## Excellon Routing parse
if len(re.findall("G00", eline)) > 0:
self.match_routing_start = 'G00'
@@ -4251,7 +4240,7 @@ class Excellon(Geometry):
# log.debug("{:15} {:8} {:8}".format(eline, x, y))
continue
- ## Coordinates with period: Use literally. ##
+ # ## Coordinates with period: Use literally. # ##
match = self.coordsperiod_re.search(eline)
if match:
matchr = self.repeat_re.search(eline)
@@ -4282,7 +4271,7 @@ class Excellon(Geometry):
log.error("Missing coordinates")
continue
- ## Excellon Routing parse
+ # ## Excellon Routing parse
if len(re.findall("G00", eline)) > 0:
self.match_routing_start = 'G00'
@@ -4333,10 +4322,10 @@ class Excellon(Geometry):
# log.debug("{:15} {:8} {:8}".format(eline, x, y))
continue
- #### Header ####
+ #### Header ## ##
if in_header:
- ## Tool definitions ##
+ # ## Tool definitions # ##
match = self.toolset_re.search(eline)
if match:
@@ -4354,7 +4343,7 @@ class Excellon(Geometry):
log.debug(" Tool definition: %s %s" % (name, spec))
continue
- ## Units and number format ##
+ # ## Units and number format # ##
match = self.units_re.match(eline)
if match:
self.units_found = match.group(1)
@@ -4412,7 +4401,7 @@ class Excellon(Geometry):
log.warning("Type of zeros found: %s" % self.zeros)
continue
- ## Units and number format outside header##
+ # ## Units and number format outside header# ##
match = self.units_re.match(eline)
if match:
self.units_found = match.group(1)
@@ -4489,7 +4478,7 @@ class Excellon(Geometry):
# You must show all zeros to the right of the number and can omit
# all zeros to the left of the number. The CNC-7 will count the number
# of digits you typed and automatically fill in the missing zeros.
- ## flatCAM expects 6digits
+ # ## flatCAM expects 6digits
# flatCAM expects the number of digits entered into the defaults
if self.units.lower() == "in": # Inches is 00.0000
@@ -5284,7 +5273,7 @@ class CNCjob(Geometry):
self.postdata['toolC'] = exobj.tools[tool]["C"]
self.tooldia = exobj.tools[tool]["C"]
- ################################################
+ ############################################## ##
# Create the data.
node_list = []
locations = create_data_array()
@@ -5334,7 +5323,7 @@ class CNCjob(Geometry):
log.warning('No solution found.')
else:
log.warning('Specify an instance greater than 0.')
- ################################################
+ ############################################## ##
# Only if tool has points.
if tool in points:
@@ -5390,7 +5379,7 @@ class CNCjob(Geometry):
self.postdata['toolC']=exobj.tools[tool]["C"]
self.tooldia = exobj.tools[tool]["C"]
- ################################################
+ ############################################## ##
node_list = []
locations = create_data_array()
tsp_size = len(locations)
@@ -5432,7 +5421,7 @@ class CNCjob(Geometry):
log.warning('No solution found.')
else:
log.warning('Specify an instance greater than 0.')
- ################################################
+ ############################################## ##
# Only if tool has points.
if tool in points:
@@ -5588,7 +5577,7 @@ class CNCjob(Geometry):
else:
temp_solid_geometry = geometry
- ## Flatten the geometry. Only linear elements (no polygons) remain.
+ # ## Flatten the geometry. Only linear elements (no polygons) remain.
flat_geometry = self.flatten(temp_solid_geometry, pathonly=True)
log.debug("%d paths" % len(flat_geometry))
@@ -5665,7 +5654,7 @@ class CNCjob(Geometry):
"This is dangerous, skipping %s file") % self.options['name'])
return 'fail'
- ## Index first and last points in paths
+ # ## Index first and last points in paths
# What points to index.
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@@ -5719,7 +5708,7 @@ class CNCjob(Geometry):
if self.dwell is True:
self.gcode += self.doformat(p.dwell_code) # Dwell time
- ## Iterate over geometry paths getting the nearest each time.
+ # ## Iterate over geometry paths getting the nearest each time.
log.debug("Starting G-Code...")
path_count = 0
current_pt = (0, 0)
@@ -5855,7 +5844,7 @@ class CNCjob(Geometry):
else:
temp_solid_geometry = geometry.solid_geometry
- ## Flatten the geometry. Only linear elements (no polygons) remain.
+ # ## Flatten the geometry. Only linear elements (no polygons) remain.
flat_geometry = self.flatten(temp_solid_geometry, pathonly=True)
log.debug("%d paths" % len(flat_geometry))
@@ -5928,7 +5917,7 @@ class CNCjob(Geometry):
"This is dangerous, skipping %s file") % self.options['name'])
return 'fail'
- ## Index first and last points in paths
+ # ## Index first and last points in paths
# What points to index.
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@@ -6041,7 +6030,7 @@ class CNCjob(Geometry):
log.debug("Generate_from_solderpaste_geometry()")
- ## Index first and last points in paths
+ # ## Index first and last points in paths
# What points to index.
def get_pts(o):
return [o.coords[0], o.coords[-1]]
@@ -6077,7 +6066,7 @@ class CNCjob(Geometry):
else self.app.defaults['tools_solderpaste_pp']
p = self.app.postprocessors[self.pp_solderpaste_name]
- ## Flatten the geometry. Only linear elements (no polygons) remain.
+ # ## Flatten the geometry. Only linear elements (no polygons) remain.
flat_geometry = self.flatten(kwargs['solid_geometry'], pathonly=True)
log.debug("%d paths" % len(flat_geometry))
@@ -6096,7 +6085,7 @@ class CNCjob(Geometry):
self.gcode += self.doformat(p.spindle_off_code)
self.gcode += self.doformat(p.toolchange_code)
- ## Iterate over geometry paths getting the nearest each time.
+ # ## Iterate over geometry paths getting the nearest each time.
log.debug("Starting SolderPaste G-Code...")
path_count = 0
current_pt = (0, 0)
@@ -6355,12 +6344,12 @@ class CNCjob(Geometry):
gobj = self.codes_split(line)
- ## Units
+ # ## Units
if 'G' in gobj and (gobj['G'] == 20.0 or gobj['G'] == 21.0):
self.units = {20.0: "IN", 21.0: "MM"}[gobj['G']]
continue
- ## Changing height
+ # ## Changing height
if 'Z' in gobj:
if 'Roland' in self.pp_excellon_name or 'Roland' in self.pp_geometry_name:
pass
@@ -7699,7 +7688,7 @@ class FlatCAMRTree(object):
# Python RTree Index
self.rti = rtindex.Index()
- ## Track object-point relationship
+ # ## Track object-point relationship
# Each is list of points in object.
self.obj2points = []
diff --git a/flatcamEditors/FlatCAMExcEditor.py b/flatcamEditors/FlatCAMExcEditor.py
index 763b80aa..9e466e74 100644
--- a/flatcamEditors/FlatCAMExcEditor.py
+++ b/flatcamEditors/FlatCAMExcEditor.py
@@ -726,11 +726,11 @@ class FlatCAMExcEditor(QtCore.QObject):
self.app = app
self.canvas = self.app.plotcanvas
- ## Current application units in Upper Case
+ # ## Current application units in Upper Case
self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
self.exc_edit_widget = QtWidgets.QWidget()
- ## Box for custom widgets
+ # ## Box for custom widgets
# This gets populated in offspring implementations.
layout = QtWidgets.QVBoxLayout()
self.exc_edit_widget.setLayout(layout)
@@ -744,22 +744,22 @@ class FlatCAMExcEditor(QtCore.QObject):
self.tools_box.setContentsMargins(0, 0, 0, 0)
self.drills_frame.setLayout(self.tools_box)
- ## Page Title box (spacing between children)
+ # ## Page Title box (spacing between children)
self.title_box = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(self.title_box)
- ## Page Title icon
+ # ## Page Title icon
pixmap = QtGui.QPixmap('share/flatcam_icon32.png')
self.icon = QtWidgets.QLabel()
self.icon.setPixmap(pixmap)
self.title_box.addWidget(self.icon, stretch=0)
- ## Title label
+ # ## Title label
self.title_label = QtWidgets.QLabel("%s" % _('Excellon Editor'))
self.title_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
self.title_box.addWidget(self.title_label, stretch=1)
- ## Object name
+ # ## Object name
self.name_box = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(self.name_box)
name_label = QtWidgets.QLabel(_("Name:"))
@@ -767,7 +767,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.name_entry = FCEntry()
self.name_box.addWidget(self.name_entry)
- #### Tools Drills ####
+ #### Tools Drills ## ##
self.tools_table_label = QtWidgets.QLabel("%s" % _('Tools Table'))
self.tools_table_label.setToolTip(
_( "Tools in this Excellon object\n"
@@ -789,7 +789,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.empty_label = QtWidgets.QLabel('')
self.tools_box.addWidget(self.empty_label)
- #### Add a new Tool ####
+ #### Add a new Tool ## ##
self.addtool_label = QtWidgets.QLabel('%s' % _('Add/Delete Tool'))
self.addtool_label.setToolTip(
_("Add/Delete a tool to the tool list\n"
@@ -839,7 +839,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.resize_box.setContentsMargins(0, 0, 0, 0)
self.resize_frame.setLayout(self.resize_box)
- #### Resize a drill ####
+ #### Resize a drill ## ##
self.emptyresize_label = QtWidgets.QLabel('')
self.resize_box.addWidget(self.emptyresize_label)
@@ -882,7 +882,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.array_box.setContentsMargins(0, 0, 0, 0)
self.array_frame.setLayout(self.array_box)
- #### Add DRILL Array ####
+ #### Add DRILL Array ## ##
self.emptyarray_label = QtWidgets.QLabel('')
self.array_box.addWidget(self.emptyarray_label)
@@ -1001,7 +1001,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.array_frame.hide()
self.tools_box.addStretch()
- ## Toolbar events and properties
+ # ## Toolbar events and properties
self.tools_exc = {
"drill_select": {"button": self.app.ui.select_drill_btn,
"constructor": FCDrillSelect},
@@ -1017,7 +1017,7 @@ class FlatCAMExcEditor(QtCore.QObject):
"constructor": FCDrillMove},
}
- ### Data
+ # ## Data
self.active_tool = None
self.in_action = False
@@ -1090,7 +1090,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.shapes.enabled = False
self.tool_shape.enabled = False
- ## List of selected shapes.
+ # ## List of selected shapes.
self.selected = []
self.move_timer = QtCore.QTimer()
@@ -1160,7 +1160,7 @@ class FlatCAMExcEditor(QtCore.QObject):
@staticmethod
def make_storage():
- ## Shape storage.
+ # ## Shape storage.
storage = FlatCAMRTreeStorage()
storage.get_points = DrawToolShape.get_pts
@@ -1739,7 +1739,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.drills_frame.hide()
def connect_canvas_event_handlers(self):
- ## Canvas events
+ # ## Canvas events
# first connect to new, then disconnect the old handlers
# don't ask why but if there is nothing connected I've seen issues
@@ -2394,7 +2394,7 @@ class FlatCAMExcEditor(QtCore.QObject):
if self.active_tool is None:
return
- ### Snap coordinates
+ # ## Snap coordinates
if self.app.grid_status():
x, y = self.app.geo_editor.snap(x, y)
self.app.app_cursor.enabled = True
@@ -2419,7 +2419,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.app.ui.rel_position_label.setText("Dx: %.4f Dy: "
"%.4f " % (dx, dy))
- ### Utility geometry (animated)
+ # ## Utility geometry (animated)
geo = self.active_tool.utility_geometry(data=(x, y))
if isinstance(geo, DrawToolShape) and geo.geo is not None:
@@ -2427,7 +2427,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.tool_shape.clear(update=True)
self.draw_utility_geometry(geo=geo)
- ### Selection area on canvas section ###
+ # ## Selection area on canvas section # ##
if event.is_dragging == 1 and event.button == 1:
# I make an exception for FCDrillAdd and FCDrillArray because clicking and dragging while making regions
# can create strange issues
@@ -2553,13 +2553,13 @@ class FlatCAMExcEditor(QtCore.QObject):
for geo in geometry:
plot_elements += self.plot_shape(geometry=geo, color=color, linewidth=linewidth)
- ## Non-iterable
+ # ## Non-iterable
except TypeError:
- ## DrawToolShape
+ # ## DrawToolShape
if isinstance(geometry, DrawToolShape):
plot_elements += self.plot_shape(geometry=geometry.geo, color=color, linewidth=linewidth)
- ## Polygon: Descend into exterior and each interior.
+ # ## Polygon: Descend into exterior and each interior.
if type(geometry) == Polygon:
plot_elements += self.plot_shape(geometry=geometry.exterior, color=color, linewidth=linewidth)
plot_elements += self.plot_shape(geometry=geometry.interiors, color=color, linewidth=linewidth)
diff --git a/flatcamEditors/FlatCAMGeoEditor.py b/flatcamEditors/FlatCAMGeoEditor.py
index 16f065b0..bec802a1 100644
--- a/flatcamEditors/FlatCAMGeoEditor.py
+++ b/flatcamEditors/FlatCAMGeoEditor.py
@@ -1,15 +1,15 @@
-# ###########################################################
+# ######################################################### ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-# ###########################################################
+# ######################################################### ##
# ########################################################### #
# File Modified: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
-# ###########################################################
+# ######################################################### ##
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt, QSettings
@@ -629,7 +629,7 @@ class TransformEditorTool(FlatCAMTool):
self.transform_lay = QtWidgets.QVBoxLayout()
self.layout.addLayout(self.transform_lay)
- ## Title
+ # ## Title
title_label = QtWidgets.QLabel("%s" % (_('Editor %s') % self.toolName))
title_label.setStyleSheet("""
QLabel
@@ -2917,9 +2917,9 @@ class FCTransform(FCShapeTool):
self.draw_app.transform_tool.run()
-# #######################
-# ## Main Application ###
-# #######################
+# ##################### ##
+# # ## Main Application # ##
+# ##################### ##
class FlatCAMGeoEditor(QtCore.QObject):
transform_complete = QtCore.pyqtSignal()
@@ -2935,7 +2935,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
self.app = app
self.canvas = app.plotcanvas
- ## Toolbar events and properties
+ # ## Toolbar events and properties
self.tools = {
"select": {"button": self.app.ui.geo_select_btn,
"constructor": FCSelect},
@@ -2965,7 +2965,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
"constructor": FCCopy}
}
- # ## Data
+ # # ## Data
self.active_tool = None
self.storage = FlatCAMGeoEditor.make_storage()
@@ -3413,7 +3413,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
if multigeo_tool:
self.multigeo_tool = multigeo_tool
geo_to_edit = fcgeometry.flatten(geometry=fcgeometry.tools[self.multigeo_tool]['solid_geometry'])
- self.app.inform.emit(_("[WARNING] Editing MultiGeo Geometry, tool: {tool} with diameter: {dia}").
+ self.app.inform.emit(_("[WARNING_NOTCL] Editing MultiGeo Geometry, tool: {tool} with diameter: {dia}").
format(tool=self.multigeo_tool, dia=fcgeometry.tools[self.multigeo_tool]['tooldia']))
else:
geo_to_edit = fcgeometry.flatten()
@@ -3569,7 +3569,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
if self.active_tool is None:
return
- # ## Snap coordinates
+ # # ## Snap coordinates
if self.app.grid_status():
x, y = self.snap(x, y)
self.app.app_cursor.enabled = True
@@ -3597,14 +3597,14 @@ class FlatCAMGeoEditor(QtCore.QObject):
if event.button == 1 and event.is_dragging == 1 and isinstance(self.active_tool, FCEraser):
pass
else:
- # ## Utility geometry (animated)
+ # # ## Utility geometry (animated)
geo = self.active_tool.utility_geometry(data=(x, y))
if isinstance(geo, DrawToolShape) and geo.geo is not None:
# Remove any previous utility shape
self.tool_shape.clear(update=True)
self.draw_utility_geometry(geo=geo)
- # ## Selection area on canvas section ###
+ # # ## Selection area on canvas section # ##
dx = pos[0] - self.pos[0]
if event.is_dragging == 1 and event.button == 1:
self.app.delete_selection_shape()
@@ -3938,9 +3938,9 @@ class FlatCAMGeoEditor(QtCore.QObject):
snap_x, snap_y = (x, y)
snap_distance = Inf
- # ## Object (corner?) snap
- # ## No need for the objects, just the coordinates
- # ## in the index.
+ # # ## Object (corner?) snap
+ # # ## No need for the objects, just the coordinates
+ # # ## in the index.
if self.options["corner_snap"]:
try:
nearest_pt, shape = self.storage.nearest((x, y))
@@ -3952,7 +3952,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
except (StopIteration, AssertionError):
pass
- # ## Grid snap
+ # # ## Grid snap
if self.options["grid_snap"]:
if self.options["global_gridx"] != 0:
snap_x_ = round(x / self.options["global_gridx"]) * self.options['global_gridx']
diff --git a/flatcamEditors/FlatCAMGrbEditor.py b/flatcamEditors/FlatCAMGrbEditor.py
index ab498ea1..53f454e8 100644
--- a/flatcamEditors/FlatCAMGrbEditor.py
+++ b/flatcamEditors/FlatCAMGrbEditor.py
@@ -52,7 +52,7 @@ class DrawToolShape(object):
"""
pts = []
- ## Iterable: descend into each item.
+ # ## Iterable: descend into each item.
try:
for sub_o in o:
pts += DrawToolShape.get_pts(sub_o)
@@ -64,7 +64,7 @@ class DrawToolShape(object):
if isinstance(o, DrawToolShape):
pts += DrawToolShape.get_pts(o.geo)
- ## Descend into .exerior and .interiors
+ # ## Descend into .exerior and .interiors
elif type(o) == Polygon:
pts += DrawToolShape.get_pts(o.exterior)
for i in o.interiors:
@@ -72,7 +72,7 @@ class DrawToolShape(object):
elif type(o) == MultiLineString:
for line in o:
pts += DrawToolShape.get_pts(line)
- ## Has .coords: list them.
+ # ## Has .coords: list them.
else:
if DrawToolShape.tolerance is not None:
pts += list(o.simplify(DrawToolShape.tolerance).coords)
@@ -2274,7 +2274,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
layout.addLayout(self.custom_box)
- # ### Gerber Apertures ####
+ # # ## Gerber Apertures ## ##
self.apertures_table_label = QtWidgets.QLabel(_('Apertures:'))
self.apertures_table_label.setToolTip(
_("Apertures Table for the Gerber Object.")
@@ -2316,7 +2316,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.apertures_box.setContentsMargins(0, 0, 0, 0)
self.apertures_frame.setLayout(self.apertures_box)
- # ### Add/Delete an new Aperture ####
+ # # ## Add/Delete an new Aperture ## ##
grid1 = QtWidgets.QGridLayout()
self.apertures_box.addLayout(grid1)
@@ -2390,7 +2390,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
hlay_ad.addWidget(self.addaperture_btn)
hlay_ad.addWidget(self.delaperture_btn)
- # ## BUFFER TOOL ###
+ # # ## BUFFER TOOL # ##
self.buffer_tool_frame = QtWidgets.QFrame()
self.buffer_tool_frame.setContentsMargins(0, 0, 0, 0)
@@ -2434,7 +2434,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.buffer_button = QtWidgets.QPushButton(_("Buffer"))
hlay_buf.addWidget(self.buffer_button)
- # ## SCALE TOOL ###
+ # # ## SCALE TOOL # ##
self.scale_tool_frame = QtWidgets.QFrame()
self.scale_tool_frame.setContentsMargins(0, 0, 0, 0)
@@ -2481,7 +2481,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.array_box.setContentsMargins(0, 0, 0, 0)
self.array_frame.setLayout(self.array_box)
- # ### Add Pad Array ####
+ # # ## Add Pad Array ## ##
self.emptyarray_label = QtWidgets.QLabel('')
self.array_box.addWidget(self.emptyarray_label)
@@ -2633,7 +2633,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
"constructor": FCApertureMove},
}
- # ## Data
+ # # ## Data
self.active_tool = None
self.storage_dict = {}
@@ -3479,9 +3479,9 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.gerber_obj.apertures = conv_apertures
- # ###############################################################
+ # ############################################################# ##
# APPLY CLEAR_GEOMETRY on the SOLID_GEOMETRY
- # ###############################################################
+ # ############################################################# ##
# log.warning("Applying clear geometry in the apertures dict.")
# list of clear geos that are to be applied to the entire file
@@ -4079,7 +4079,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
if self.active_tool is None:
return
- # ## Snap coordinates
+ # # ## Snap coordinates
if self.app.grid_status():
x, y = self.app.geo_editor.snap(x, y)
self.app.app_cursor.enabled = True
@@ -4104,7 +4104,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.app.ui.rel_position_label.setText("Dx: %.4f Dy: "
"%.4f " % (dx, dy))
- # ## Utility geometry (animated)
+ # # ## Utility geometry (animated)
geo = self.active_tool.utility_geometry(data=(x, y))
if isinstance(geo, DrawToolShape) and geo.geo is not None:
@@ -4112,7 +4112,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.tool_shape.clear(update=True)
self.draw_utility_geometry(geo=geo)
- # ## Selection area on canvas section ###
+ # # ## Selection area on canvas section # ##
if event.is_dragging == 1 and event.button == 1:
# I make an exception for FCRegion and FCTrack because clicking and dragging while making regions can
# create strange issues like missing a point in a track/region
diff --git a/flatcamGUI/FlatCAMGUI.py b/flatcamGUI/FlatCAMGUI.py
index 065f0536..f072a512 100644
--- a/flatcamGUI/FlatCAMGUI.py
+++ b/flatcamGUI/FlatCAMGUI.py
@@ -1,15 +1,15 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
-############################################################
+# ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 #
-############################################################
+# ########################################################## ##
from PyQt5.QtCore import QSettings
from flatcamGUI.GUIElements import *
@@ -37,16 +37,16 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app = app
# Divine icon pack by Ipapun @ finicons.com
- #####################################
- ### BUILDING THE GUI IS DONE HERE ###
- #####################################
+ ################################### ##
+ # ## BUILDING THE GUI IS DONE HERE # ##
+ ################################### ##
- ############
- ### Menu ###
- ############
+ ########## ##
+ # ## Menu # ##
+ ########## ##
self.menu = self.menuBar()
- ### File ###
+ # ## File # ##
self.menufile = self.menu.addMenu(_('&File'))
self.menufile.setToolTipsVisible(True)
@@ -226,7 +226,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# exitAction.setStatusTip('Exit application')
self.menufile.addAction(self.menufile_exit)
- ### Edit ###
+ # ## Edit # ##
self.menuedit = self.menu.addMenu(_('&Edit'))
# Separator
self.menuedit.addSeparator()
@@ -305,7 +305,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.menuedit.addSeparator()
self.menueditpreferences = self.menuedit.addAction(QtGui.QIcon('share/pref.png'), _('&Preferences\tSHIFT+P'))
- ### Options ###
+ # ## Options # ##
self.menuoptions = self.menu.addMenu(_('&Options'))
# self.menuoptions_transfer = self.menuoptions.addMenu(QtGui.QIcon('share/transfer.png'), 'Transfer options')
# self.menuoptions_transfer_a2p = self.menuoptions_transfer.addAction("Application to Project")
@@ -344,7 +344,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# Separator
self.menuoptions.addSeparator()
- ### View ###
+ # ## View # ##
self.menuview = self.menu.addMenu(_('&View'))
self.menuviewenable = self.menuview.addAction(QtGui.QIcon('share/replot16.png'), _('Enable all plots\tALT+1'))
self.menuviewdisableall = self.menuview.addAction(QtGui.QIcon('share/clear_plot16.png'),
@@ -376,13 +376,13 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.menuview_toggle_workspace = self.menuview.addAction(QtGui.QIcon('share/workspace24.png'),
_("Toggle Workspace\tSHIFT+W"))
- ### Tool ###
+ # ## Tool # ##
# self.menutool = self.menu.addMenu('&Tool')
self.menutool = QtWidgets.QMenu(_('&Tool'))
self.menutoolaction = self.menu.addMenu(self.menutool)
self.menutoolshell = self.menutool.addAction(QtGui.QIcon('share/shell16.png'), _('&Command Line\tS'))
- ### Help ###
+ # ## Help # ##
self.menuhelp = self.menu.addMenu(_('&Help'))
self.menuhelp_manual = self.menuhelp.addAction(QtGui.QIcon('share/globe16.png'), _('Help\tF1'))
self.menuhelp_home = self.menuhelp.addAction(QtGui.QIcon('share/home16.png'), _('FlatCAM.org'))
@@ -394,7 +394,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.menuhelp_about = self.menuhelp.addAction(QtGui.QIcon('share/about32.png'), _('About'))
- ### FlatCAM Editor menu ###
+ # ## FlatCAM Editor menu # ##
# self.editor_menu = QtWidgets.QMenu("Editor")
# self.menu.addMenu(self.editor_menu)
self.geo_editor_menu = QtWidgets.QMenu(">Geo Editor<")
@@ -468,7 +468,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.exc_move_drill_menuitem = self.exc_editor_menu.addAction(
QtGui.QIcon('share/move32.png'),_( 'Move Drill(s)\tM'))
- ### APPLICATION GERBER EDITOR MENU ###
+ # ## APPLICATION GERBER EDITOR MENU # ##
self.grb_editor_menu = QtWidgets.QMenu(_(">Gerber Editor<"))
self.menu.addMenu(self.grb_editor_menu)
@@ -516,9 +516,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.exc_editor_menu.menuAction().setVisible(False)
self.exc_editor_menu.setDisabled(True)
- # ###############################
- # ## Project Tab Context menu ###
- # ###############################
+ # ############################# ##
+ # # ## Project Tab Context menu # ##
+ # ############################# ##
self.menuproject = QtWidgets.QMenu()
self.menuprojectenable = self.menuproject.addAction(QtGui.QIcon('share/replot32.png'), _('Enable Plot'))
@@ -535,9 +535,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.menuprojectproperties = self.menuproject.addAction(QtGui.QIcon('share/properties32.png'), _('Properties'))
- # ###############
- # ## Splitter ###
- # ###############
+ # ############# ##
+ # # ## Splitter # ##
+ # ############# ##
# IMPORTANT #
# The order: SPITTER -> NOTEBOOK -> SNAP TOOLBAR is important and without it the GUI will not be initialized as
@@ -557,11 +557,11 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.splitter_left.addWidget(self.notebook)
self.splitter_left.setHandleWidth(0)
- ###############
- ### Toolbar ###
- ###############
+ ############# ##
+ # ## Toolbar # ##
+ ############# ##
- ### TOOLBAR INSTALLATION ###
+ # ## TOOLBAR INSTALLATION # ##
self.toolbarfile = QtWidgets.QToolBar(_('File Toolbar'))
self.toolbarfile.setObjectName('File_TB')
self.addToolBar(self.toolbarfile)
@@ -608,7 +608,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.snap_toolbar.setMaximumHeight(30)
self.splitter_left.addWidget(self.snap_toolbar)
- ### File Toolbar ###
+ # ## File Toolbar # ##
self.file_open_gerber_btn = self.toolbarfile.addAction(QtGui.QIcon('share/flatcam_icon32.png'),
_("Open Gerber"))
self.file_open_excellon_btn = self.toolbarfile.addAction(QtGui.QIcon('share/drill32.png'), _("Open Excellon"))
@@ -616,7 +616,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.file_open_btn = self.toolbarfile.addAction(QtGui.QIcon('share/folder32.png'), _("Open project"))
self.file_save_btn = self.toolbarfile.addAction(QtGui.QIcon('share/floppy32.png'), _("Save project"))
- ### Edit Toolbar ###
+ # ## Edit Toolbar # ##
self.newgeo_btn = self.toolbargeo.addAction(QtGui.QIcon('share/new_geo32_bis.png'), _("New Blank Geometry"))
self.newgrb_btn = self.toolbargeo.addAction(QtGui.QIcon('share/new_geo32.png'), _("New Blank Gerber"))
self.newexc_btn = self.toolbargeo.addAction(QtGui.QIcon('share/new_exc32.png'), _("New Blank Excellon"))
@@ -629,7 +629,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.toolbargeo.addSeparator()
self.delete_btn = self.toolbargeo.addAction(QtGui.QIcon('share/cancel_edit32.png'), _("&Delete"))
- ### View Toolbar ###
+ # ## View Toolbar # ##
self.replot_btn = self.toolbarview.addAction(QtGui.QIcon('share/replot32.png'), _("&Replot"))
self.clear_plot_btn = self.toolbarview.addAction(QtGui.QIcon('share/clear_plot32.png'), _("&Clear plot"))
self.zoom_in_btn = self.toolbarview.addAction(QtGui.QIcon('share/zoom_in32.png'), _("Zoom In"))
@@ -638,10 +638,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# self.toolbarview.setVisible(False)
- ### Shell Toolbar ###
+ # ## Shell Toolbar # ##
self.shell_btn = self.toolbarshell.addAction(QtGui.QIcon('share/shell32.png'), _("&Command Line"))
- ### Tools Toolbar ###
+ # ## Tools Toolbar # ##
self.dblsided_btn = self.toolbartools.addAction(QtGui.QIcon('share/doubleside32.png'), _("2Sided Tool"))
self.cutout_btn = self.toolbartools.addAction(QtGui.QIcon('share/cut16_bis.png'), _("&Cutout Tool"))
self.ncc_btn = self.toolbartools.addAction(QtGui.QIcon('share/ncc16.png'), _("NCC Tool"))
@@ -658,7 +658,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.calculators_btn = self.toolbartools.addAction(QtGui.QIcon('share/calculator24.png'), _("Calculators Tool"))
self.transform_btn = self.toolbartools.addAction(QtGui.QIcon('share/transform.png'), _("Transform Tool"))
- ### Drill Editor Toolbar ###
+ # ## Drill Editor Toolbar # ##
self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), _("Select"))
self.add_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/plus16.png'), _('Add Drill Hole'))
self.add_drill_array_btn = self.exc_edit_toolbar.addAction(
@@ -672,7 +672,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.exc_edit_toolbar.addSeparator()
self.move_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move Drill"))
- ### Geometry Editor Toolbar ###
+ # ## Geometry Editor Toolbar # ##
self.geo_select_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), _("Select"))
self.geo_add_circle_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/circle32.png'), _('Add Circle'))
self.geo_add_arc_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/arc32.png'), _('Add Arc'))
@@ -706,7 +706,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.geo_edit_toolbar.addSeparator()
self.geo_move_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move Objects "))
- ### Gerber Editor Toolbar ###
+ # ## Gerber Editor Toolbar # ##
self.grb_select_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), _("Select"))
self.grb_add_pad_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/aperture32.png'), _("Add Pad"))
self.add_pad_ar_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/padarray32.png'), _('Add Pad Array'))
@@ -732,7 +732,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.grb_edit_toolbar.addSeparator()
self.aperture_move_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move"))
- # ## Snap Toolbar ###
+ # # ## Snap Toolbar # ##
# Snap GRID toolbar is always active to facilitate usage of measurements done on GRID
# self.addToolBar(self.snap_toolbar)
@@ -764,11 +764,11 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.snap_magnet = self.snap_toolbar.addWidget(self.snap_max_dist_entry)
- ################
- ### Notebook ###
- ################
+ ############## ##
+ # ## Notebook # ##
+ ############## ##
- ### Project ###
+ # ## Project # ##
# self.project_tab = QtWidgets.QWidget()
# self.project_tab.setObjectName("project_tab")
# # project_tab.setMinimumWidth(250) # Hack
@@ -791,7 +791,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.notebook.addTab(self.project_tab, _("Project"))
self.project_frame.setDisabled(False)
- ### Selected ###
+ # ## Selected # ##
self.selected_tab = QtWidgets.QWidget()
self.selected_tab.setObjectName("selected_tab")
self.selected_tab_layout = QtWidgets.QVBoxLayout(self.selected_tab)
@@ -800,7 +800,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.selected_tab_layout.addWidget(self.selected_scroll_area)
self.notebook.addTab(self.selected_tab, _("Selected"))
- ### Tool ###
+ # ## Tool # ##
self.tool_tab = QtWidgets.QWidget()
self.tool_tab.setObjectName("tool_tab")
self.tool_tab_layout = QtWidgets.QVBoxLayout(self.tool_tab)
@@ -834,9 +834,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# remove the close button from the Plot Area tab (first tab index = 0) as this one will always be ON
self.plot_tab_area.protectTab(0)
- ########################################
- ### HERE WE BUILD THE PREF. TAB AREA ###
- ########################################
+ ###################################### ##
+ # ## HERE WE BUILD THE PREF. TAB AREA # ##
+ ###################################### ##
self.preferences_tab = QtWidgets.QWidget()
self.pref_tab_layout = QtWidgets.QVBoxLayout(self.preferences_tab)
self.pref_tab_layout.setContentsMargins(2, 2, 2, 2)
@@ -960,9 +960,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
"which is the file storing the working default preferences."))
self.pref_tab_bottom_layout_2.addWidget(self.pref_save_button)
- ########################################
- ### HERE WE BUILD THE SHORTCUTS LIST. TAB AREA ###
- ########################################
+ ###################################### ##
+ # ## HERE WE BUILD THE SHORTCUTS LIST. TAB AREA # ##
+ ###################################### ##
self.shortcuts_tab = QtWidgets.QWidget()
self.sh_tab_layout = QtWidgets.QVBoxLayout()
self.sh_tab_layout.setContentsMargins(2, 2, 2, 2)
@@ -1574,9 +1574,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.sh_hlay.addWidget(self.sh_editor)
- # #############################################################
- # ## HERE WE BUILD THE CONTEXT MENU FOR RMB CLICK ON CANVAS ###
- # #############################################################
+ # ########################################################### ##
+ # # ## HERE WE BUILD THE CONTEXT MENU FOR RMB CLICK ON CANVAS # ##
+ # ########################################################### ##
self.popMenu = FCMenu()
self.popmenu_disable = self.popMenu.addAction(QtGui.QIcon('share/disable32.png'), _("Disable Plot"))
@@ -1628,9 +1628,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.popmenu_properties = self.popMenu.addAction(QtGui.QIcon('share/properties32.png'), _("Properties"))
- ####################################
- ### Here we build the CNCJob Tab ###
- ####################################
+ ################################## ##
+ # ## Here we build the CNCJob Tab # ##
+ ################################## ##
self.cncjob_tab = QtWidgets.QWidget()
self.cncjob_tab_layout = QtWidgets.QGridLayout(self.cncjob_tab)
self.cncjob_tab_layout.setContentsMargins(2, 2, 2, 2)
@@ -1687,9 +1687,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
cnc_tab_lay_4.addWidget(self.buttonSave)
self.cncjob_tab_layout.addLayout(cnc_tab_lay_4, 2, 4, 1, 1)
- ##################################
- ### Build InfoBar is done here ###
- ##################################
+ ################################ ##
+ # ## Build InfoBar is done here # ##
+ ################################ ##
self.infobar = self.statusBar()
self.fcinfo = FlatCAMInfoBar()
self.infobar.addWidget(self.fcinfo, stretch=1)
@@ -1744,9 +1744,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# log.debug("FlatCAMGUI.__init__() --> UI state not restored. IOError")
# pass
- ######################
- ### INITIALIZE GUI ###
- ######################
+ #################### ##
+ # ## INITIALIZE GUI # ##
+ #################### ##
self.grid_snap_btn.setCheckable(True)
self.corner_snap_btn.setCheckable(True)
@@ -1831,7 +1831,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
def populate_toolbars(self):
- ### File Toolbar ###
+ # ## File Toolbar # ##
self.file_open_gerber_btn = self.toolbarfile.addAction(QtGui.QIcon('share/flatcam_icon32.png'),
_("Open Gerber"))
self.file_open_excellon_btn = self.toolbarfile.addAction(QtGui.QIcon('share/drill32.png'), _("Open Excellon"))
@@ -1839,7 +1839,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.file_open_btn = self.toolbarfile.addAction(QtGui.QIcon('share/folder32.png'), _("Open project"))
self.file_save_btn = self.toolbarfile.addAction(QtGui.QIcon('share/floppy32.png'), _("Save project"))
- ### Edit Toolbar ###
+ # ## Edit Toolbar # ##
self.newgeo_btn = self.toolbargeo.addAction(QtGui.QIcon('share/new_geo32_bis.png'), _("New Blank Geometry"))
self.newexc_btn = self.toolbargeo.addAction(QtGui.QIcon('share/new_exc32.png'), _("New Blank Excellon"))
self.toolbargeo.addSeparator()
@@ -1851,7 +1851,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.toolbargeo.addSeparator()
self.delete_btn = self.toolbargeo.addAction(QtGui.QIcon('share/cancel_edit32.png'), _("&Delete"))
- ### View Toolbar ###
+ # ## View Toolbar # ##
self.replot_btn = self.toolbarview.addAction(QtGui.QIcon('share/replot32.png'), _("&Replot"))
self.clear_plot_btn = self.toolbarview.addAction(QtGui.QIcon('share/clear_plot32.png'), _("&Clear plot"))
self.zoom_in_btn = self.toolbarview.addAction(QtGui.QIcon('share/zoom_in32.png'), _("Zoom In"))
@@ -1860,10 +1860,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# self.toolbarview.setVisible(False)
- ### Shell Toolbar ###
+ # ## Shell Toolbar # ##
self.shell_btn = self.toolbarshell.addAction(QtGui.QIcon('share/shell32.png'), _("&Command Line"))
- ### Tools Toolbar ###
+ # ## Tools Toolbar # ##
self.dblsided_btn = self.toolbartools.addAction(QtGui.QIcon('share/doubleside32.png'), _("2Sided Tool"))
self.cutout_btn = self.toolbartools.addAction(QtGui.QIcon('share/cut16_bis.png'), _("&Cutout Tool"))
self.ncc_btn = self.toolbartools.addAction(QtGui.QIcon('share/ncc16.png'), _("NCC Tool"))
@@ -1882,7 +1882,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
_("Calculators Tool"))
self.transform_btn = self.toolbartools.addAction(QtGui.QIcon('share/transform.png'), _("Transform Tool"))
- ### Excellon Editor Toolbar ###
+ # ## Excellon Editor Toolbar # ##
self.select_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), _("Select"))
self.add_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/plus16.png'), _('Add Drill Hole'))
self.add_drill_array_btn = self.exc_edit_toolbar.addAction(
@@ -1897,7 +1897,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.exc_edit_toolbar.addSeparator()
self.move_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move Drill"))
- ### Geometry Editor Toolbar ###
+ # ## Geometry Editor Toolbar # ##
self.geo_select_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), _("Select 'Esc'"))
self.geo_add_circle_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/circle32.png'), _('Add Circle'))
self.geo_add_arc_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/arc32.png'), _('Add Arc'))
@@ -1934,7 +1934,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.geo_edit_toolbar.addSeparator()
self.geo_move_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move Objects"))
- ### Gerber Editor Toolbar ###
+ # ## Gerber Editor Toolbar # ##
self.grb_select_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), _("Select"))
self.grb_add_pad_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/aperture32.png'), _("Add Pad"))
self.add_pad_ar_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/padarray32.png'), _('Add Pad Array'))
@@ -1960,7 +1960,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.grb_edit_toolbar.addSeparator()
self.aperture_move_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move"))
- ### Snap Toolbar ###
+ # ## Snap Toolbar # ##
# Snap GRID toolbar is always active to facilitate usage of measurements done on GRID
# self.addToolBar(self.snap_toolbar)
@@ -2813,7 +2813,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# Add Track
if key == QtCore.Qt.Key_T or key == 'T':
self.app.grb_editor.launched_from_shortcuts = True
- ## Current application units in Upper Case
+ # ## Current application units in Upper Case
self.app.grb_editor.select_tool('track')
return
@@ -2990,7 +2990,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# Add Tool
if key == QtCore.Qt.Key_T or key == 'T':
self.app.exc_editor.launched_from_shortcuts = True
- ## Current application units in Upper Case
+ # ## Current application units in Upper Case
self.units = self.general_defaults_form.general_app_group.units_radio.get_value().upper()
tool_add_popup = FCInputDialog(title=_("New Tool ..."),
text=_('Enter a Tool Diameter:'),
@@ -3996,7 +3996,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI):
self.setTitle(str("Gerber General"))
- ## Plot options
+ # ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("Plot Options:"))
self.layout.addWidget(self.plot_options_label)
@@ -4045,7 +4045,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Gerber Options")))
- ## Isolation Routing
+ # ## Isolation Routing
self.isolation_routing_label = QtWidgets.QLabel(_("Isolation Routing:"))
self.isolation_routing_label.setToolTip(
_("Create a Geometry object with\n"
@@ -4104,7 +4104,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
)
grid0.addWidget(self.combine_passes_cb, 4, 0)
- ## Clear non-copper regions
+ # ## Clear non-copper regions
self.clearcopper_label = QtWidgets.QLabel(_("Clear non-copper:"))
self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n"
@@ -4135,7 +4135,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
)
grid1.addWidget(self.noncopper_rounded_cb, 1, 0, 1, 2)
- ## Bounding box
+ # ## Bounding box
self.boundingbox_label = QtWidgets.QLabel(_('Bounding Box:'))
self.layout.addWidget(self.boundingbox_label)
@@ -4170,7 +4170,7 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Gerber Adv. Options")))
- ## Advanced Gerber Parameters
+ # ## Advanced Gerber Parameters
self.adv_param_label = QtWidgets.QLabel(_("Advanced Param.:"))
self.adv_param_label.setToolTip(
_("A list of Gerber advanced parameters.\n"
@@ -4619,7 +4619,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Excellon Options")))
- ## Create CNC Job
+ # ## Create CNC Job
self.cncjob_label = QtWidgets.QLabel(_('Create CNC Job'))
self.cncjob_label.setToolTip(
_("Parameters used to create a CNC Job object\n"
@@ -4748,7 +4748,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
excellon_gcode_type_label.hide()
self.excellon_gcode_type_radio.setVisible(False)
- #### Milling Holes ####
+ #### Milling Holes ## ##
self.mill_hole_label = QtWidgets.QLabel(_('Mill Holes'))
self.mill_hole_label.setToolTip(
_("Create Geometry for milling holes.")
@@ -4793,9 +4793,9 @@ class ExcellonAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Excellon Adv. Options")))
- ######################
- ## ADVANCED OPTIONS ##
- ######################
+ #################### ##
+ # ## ADVANCED OPTIONS # ##
+ #################### ##
self.cncjob_label = QtWidgets.QLabel(_('Advanced Options:'))
self.cncjob_label.setToolTip(
@@ -5035,7 +5035,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Geometry General")))
- ## Plot options
+ # ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("Plot Options:"))
self.layout.addWidget(self.plot_options_label)
@@ -5086,7 +5086,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Geometry Options")))
# ------------------------------
- ## Create CNC Job
+ # ## Create CNC Job
# ------------------------------
self.cncjob_label = QtWidgets.QLabel(_('Create CNC Job:'))
self.cncjob_label.setToolTip(
@@ -5245,7 +5245,7 @@ class GeometryAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Geometry Adv. Options")))
# ------------------------------
- ## Advanced Options
+ # ## Advanced Options
# ------------------------------
self.cncjob_label = QtWidgets.QLabel(_('Advanced Options:'))
self.cncjob_label.setToolTip(
@@ -5407,7 +5407,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("CNC Job General")))
- ## Plot options
+ # ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("Plot Options:"))
self.layout.addWidget(self.plot_options_label)
@@ -5493,7 +5493,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("CNC Job Options")))
- ## Export G-Code
+ # ## Export G-Code
self.export_gcode_label = QtWidgets.QLabel(_("Export G-Code:"))
self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n"
@@ -5534,7 +5534,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("CNC Job Adv. Options")))
- ## Export G-Code
+ # ## Export G-Code
self.export_gcode_label = QtWidgets.QLabel(_("Export G-Code:"))
self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n"
@@ -5617,7 +5617,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("NCC Tool Options")))
- ## Clear non-copper regions
+ # ## Clear non-copper regions
self.clearcopper_label = QtWidgets.QLabel(_("Parameters:"))
self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n"
@@ -5718,7 +5718,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Cutout Tool Options")))
- ## Board cuttout
+ # ## Board cuttout
self.board_cutout_label = QtWidgets.QLabel(_("Parameters:"))
self.board_cutout_label.setToolTip(
_("Create toolpaths to cut around\n"
@@ -5797,7 +5797,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("2Sided Tool Options")))
- ## Board cuttout
+ # ## Board cuttout
self.dblsided_label = QtWidgets.QLabel(_("Parameters:"))
self.dblsided_label.setToolTip(
_("A tool to help in creating a double sided\n"
@@ -5808,7 +5808,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
- ## Drill diameter for alignment holes
+ # ## Drill diameter for alignment holes
self.drill_dia_entry = LengthEntry()
self.dd_label = QtWidgets.QLabel(_("Drill diam.:"))
self.dd_label.setToolTip(
@@ -5818,7 +5818,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.dd_label, 0, 0)
grid0.addWidget(self.drill_dia_entry, 0, 1)
- ## Axis
+ # ## Axis
self.mirror_axis_radio = RadioSet([{'label': 'X', 'value': 'X'},
{'label': 'Y', 'value': 'Y'}])
self.mirax_label = QtWidgets.QLabel(_("Mirror Axis:"))
@@ -5831,7 +5831,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.mirax_label, 2, 0)
grid0.addWidget(self.mirror_axis_radio, 2, 1)
- ## Axis Location
+ # ## Axis Location
self.axis_location_radio = RadioSet([{'label': 'Point', 'value': 'point'},
{'label': 'Box', 'value': 'box'}])
self.axloc_label = QtWidgets.QLabel(_("Axis Ref:"))
@@ -5855,7 +5855,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Paint Tool Options")))
# ------------------------------
- ## Paint area
+ # ## Paint area
# ------------------------------
self.paint_label = QtWidgets.QLabel(_('Parameters:'))
self.paint_label.setToolTip(
@@ -5959,7 +5959,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Film Tool Options")))
- ## Board cuttout
+ # ## Board cuttout
self.film_label = QtWidgets.QLabel(_("Parameters:"))
self.film_label.setToolTip(
_("Create a PCB film from a Gerber or Geometry\n"
@@ -6020,7 +6020,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Panelize Tool Options")))
- ## Board cuttout
+ # ## Board cuttout
self.panelize_label = QtWidgets.QLabel(_("Parameters:"))
self.panelize_label.setToolTip(
_("Create an object that contains an array of (x, y) elements,\n"
@@ -6032,7 +6032,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
- ## Spacing Columns
+ # ## Spacing Columns
self.pspacing_columns = FCEntry()
self.spacing_columns_label = QtWidgets.QLabel(_("Spacing cols:"))
self.spacing_columns_label.setToolTip(
@@ -6042,7 +6042,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.spacing_columns_label, 0, 0)
grid0.addWidget(self.pspacing_columns, 0, 1)
- ## Spacing Rows
+ # ## Spacing Rows
self.pspacing_rows = FCEntry()
self.spacing_rows_label = QtWidgets.QLabel(_("Spacing rows:"))
self.spacing_rows_label.setToolTip(
@@ -6052,7 +6052,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.spacing_rows_label, 1, 0)
grid0.addWidget(self.pspacing_rows, 1, 1)
- ## Columns
+ # ## Columns
self.pcolumns = FCEntry()
self.columns_label = QtWidgets.QLabel(_("Columns:"))
self.columns_label.setToolTip(
@@ -6061,7 +6061,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.columns_label, 2, 0)
grid0.addWidget(self.pcolumns, 2, 1)
- ## Rows
+ # ## Rows
self.prows = FCEntry()
self.rows_label = QtWidgets.QLabel(_("Rows:"))
self.rows_label.setToolTip(
@@ -6070,7 +6070,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.rows_label, 3, 0)
grid0.addWidget(self.prows, 3, 1)
- ## Type of resulting Panel object
+ # ## Type of resulting Panel object
self.panel_type_radio = RadioSet([{'label': 'Gerber', 'value': 'gerber'},
{'label': 'Geo', 'value': 'geometry'}])
self.panel_type_label = QtWidgets.QLabel(_("Panel Type:"))
@@ -6083,7 +6083,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.panel_type_label, 4, 0)
grid0.addWidget(self.panel_type_radio, 4, 1)
- ## Constrains
+ # ## Constrains
self.pconstrain_cb = FCCheckBox(_("Constrain within:"))
self.pconstrain_cb.setToolTip(
_("Area define by DX and DY within to constrain the panel.\n"
@@ -6122,7 +6122,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Calculators Tool Options")))
- ## V-shape Calculator Tool
+ # ## V-shape Calculator Tool
self.vshape_tool_label = QtWidgets.QLabel(_("V-Shape Tool Calculator:"))
self.vshape_tool_label.setToolTip(
_("Calculate the tool diameter for a given V-shape tool,\n"
@@ -6134,7 +6134,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
- ## Tip Diameter
+ # ## Tip Diameter
self.tip_dia_entry = FCEntry()
self.tip_dia_label = QtWidgets.QLabel(_("Tip Diameter:"))
self.tip_dia_label.setToolTip(
@@ -6144,7 +6144,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.tip_dia_label, 0, 0)
grid0.addWidget(self.tip_dia_entry, 0, 1)
- ## Tip angle
+ # ## Tip angle
self.tip_angle_entry = FCEntry()
self.tip_angle_label = QtWidgets.QLabel(_("Tip angle:"))
self.tip_angle_label.setToolTip(
@@ -6154,7 +6154,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.tip_angle_label, 1, 0)
grid0.addWidget(self.tip_angle_entry, 1, 1)
- ## Depth-of-cut Cut Z
+ # ## Depth-of-cut Cut Z
self.cut_z_entry = FCEntry()
self.cut_z_label = QtWidgets.QLabel(_("Cut Z:"))
self.cut_z_label.setToolTip(
@@ -6164,7 +6164,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.cut_z_label, 2, 0)
grid0.addWidget(self.cut_z_entry, 2, 1)
- ## Electroplating Calculator Tool
+ # ## Electroplating Calculator Tool
self.plate_title_label = QtWidgets.QLabel(_("ElectroPlating Calculator:"))
self.plate_title_label.setToolTip(
_("This calculator is useful for those who plate the via/pad/drill holes,\n"
@@ -6175,7 +6175,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid1)
- ## PCB Length
+ # ## PCB Length
self.pcblength_entry = FCEntry()
self.pcblengthlabel = QtWidgets.QLabel(_("Board Length:"))
@@ -6183,7 +6183,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.pcblengthlabel, 0, 0)
grid1.addWidget(self.pcblength_entry, 0, 1)
- ## PCB Width
+ # ## PCB Width
self.pcbwidth_entry = FCEntry()
self.pcbwidthlabel = QtWidgets.QLabel(_("Board Width:"))
@@ -6191,7 +6191,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.pcbwidthlabel, 1, 0)
grid1.addWidget(self.pcbwidth_entry, 1, 1)
- ## Current Density
+ # ## Current Density
self.cdensity_label = QtWidgets.QLabel(_("Current Density:"))
self.cdensity_entry = FCEntry()
@@ -6200,7 +6200,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.cdensity_label, 2, 0)
grid1.addWidget(self.cdensity_entry, 2, 1)
- ## PCB Copper Growth
+ # ## PCB Copper Growth
self.growth_label = QtWidgets.QLabel(_("Copper Growth:"))
self.growth_entry = FCEntry()
@@ -6219,7 +6219,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Transform Tool Options")))
- ## Transformations
+ # ## Transformations
self.transform_label = QtWidgets.QLabel(_("Parameters:"))
self.transform_label.setToolTip(
_("Various transformations that can be applied\n"
@@ -6230,7 +6230,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
- ## Rotate Angle
+ # ## Rotate Angle
self.rotate_entry = FCEntry()
self.rotate_label = QtWidgets.QLabel(_("Rotate Angle:"))
self.rotate_label.setToolTip(
@@ -6239,7 +6239,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.rotate_label, 0, 0)
grid0.addWidget(self.rotate_entry, 0, 1)
- ## Skew/Shear Angle on X axis
+ # ## Skew/Shear Angle on X axis
self.skewx_entry = FCEntry()
self.skewx_label = QtWidgets.QLabel(_("Skew_X angle:"))
self.skewx_label.setToolTip(
@@ -6248,7 +6248,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.skewx_label, 1, 0)
grid0.addWidget(self.skewx_entry, 1, 1)
- ## Skew/Shear Angle on Y axis
+ # ## Skew/Shear Angle on Y axis
self.skewy_entry = FCEntry()
self.skewy_label = QtWidgets.QLabel(_("Skew_Y angle:"))
self.skewy_label.setToolTip(
@@ -6257,7 +6257,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.skewy_label, 2, 0)
grid0.addWidget(self.skewy_entry, 2, 1)
- ## Scale factor on X axis
+ # ## Scale factor on X axis
self.scalex_entry = FCEntry()
self.scalex_label = QtWidgets.QLabel(_("Scale_X factor:"))
self.scalex_label.setToolTip(
@@ -6266,7 +6266,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.scalex_label, 3, 0)
grid0.addWidget(self.scalex_entry, 3, 1)
- ## Scale factor on X axis
+ # ## Scale factor on X axis
self.scaley_entry = FCEntry()
self.scaley_label = QtWidgets.QLabel(_("Scale_Y factor:"))
self.scaley_label.setToolTip(
@@ -6275,7 +6275,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.scaley_label, 4, 0)
grid0.addWidget(self.scaley_entry, 4, 1)
- ## Link Scale factors
+ # ## Link Scale factors
self.link_cb = FCCheckBox(_("Link"))
self.link_cb.setToolTip(
_("Scale the selected object(s)\n"
@@ -6283,7 +6283,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
)
grid0.addWidget(self.link_cb, 5, 0)
- ## Scale Reference
+ # ## Scale Reference
self.reference_cb = FCCheckBox(_("Scale Reference"))
self.reference_cb.setToolTip(
_("Scale the selected object(s)\n"
@@ -6293,7 +6293,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
)
grid0.addWidget(self.reference_cb, 5, 1)
- ## Offset distance on X axis
+ # ## Offset distance on X axis
self.offx_entry = FCEntry()
self.offx_label = QtWidgets.QLabel(_("Offset_X val:"))
self.offx_label.setToolTip(
@@ -6302,7 +6302,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.offx_label, 6, 0)
grid0.addWidget(self.offx_entry, 6, 1)
- ## Offset distance on Y axis
+ # ## Offset distance on Y axis
self.offy_entry = FCEntry()
self.offy_label = QtWidgets.QLabel(_("Offset_Y val:"))
self.offy_label.setToolTip(
@@ -6311,7 +6311,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.offy_label, 7, 0)
grid0.addWidget(self.offy_entry, 7, 1)
- ## Mirror (Flip) Reference Point
+ # ## Mirror (Flip) Reference Point
self.mirror_reference_cb = FCCheckBox(_("Mirror Reference"))
self.mirror_reference_cb.setToolTip(
_("Flip the selected object(s)\n"
@@ -6346,7 +6346,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("SolderPaste Tool Options")))
- ## Solder Paste Dispensing
+ # ## Solder Paste Dispensing
self.solderpastelabel = QtWidgets.QLabel(_("Parameters:"))
self.solderpastelabel.setToolTip(
_("A tool to create GCode for dispensing\n"
diff --git a/flatcamGUI/GUIElements.py b/flatcamGUI/GUIElements.py
index 89c2b2bc..fcd8aa61 100644
--- a/flatcamGUI/GUIElements.py
+++ b/flatcamGUI/GUIElements.py
@@ -1,15 +1,15 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
-############################################################
+# ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 #
-############################################################
+# ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot
diff --git a/flatcamGUI/ObjectUI.py b/flatcamGUI/ObjectUI.py
index 84fd1986..61fa7868 100644
--- a/flatcamGUI/ObjectUI.py
+++ b/flatcamGUI/ObjectUI.py
@@ -1,15 +1,15 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
-############################################################
+# ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 #
-############################################################
+# ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt
@@ -36,22 +36,22 @@ class ObjectUI(QtWidgets.QWidget):
layout = QtWidgets.QVBoxLayout()
self.setLayout(layout)
- ## Page Title box (spacing between children)
+ # ## Page Title box (spacing between children)
self.title_box = QtWidgets.QHBoxLayout()
layout.addLayout(self.title_box)
- ## Page Title icon
+ # ## Page Title icon
pixmap = QtGui.QPixmap(icon_file)
self.icon = QtWidgets.QLabel()
self.icon.setPixmap(pixmap)
self.title_box.addWidget(self.icon, stretch=0)
- ## Title label
+ # ## Title label
self.title_label = QtWidgets.QLabel("%s" % title)
self.title_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
self.title_box.addWidget(self.title_label, stretch=1)
- ## App Level label
+ # ## App Level label
self.level = QtWidgets.QLabel("")
self.level.setToolTip(
_(
@@ -66,16 +66,16 @@ class ObjectUI(QtWidgets.QWidget):
self.level.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.title_box.addWidget(self.level)
- ## Box box for custom widgets
+ # ## Box box for custom widgets
# This gets populated in offspring implementations.
self.custom_box = QtWidgets.QVBoxLayout()
layout.addLayout(self.custom_box)
- ###########################
- ## Common to all objects ##
- ###########################
+ ######################### ##
+ # ## Common to all objects # ##
+ ######################### ##
- #### Scale ####
+ #### Scale ## ##
self.scale_label = QtWidgets.QLabel(_('Scale:'))
self.scale_label.setToolTip(
_("Change the size of the object.")
@@ -104,7 +104,7 @@ class ObjectUI(QtWidgets.QWidget):
self.scale_button.setFixedWidth(70)
self.scale_grid.addWidget(self.scale_button, 0, 2)
- #### Offset ####
+ #### Offset ## ##
self.offset_label = QtWidgets.QLabel(_('Offset:'))
self.offset_label.setToolTip(
_("Change the position of this object.")
@@ -176,7 +176,7 @@ class GerberObjectUI(ObjectUI):
self.plot_cb.setFixedWidth(59)
grid0.addWidget(self.plot_cb, 0, 3)
- ## Object name
+ # ## Object name
self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("Name:"))
@@ -188,7 +188,7 @@ class GerberObjectUI(ObjectUI):
hlay_plot = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(hlay_plot)
- #### Gerber Apertures ####
+ #### Gerber Apertures ## ##
self.apertures_table_label = QtWidgets.QLabel(_('Apertures:'))
self.apertures_table_label.setToolTip(
_("Apertures Table for the Gerber Object.")
@@ -380,7 +380,7 @@ class GerberObjectUI(ObjectUI):
grid2 = QtWidgets.QGridLayout()
self.custom_box.addLayout(grid2)
- ## Clear non-copper regions
+ # ## Clear non-copper regions
self.clearcopper_label = QtWidgets.QLabel(_("Clear N-copper:"))
self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n"
@@ -396,7 +396,7 @@ class GerberObjectUI(ObjectUI):
)
grid2.addWidget(self.generate_ncc_button, 0, 1)
- ## Board cutout
+ # ## Board cutout
self.board_cutout_label = QtWidgets.QLabel(_("Board cutout:"))
self.board_cutout_label.setToolTip(
_("Create toolpaths to cut around\n"
@@ -412,7 +412,7 @@ class GerberObjectUI(ObjectUI):
)
grid2.addWidget(self.generate_cutout_button, 1, 1)
- ## Non-copper regions
+ # ## Non-copper regions
self.noncopper_label = QtWidgets.QLabel(_("Non-copper regions:"))
self.noncopper_label.setToolTip(
_("Create polygons covering the\n"
@@ -450,7 +450,7 @@ class GerberObjectUI(ObjectUI):
self.generate_noncopper_button = QtWidgets.QPushButton(_('Generate Geo'))
grid4.addWidget(self.generate_noncopper_button, 1, 1)
- ## Bounding box
+ # ## Bounding box
self.boundingbox_label = QtWidgets.QLabel(_('Bounding Box:'))
self.boundingbox_label.setToolTip(
_("Create a geometry surrounding the Gerber object.\n"
@@ -498,7 +498,7 @@ class ExcellonObjectUI(ObjectUI):
icon_file='share/drill32.png',
parent=parent)
- #### Plot options ####
+ #### Plot options ## ##
hlay_plot = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(hlay_plot)
@@ -511,7 +511,7 @@ class ExcellonObjectUI(ObjectUI):
hlay_plot.addStretch()
hlay_plot.addWidget(self.solid_cb)
- ## Object name
+ # ## Object name
self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("Name:"))
@@ -532,7 +532,7 @@ class ExcellonObjectUI(ObjectUI):
hlay_plot = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(hlay_plot)
- #### Tools Drills ####
+ #### Tools Drills ## ##
self.tools_table_label = QtWidgets.QLabel(_('Tools Table'))
self.tools_table_label.setToolTip(
_("Tools in this Excellon object\n"
@@ -580,7 +580,7 @@ class ExcellonObjectUI(ObjectUI):
self.empty_label = QtWidgets.QLabel('')
self.tools_box.addWidget(self.empty_label)
- #### Create CNC Job ####
+ #### Create CNC Job ## ##
self.cncjob_label = QtWidgets.QLabel(_('Create CNC Job'))
self.cncjob_label.setToolTip(
_("Create a CNC Job object\n"
@@ -768,7 +768,7 @@ class ExcellonObjectUI(ObjectUI):
)
self.tools_box.addWidget(self.generate_cnc_button)
- #### Milling Holes Drills####
+ #### Milling Holes Drills## ##
self.mill_hole_label = QtWidgets.QLabel(_('Mill Holes'))
self.mill_hole_label.setToolTip(
_("Create Geometry for milling holes.")
@@ -833,7 +833,7 @@ class GeometryObjectUI(ObjectUI):
self.plot_options_label = QtWidgets.QLabel(_("Plot Options:"))
self.custom_box.addWidget(self.plot_options_label)
- ## Object name
+ # ## Object name
self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("Name:"))
@@ -854,7 +854,7 @@ class GeometryObjectUI(ObjectUI):
hlay_plot = QtWidgets.QHBoxLayout()
self.geo_tools_box.addLayout(hlay_plot)
- #### Tools ####
+ #### Tools ## ##
self.tools_table_label = QtWidgets.QLabel(_('Tools Table'))
self.tools_table_label.setToolTip(
_("Tools in this Geometry object used for cutting.\n"
@@ -964,7 +964,7 @@ class GeometryObjectUI(ObjectUI):
self.grid1.addWidget(self.tool_offset_entry, 0, 1)
self.grid1.addWidget(spacer_lbl, 0, 2)
- #### Add a new Tool ####
+ #### Add a new Tool ## ##
hlay = QtWidgets.QHBoxLayout()
self.geo_tools_box.addLayout(hlay)
@@ -1022,7 +1022,7 @@ class GeometryObjectUI(ObjectUI):
#-----------------------------------
# Create CNC Job
#-----------------------------------
- #### Tools Data ####
+ #### Tools Data ## ##
self.tool_data_label = QtWidgets.QLabel(_('Tool Data'))
self.tool_data_label.setToolTip(
_(
@@ -1346,7 +1346,7 @@ class CNCObjectUI(ObjectUI):
self.offset_label.hide()
self.offset_button.hide()
- ## Plot options
+ # ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("Plot Options:"))
self.custom_box.addWidget(self.plot_options_label)
@@ -1366,7 +1366,7 @@ class CNCObjectUI(ObjectUI):
{"label": "Cut", "value": "cut"}
], stretch=False)
- ## Object name
+ # ## Object name
self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("Name:"))
@@ -1462,9 +1462,9 @@ class CNCObjectUI(ObjectUI):
)
self.custom_box.addWidget(self.updateplot_button)
- ##################
- ## Export G-Code
- ##################
+ ################ ##
+ # ## Export G-Code
+ ################ ##
self.export_gcode_label = QtWidgets.QLabel(_("Export CNC Code:"))
self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n"
diff --git a/flatcamGUI/PlotCanvas.py b/flatcamGUI/PlotCanvas.py
index e5ffb775..e1957bc9 100644
--- a/flatcamGUI/PlotCanvas.py
+++ b/flatcamGUI/PlotCanvas.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://caram.cl/software/flatcam #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from PyQt5 import QtCore
@@ -51,7 +51,7 @@ class PlotCanvas(QtCore.QObject):
self.vispy_canvas.native.setParent(self.app.ui)
self.container.addWidget(self.vispy_canvas.native)
- ### AXIS ###
+ # ## AXIS # ##
self.v_line = InfiniteLine(pos=0, color=(0.70, 0.3, 0.3, 1.0), vertical=True,
parent=self.vispy_canvas.view.scene)
diff --git a/flatcamGUI/VisPyCanvas.py b/flatcamGUI/VisPyCanvas.py
index 92a5ba01..9d945440 100644
--- a/flatcamGUI/VisPyCanvas.py
+++ b/flatcamGUI/VisPyCanvas.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Dennis Hayrullin #
# Date: 2/5/2016 #
# MIT Licence #
-############################################################
+# ########################################################## ##
import numpy as np
from PyQt5.QtGui import QPalette
diff --git a/flatcamGUI/VisPyPatches.py b/flatcamGUI/VisPyPatches.py
index dc4593a5..7e2c5d0d 100644
--- a/flatcamGUI/VisPyPatches.py
+++ b/flatcamGUI/VisPyPatches.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Dennis Hayrullin #
# Date: 2/5/2016 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from vispy.visuals import markers, LineVisual, InfiniteLineVisual
from vispy.visuals.axis import Ticker, _get_ticks_talbot
diff --git a/flatcamGUI/VisPyTesselators.py b/flatcamGUI/VisPyTesselators.py
index 4645fc38..d7404898 100644
--- a/flatcamGUI/VisPyTesselators.py
+++ b/flatcamGUI/VisPyTesselators.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Dennis Hayrullin #
# Date: 2/5/2016 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from OpenGL import GLU
diff --git a/flatcamGUI/VisPyVisuals.py b/flatcamGUI/VisPyVisuals.py
index 59e926af..c6016233 100644
--- a/flatcamGUI/VisPyVisuals.py
+++ b/flatcamGUI/VisPyVisuals.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Dennis Hayrullin #
# Date: 2/5/2016 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from vispy.visuals import CompoundVisual, LineVisual, MeshVisual, TextVisual, MarkersVisual
from vispy.scene.visuals import VisualNode, generate_docstring, visuals
diff --git a/flatcamParsers/ParseDXF.py b/flatcamParsers/ParseDXF.py
index 327a4d9b..88326afe 100644
--- a/flatcamParsers/ParseDXF.py
+++ b/flatcamParsers/ParseDXF.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from shapely.geometry import LineString
import logging
diff --git a/flatcamParsers/ParseDXF_Spline.py b/flatcamParsers/ParseDXF_Spline.py
index b3cb2110..8e0aac59 100644
--- a/flatcamParsers/ParseDXF_Spline.py
+++ b/flatcamParsers/ParseDXF_Spline.py
@@ -2,12 +2,12 @@
# Vasilis Vlachoudis
# Date: 20-Oct-2015
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File modified: Marius Adrian Stanciu #
# Date: 3/10/2019 #
-############################################################
+# ########################################################## ##
import math
import sys
diff --git a/flatcamParsers/ParseFont.py b/flatcamParsers/ParseFont.py
index a6f89d4f..f7b0034e 100644
--- a/flatcamParsers/ParseFont.py
+++ b/flatcamParsers/ParseFont.py
@@ -1,15 +1,15 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
-#########################################################################
-### Borrowed code from 'https://github.com/gddc/ttfquery/blob/master/ ###
-### and made it work with Python 3 #############
-#########################################################################
+# ####################################################################### ##
+# ## Borrowed code from 'https://github.com/gddc/ttfquery/blob/master/ # ##
+# ## and made it work with Python 3 ########### ##
+# ####################################################################### ##
import re, os, sys, glob
import itertools
diff --git a/flatcamParsers/ParseSVG.py b/flatcamParsers/ParseSVG.py
index dccabc2c..7aabdd85 100644
--- a/flatcamParsers/ParseSVG.py
+++ b/flatcamParsers/ParseSVG.py
@@ -1,4 +1,4 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
@@ -17,7 +17,7 @@
# * All transformations #
# #
# Reference: www.w3.org/TR/SVG/Overview.html #
-############################################################
+# ########################################################## ##
# import xml.etree.ElementTree as ET
from svg.path import Line, Arc, CubicBezier, QuadraticBezier, parse_path
diff --git a/flatcamTools/ToolCalculators.py b/flatcamTools/ToolCalculators.py
index 18c63d38..0b2b87a8 100644
--- a/flatcamTools/ToolCalculators.py
+++ b/flatcamTools/ToolCalculators.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from FlatCAMObj import *
@@ -31,7 +31,7 @@ class ToolCalculator(FlatCAMTool):
self.app = app
- ## Title
+ # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@@ -42,14 +42,14 @@ class ToolCalculator(FlatCAMTool):
""")
self.layout.addWidget(title_label)
- ######################
- ## Units Calculator ##
- ######################
+ #################### ##
+ # ## Units Calculator # ##
+ #################### ##
self.unists_spacer_label = QtWidgets.QLabel(" ")
self.layout.addWidget(self.unists_spacer_label)
- ## Title of the Units Calculator
+ # ## Title of the Units Calculator
units_label = QtWidgets.QLabel("%s" % self.unitsName)
self.layout.addWidget(units_label)
@@ -76,18 +76,18 @@ class ToolCalculator(FlatCAMTool):
grid_units_layout.addWidget(self.inch_entry, 1, 1)
- ############################
- ## V-shape Tool Calculator ##
- ############################
+ ########################## ##
+ # ## V-shape Tool Calculator # ##
+ ########################## ##
self.v_shape_spacer_label = QtWidgets.QLabel(" ")
self.layout.addWidget(self.v_shape_spacer_label)
- ## Title of the V-shape Tools Calculator
+ # ## Title of the V-shape Tools Calculator
v_shape_title_label = QtWidgets.QLabel("%s" % self.v_shapeName)
self.layout.addWidget(v_shape_title_label)
- ## Form Layout
+ # ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout)
@@ -127,7 +127,7 @@ class ToolCalculator(FlatCAMTool):
form_layout.addRow(self.cutDepth_label, self.cutDepth_entry)
form_layout.addRow(self.effectiveToolDia_label, self.effectiveToolDia_entry)
- ## Buttons
+ # ## Buttons
self.calculate_vshape_button = QtWidgets.QPushButton(_("Calculate"))
# self.calculate_button.setFixedWidth(70)
self.calculate_vshape_button.setToolTip(
@@ -139,14 +139,14 @@ class ToolCalculator(FlatCAMTool):
form_layout.addRow(self.empty_label, self.calculate_vshape_button)
- ####################################
- ## ElectroPlating Tool Calculator ##
- ####################################
+ ################################## ##
+ # ## ElectroPlating Tool Calculator # ##
+ ################################## ##
self.plate_spacer_label = QtWidgets.QLabel(" ")
self.layout.addWidget(self.plate_spacer_label)
- ## Title of the ElectroPlating Tools Calculator
+ # ## Title of the ElectroPlating Tools Calculator
plate_title_label = QtWidgets.QLabel("%s" % self.eplateName)
plate_title_label.setToolTip(
_("This calculator is useful for those who plate the via/pad/drill holes,\n"
@@ -154,7 +154,7 @@ class ToolCalculator(FlatCAMTool):
)
self.layout.addWidget(plate_title_label)
- ## Plate Form Layout
+ # ## Plate Form Layout
plate_form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(plate_form_layout)
@@ -210,7 +210,7 @@ class ToolCalculator(FlatCAMTool):
plate_form_layout.addRow(self.cvaluelabel, self.cvalue_entry)
plate_form_layout.addRow(self.timelabel, self.time_entry)
- ## Buttons
+ # ## Buttons
self.calculate_plate_button = QtWidgets.QPushButton(_("Calculate"))
# self.calculate_button.setFixedWidth(70)
self.calculate_plate_button.setToolTip(
@@ -223,7 +223,7 @@ class ToolCalculator(FlatCAMTool):
self.layout.addStretch()
- ## Signals
+ # ## Signals
self.cutDepth_entry.textChanged.connect(self.on_calculate_tool_dia)
self.cutDepth_entry.editingFinished.connect(self.on_calculate_tool_dia)
self.tipDia_entry.editingFinished.connect(self.on_calculate_tool_dia)
@@ -264,7 +264,7 @@ class ToolCalculator(FlatCAMTool):
def set_tool_ui(self):
self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
- ## Initialize form
+ # ## Initialize form
self.mm_entry.set_value('0')
self.inch_entry.set_value('0')
diff --git a/flatcamTools/ToolDblSided.py b/flatcamTools/ToolDblSided.py
index 1a7f7786..eb1f698c 100644
--- a/flatcamTools/ToolDblSided.py
+++ b/flatcamTools/ToolDblSided.py
@@ -20,7 +20,7 @@ class DblSidedTool(FlatCAMTool):
def __init__(self, app):
FlatCAMTool.__init__(self, app)
- ## Title
+ # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@@ -34,11 +34,11 @@ class DblSidedTool(FlatCAMTool):
self.empty_lb = QtWidgets.QLabel("")
self.layout.addWidget(self.empty_lb)
- ## Grid Layout
+ # ## Grid Layout
grid_lay = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay)
- ## Gerber Object to mirror
+ # ## Gerber Object to mirror
self.gerber_object_combo = QtWidgets.QComboBox()
self.gerber_object_combo.setModel(self.app.collection)
self.gerber_object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
@@ -62,7 +62,7 @@ class DblSidedTool(FlatCAMTool):
grid_lay.addWidget(self.gerber_object_combo, 1, 0)
grid_lay.addWidget(self.mirror_gerber_button, 1, 1)
- ## Excellon Object to mirror
+ # ## Excellon Object to mirror
self.exc_object_combo = QtWidgets.QComboBox()
self.exc_object_combo.setModel(self.app.collection)
self.exc_object_combo.setRootModelIndex(self.app.collection.index(1, 0, QtCore.QModelIndex()))
@@ -86,7 +86,7 @@ class DblSidedTool(FlatCAMTool):
grid_lay.addWidget(self.exc_object_combo, 3, 0)
grid_lay.addWidget(self.mirror_exc_button, 3, 1)
- ## Geometry Object to mirror
+ # ## Geometry Object to mirror
self.geo_object_combo = QtWidgets.QComboBox()
self.geo_object_combo.setModel(self.app.collection)
self.geo_object_combo.setRootModelIndex(self.app.collection.index(2, 0, QtCore.QModelIndex()))
@@ -110,11 +110,11 @@ class DblSidedTool(FlatCAMTool):
grid_lay.addWidget(self.geo_object_combo, 5, 0)
grid_lay.addWidget(self.mirror_geo_button, 5, 1)
- ## Grid Layout
+ # ## Grid Layout
grid_lay1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay1)
- ## Axis
+ # ## Axis
self.mirror_axis = RadioSet([{'label': 'X', 'value': 'X'},
{'label': 'Y', 'value': 'Y'}])
self.mirax_label = QtWidgets.QLabel(_("Mirror Axis:"))
@@ -127,7 +127,7 @@ class DblSidedTool(FlatCAMTool):
grid_lay1.addWidget(self.mirax_label, 7, 0)
grid_lay1.addWidget(self.mirror_axis, 7, 1)
- ## Axis Location
+ # ## Axis Location
self.axis_location = RadioSet([{'label': 'Point', 'value': 'point'},
{'label': 'Box', 'value': 'box'}])
self.axloc_label = QtWidgets.QLabel(_("Axis Ref:"))
@@ -143,11 +143,11 @@ class DblSidedTool(FlatCAMTool):
self.empty_lb2 = QtWidgets.QLabel("")
grid_lay1.addWidget(self.empty_lb2, 9, 0)
- ## Grid Layout
+ # ## Grid Layout
grid_lay2 = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay2)
- ## Point/Box
+ # ## Point/Box
self.point_box_container = QtWidgets.QVBoxLayout()
self.pb_label = QtWidgets.QLabel("%s" % _('Point/Box Reference:'))
self.pb_label.setToolTip(
@@ -189,7 +189,7 @@ class DblSidedTool(FlatCAMTool):
self.box_combo_type.hide()
- ## Alignment holes
+ # ## Alignment holes
self.ah_label = QtWidgets.QLabel("%s" % _('Alignment Drill Coordinates:'))
self.ah_label.setToolTip(
_( "Alignment holes (x1, y1), (x2, y2), ... "
@@ -220,7 +220,7 @@ class DblSidedTool(FlatCAMTool):
grid_lay3.addWidget(self.alignment_holes, 0, 0)
grid_lay3.addWidget(self.add_drill_point_button, 0, 1)
- ## Drill diameter for alignment holes
+ # ## Drill diameter for alignment holes
self.dt_label = QtWidgets.QLabel("%s:" % _('Alignment Drill Diameter'))
self.dt_label.setToolTip(
_("Diameter of the drill for the "
@@ -243,7 +243,7 @@ class DblSidedTool(FlatCAMTool):
hlay2 = QtWidgets.QHBoxLayout()
self.layout.addLayout(hlay2)
- ## Buttons
+ # ## Buttons
self.create_alignment_hole_button = QtWidgets.QPushButton(_("Create Excellon Object"))
self.create_alignment_hole_button.setToolTip(
_("Creates an Excellon Object containing the\n"
@@ -261,7 +261,7 @@ class DblSidedTool(FlatCAMTool):
self.layout.addStretch()
- ## Signals
+ # ## Signals
self.create_alignment_hole_button.clicked.connect(self.on_create_alignment_holes)
self.mirror_gerber_button.clicked.connect(self.on_mirror_gerber)
self.mirror_exc_button.clicked.connect(self.on_mirror_exc)
diff --git a/flatcamTools/ToolFilm.py b/flatcamTools/ToolFilm.py
index 46a96da5..400a11dd 100644
--- a/flatcamTools/ToolFilm.py
+++ b/flatcamTools/ToolFilm.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
@@ -165,7 +165,7 @@ class Film(FlatCAMTool):
self.layout.addStretch()
- ## Signals
+ # ## Signals
self.film_object_button.clicked.connect(self.on_film_creation)
self.tf_type_obj_combo.currentIndexChanged.connect(self.on_type_obj_index_changed)
self.tf_type_box_combo.currentIndexChanged.connect(self.on_type_box_index_changed)
diff --git a/flatcamTools/ToolImage.py b/flatcamTools/ToolImage.py
index c1f38dae..a88b82e3 100644
--- a/flatcamTools/ToolImage.py
+++ b/flatcamTools/ToolImage.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
@@ -144,7 +144,7 @@ class ToolImage(FlatCAMTool):
self.layout.addStretch()
- ## Signals
+ # ## Signals
self.import_button.clicked.connect(self.on_file_importimage)
def run(self, toggle=True):
@@ -173,7 +173,7 @@ class ToolImage(FlatCAMTool):
FlatCAMTool.install(self, icon, separator, **kwargs)
def set_tool_ui(self):
- ## Initialize form
+ # ## Initialize form
self.dpi_entry.set_value(96)
self.image_type.set_value('black')
self.mask_bw_entry.set_value(250)
diff --git a/flatcamTools/ToolMeasurement.py b/flatcamTools/ToolMeasurement.py
index e2b759f8..7cd0ceb7 100644
--- a/flatcamTools/ToolMeasurement.py
+++ b/flatcamTools/ToolMeasurement.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from FlatCAMObj import *
@@ -32,11 +32,11 @@ class Measurement(FlatCAMTool):
self.canvas = self.app.plotcanvas
self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
- ## Title
+ # ## Title
title_label = QtWidgets.QLabel("%s
" % self.toolName)
self.layout.addWidget(title_label)
- ## Form Layout
+ # ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout)
diff --git a/flatcamTools/ToolMove.py b/flatcamTools/ToolMove.py
index 1d0d430c..6c49afcd 100644
--- a/flatcamTools/ToolMove.py
+++ b/flatcamTools/ToolMove.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from FlatCAMObj import *
diff --git a/flatcamTools/ToolNonCopperClear.py b/flatcamTools/ToolNonCopperClear.py
index a29bc229..fb0f703f 100644
--- a/flatcamTools/ToolNonCopperClear.py
+++ b/flatcamTools/ToolNonCopperClear.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Modified by: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from copy import copy,deepcopy
@@ -38,7 +38,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.tools_box.setContentsMargins(0, 0, 0, 0)
self.tools_frame.setLayout(self.tools_box)
- ## Title
+ # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@@ -49,11 +49,11 @@ class NonCopperClear(FlatCAMTool, Gerber):
""")
self.tools_box.addWidget(title_label)
- ## Form Layout
+ # ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.tools_box.addLayout(form_layout)
- ## Object
+ # ## Object
self.object_combo = QtWidgets.QComboBox()
self.object_combo.setModel(self.app.collection)
self.object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
@@ -68,7 +68,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
form_layout.addRow(self.object_label, self.object_combo)
form_layout.addRow(e_lab_0)
- #### Tools ####
+ #### Tools ## ##
self.tools_table_label = QtWidgets.QLabel('%s' % _('Tools Table'))
self.tools_table_label.setToolTip(
_("Tools pool from which the algorithm\n"
@@ -113,7 +113,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.empty_label = QtWidgets.QLabel('')
self.tools_box.addWidget(self.empty_label)
- #### Add a new Tool ####
+ #### Add a new Tool ## ##
hlay = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(hlay)
@@ -420,7 +420,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.tools_table.setItem(row_no, 1, dia) # Diameter
self.tools_table.setCellWidget(row_no, 2, tool_type_item)
- ### REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY ###
+ # ## REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY # ##
self.tools_table.setItem(row_no, 3, tool_uid_item) # Tool unique ID
# make the diameter column editable
diff --git a/flatcamTools/ToolPDF.py b/flatcamTools/ToolPDF.py
index a4cc5b8c..decef799 100644
--- a/flatcamTools/ToolPDF.py
+++ b/flatcamTools/ToolPDF.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 4/23/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from shapely.geometry import Point, Polygon, LineString
@@ -1242,9 +1242,9 @@ class ToolPDF(FlatCAMTool):
new_el['follow'] = pdf_geo.exterior
apertures_dict[str(aperture)]['geometry'].append(deepcopy(new_el))
- # ###############################################
+ # ############################################# ##
# store the found geometry for filling the path #
- # ###############################################
+ # ############################################# ##
# in case that a color change to white (transparent) occurred
if flag_clear_geo is True:
diff --git a/flatcamTools/ToolPaint.py b/flatcamTools/ToolPaint.py
index 381a03d8..e30ac0d6 100644
--- a/flatcamTools/ToolPaint.py
+++ b/flatcamTools/ToolPaint.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Modified: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from copy import copy,deepcopy
@@ -29,7 +29,7 @@ class ToolPaint(FlatCAMTool, Gerber):
FlatCAMTool.__init__(self, app)
Geometry.__init__(self, geo_steps_per_circle=self.app.defaults["geometry_circle_steps"])
- ## Title
+ # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@@ -47,11 +47,11 @@ class ToolPaint(FlatCAMTool, Gerber):
self.tools_box.setContentsMargins(0, 0, 0, 0)
self.tools_frame.setLayout(self.tools_box)
- ## Form Layout
+ # ## Form Layout
form_layout = QtWidgets.QFormLayout()
self.tools_box.addLayout(form_layout)
- ## Object
+ # ## Object
self.object_combo = QtWidgets.QComboBox()
self.object_combo.setModel(self.app.collection)
self.object_combo.setRootModelIndex(self.app.collection.index(2, 0, QtCore.QModelIndex()))
@@ -65,7 +65,7 @@ class ToolPaint(FlatCAMTool, Gerber):
form_layout.addRow(self.object_label, self.object_combo)
form_layout.addRow(e_lab_0)
- #### Tools ####
+ #### Tools ## ##
self.tools_table_label = QtWidgets.QLabel('%s' % _('Tools Table'))
self.tools_table_label.setToolTip(
_("Tools pool from which the algorithm\n"
@@ -110,7 +110,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.empty_label = QtWidgets.QLabel('')
self.tools_box.addWidget(self.empty_label)
- #### Add a new Tool ####
+ #### Add a new Tool ## ##
hlay = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(hlay)
@@ -305,7 +305,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.tool_type_item_options = ["C1", "C2", "C3", "C4", "B", "V"]
- ## Signals
+ # ## Signals
self.addtool_btn.clicked.connect(self.on_tool_add)
self.addtool_entry.returnPressed.connect(self.on_tool_add)
# self.copytool_btn.clicked.connect(lambda: self.on_tool_copy())
@@ -365,7 +365,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.tools_frame.show()
self.reset_fields()
- ## Init the GUI interface
+ # ## Init the GUI interface
self.paintmargin_entry.set_value(self.default_data["paintmargin"])
self.paintmethod_combo.set_value(self.default_data["paintmethod"])
self.selectmethod_combo.set_value(self.default_data["selectmethod"])
@@ -484,7 +484,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.tools_table.setItem(row_no, 1, dia) # Diameter
self.tools_table.setCellWidget(row_no, 2, tool_type_item)
- ### REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY ###
+ # ## REMEMBER: THIS COLUMN IS HIDDEN IN OBJECTUI.PY # ##
self.tools_table.setItem(row_no, 3, tool_uid_item) # Tool unique ID
# make the diameter column editable
@@ -1035,13 +1035,13 @@ class ToolPaint(FlatCAMTool, Gerber):
if reset:
self.flat_geometry = []
- ## If iterable, expand recursively.
+ # ## If iterable, expand recursively.
try:
for geo in geometry:
if geo is not None:
recurse(geometry=geo, reset=False)
- ## Not iterable, do the actual indexing and add.
+ # ## Not iterable, do the actual indexing and add.
except TypeError:
self.flat_geometry.append(geometry)
diff --git a/flatcamTools/ToolPanelize.py b/flatcamTools/ToolPanelize.py
index ed3c0e8f..b3af88a0 100644
--- a/flatcamTools/ToolPanelize.py
+++ b/flatcamTools/ToolPanelize.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from copy import copy, deepcopy
@@ -28,7 +28,7 @@ class Panelize(FlatCAMTool):
super(Panelize, self).__init__(self)
self.app = app
- ## Title
+ # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
diff --git a/flatcamTools/ToolPcbWizard.py b/flatcamTools/ToolPcbWizard.py
index e4338b4d..e1eccdb7 100644
--- a/flatcamTools/ToolPcbWizard.py
+++ b/flatcamTools/ToolPcbWizard.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 4/15/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
@@ -152,7 +152,7 @@ class PcbWizard(FlatCAMTool):
self.modified_excellon_file = ''
- ## Signals
+ # ## Signals
self.excellon_brn.clicked.connect(self.on_load_excellon_click)
self.inf_btn.clicked.connect(self.on_load_inf_click)
self.import_button.clicked.connect(lambda: self.on_import_excellon(
@@ -207,7 +207,7 @@ class PcbWizard(FlatCAMTool):
self.exc_file_content = None
self.tools_from_inf = {}
- ## Initialize form
+ # ## Initialize form
self.int_entry.set_value(self.integral)
self.frac_entry.set_value(self.fractional)
self.zeros_radio.set_value(self.zeros)
diff --git a/flatcamTools/ToolProperties.py b/flatcamTools/ToolProperties.py
index 6b2ac1a8..175d9097 100644
--- a/flatcamTools/ToolProperties.py
+++ b/flatcamTools/ToolProperties.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt
@@ -37,7 +37,7 @@ class Properties(FlatCAMTool):
self.properties_box.setContentsMargins(0, 0, 0, 0)
self.properties_frame.setLayout(self.properties_box)
- ## Title
+ # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
diff --git a/flatcamTools/ToolShell.py b/flatcamTools/ToolShell.py
index 7032ab81..ac5ed996 100644
--- a/flatcamTools/ToolShell.py
+++ b/flatcamTools/ToolShell.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 #
# MIT Licence #
-############################################################
+# ########################################################## ##
# from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import Qt
diff --git a/flatcamTools/ToolSolderPaste.py b/flatcamTools/ToolSolderPaste.py
index 61600239..11c6556d 100644
--- a/flatcamTools/ToolSolderPaste.py
+++ b/flatcamTools/ToolSolderPaste.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from FlatCAMCommon import LoudDict
@@ -39,7 +39,7 @@ class SolderPaste(FlatCAMTool):
def __init__(self, app):
FlatCAMTool.__init__(self, app)
- ## Title
+ # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@@ -50,11 +50,11 @@ class SolderPaste(FlatCAMTool):
""")
self.layout.addWidget(title_label)
- ## Form Layout
+ # ## Form Layout
obj_form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(obj_form_layout)
- ## Gerber Object to be used for solderpaste dispensing
+ # ## Gerber Object to be used for solderpaste dispensing
self.obj_combo = FCComboBox(callback=self.on_rmb_combo)
self.obj_combo.setModel(self.app.collection)
self.obj_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
@@ -66,7 +66,7 @@ class SolderPaste(FlatCAMTool):
)
obj_form_layout.addRow(self.object_label, self.obj_combo)
- #### Tools ####
+ #### Tools ## ##
self.tools_table_label = QtWidgets.QLabel('%s' % _('Tools Table'))
self.tools_table_label.setToolTip(
_("Tools pool from which the algorithm\n"
@@ -94,7 +94,7 @@ class SolderPaste(FlatCAMTool):
_( "Nozzle tool Diameter. It's value (in current FlatCAM units)\n"
"is the width of the solder paste dispensed."))
- #### Add a new Tool ####
+ #### Add a new Tool ## ##
hlay_tools = QtWidgets.QHBoxLayout()
self.layout.addLayout(hlay_tools)
@@ -135,7 +135,7 @@ class SolderPaste(FlatCAMTool):
self.layout.addSpacing(10)
- ## Buttons
+ # ## Buttons
grid0_1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0_1)
@@ -157,7 +157,7 @@ class SolderPaste(FlatCAMTool):
self.gcode_box.setContentsMargins(0, 0, 0, 0)
self.gcode_frame.setLayout(self.gcode_box)
- ## Form Layout
+ # ## Form Layout
self.gcode_form_layout = QtWidgets.QFormLayout()
self.gcode_box.addLayout(self.gcode_form_layout)
@@ -283,7 +283,7 @@ class SolderPaste(FlatCAMTool):
self.pp_combo.setStyleSheet('background-color: rgb(255,255,255)')
self.gcode_form_layout.addRow(pp_label, self.pp_combo)
- ## Buttons
+ # ## Buttons
grid1 = QtWidgets.QGridLayout()
self.gcode_box.addLayout(grid1)
@@ -301,7 +301,7 @@ class SolderPaste(FlatCAMTool):
self.generation_frame.setLayout(self.generation_box)
- ## Buttons
+ # ## Buttons
grid2 = QtWidgets.QGridLayout()
self.generation_box.addLayout(grid2)
@@ -313,11 +313,11 @@ class SolderPaste(FlatCAMTool):
grid2.addWidget(step2_lbl, 0, 0)
grid2.addWidget(self.soldergeo_btn, 0, 2)
- ## Form Layout
+ # ## Form Layout
geo_form_layout = QtWidgets.QFormLayout()
self.generation_box.addLayout(geo_form_layout)
- ## Geometry Object to be used for solderpaste dispensing
+ # ## Geometry Object to be used for solderpaste dispensing
self.geo_obj_combo = FCComboBox(callback=self.on_rmb_combo)
self.geo_obj_combo.setModel(self.app.collection)
self.geo_obj_combo.setRootModelIndex(self.app.collection.index(2, 0, QtCore.QModelIndex()))
@@ -346,11 +346,11 @@ class SolderPaste(FlatCAMTool):
grid3.addWidget(step3_lbl, 0, 0)
grid3.addWidget(self.solder_gcode_btn, 0, 2)
- ## Form Layout
+ # ## Form Layout
cnc_form_layout = QtWidgets.QFormLayout()
self.generation_box.addLayout(cnc_form_layout)
- ## Gerber Object to be used for solderpaste dispensing
+ # ## Gerber Object to be used for solderpaste dispensing
self.cnc_obj_combo = FCComboBox(callback=self.on_rmb_combo)
self.cnc_obj_combo.setModel(self.app.collection)
self.cnc_obj_combo.setRootModelIndex(self.app.collection.index(3, 0, QtCore.QModelIndex()))
@@ -412,7 +412,7 @@ class SolderPaste(FlatCAMTool):
# action to be added in the combobox context menu
self.combo_context_del_action = QtWidgets.QAction(QtGui.QIcon('share/trash16.png'), _("Delete Object"))
- ## Signals
+ # ## Signals
self.combo_context_del_action.triggered.connect(self.on_delete_object)
self.addtool_btn.clicked.connect(self.on_tool_add)
self.addtool_entry.returnPressed.connect(self.on_tool_add)
@@ -995,7 +995,7 @@ class SolderPaste(FlatCAMTool):
if reset:
self.flat_geometry = []
- ## If iterable, expand recursively.
+ # ## If iterable, expand recursively.
try:
for geo in geometry:
if geo is not None:
@@ -1003,7 +1003,7 @@ class SolderPaste(FlatCAMTool):
reset=False,
pathonly=pathonly)
- ## Not iterable, do the actual indexing and add.
+ # ## Not iterable, do the actual indexing and add.
except TypeError:
if pathonly and type(geometry) == Polygon:
self.flat_geometry.append(geometry.exterior)
@@ -1226,7 +1226,7 @@ class SolderPaste(FlatCAMTool):
job_obj.options["tooldia"] = tool_dia
job_obj.options['tool_dia'] = tool_dia
- ### CREATE GCODE ###
+ # ## CREATE GCODE # ##
res = job_obj.generate_gcode_from_solderpaste_geo(**tooluid_value)
if res == 'fail':
@@ -1235,7 +1235,7 @@ class SolderPaste(FlatCAMTool):
else:
tool_cnc_dict['gcode'] = res
- ### PARSE GCODE ###
+ # ## PARSE GCODE # ##
tool_cnc_dict['gcode_parsed'] = job_obj.gcode_parse()
# TODO this serve for bounding box creation only; should be optimized
@@ -1380,7 +1380,7 @@ class SolderPaste(FlatCAMTool):
gcode += obj.cnc_tools[tool]['gcode']
lines = StringIO(gcode)
- ## Write
+ # ## Write
if filename is not None:
try:
with open(filename, 'w') as f:
diff --git a/flatcamTools/ToolSub.py b/flatcamTools/ToolSub.py
index 5d8a40a2..aa5159b2 100644
--- a/flatcamTools/ToolSub.py
+++ b/flatcamTools/ToolSub.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 4/24/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
diff --git a/flatcamTools/ToolTransform.py b/flatcamTools/ToolTransform.py
index 392d6387..0e9a9b8b 100644
--- a/flatcamTools/ToolTransform.py
+++ b/flatcamTools/ToolTransform.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMTool import FlatCAMTool
from FlatCAMObj import *
@@ -32,7 +32,7 @@ class ToolTransform(FlatCAMTool):
self.transform_lay = QtWidgets.QVBoxLayout()
self.layout.addLayout(self.transform_lay)
- ## Title
+ # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet("""
QLabel
@@ -56,11 +56,11 @@ class ToolTransform(FlatCAMTool):
self.empty_label4.setFixedWidth(70)
self.transform_lay.addWidget(self.empty_label)
- ## Rotate Title
+ # ## Rotate Title
rotate_title_label = QtWidgets.QLabel("%s" % self.rotateName)
self.transform_lay.addWidget(rotate_title_label)
- ## Layout
+ # ## Layout
form_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form_layout)
form_child = QtWidgets.QHBoxLayout()
@@ -94,11 +94,11 @@ class ToolTransform(FlatCAMTool):
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)
- ## Form Layout
+ # ## Form Layout
form1_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form1_layout)
form1_child_1 = QtWidgets.QHBoxLayout()
@@ -151,11 +151,11 @@ class ToolTransform(FlatCAMTool):
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
+ # ## Form Layout
form2_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form2_layout)
form2_child_1 = QtWidgets.QHBoxLayout()
@@ -225,11 +225,11 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addWidget(self.empty_label3)
- ## Offset Title
+ # ## Offset Title
offset_title_label = QtWidgets.QLabel("%s" % self.offsetName)
self.transform_lay.addWidget(offset_title_label)
- ## Form Layout
+ # ## Form Layout
form3_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form3_layout)
form3_child_1 = QtWidgets.QHBoxLayout()
@@ -280,11 +280,11 @@ class ToolTransform(FlatCAMTool):
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)
- ## Form Layout
+ # ## Form Layout
form4_layout = QtWidgets.QFormLayout()
form4_child_hlay = QtWidgets.QHBoxLayout()
self.transform_lay.addLayout(form4_child_hlay)
@@ -355,7 +355,7 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addStretch()
- ## Signals
+ # ## Signals
self.rotate_button.clicked.connect(self.on_rotate)
self.skewx_button.clicked.connect(self.on_skewx)
self.skewy_button.clicked.connect(self.on_skewy)
@@ -401,7 +401,7 @@ class ToolTransform(FlatCAMTool):
FlatCAMTool.install(self, icon, separator, shortcut='ALT+R', **kwargs)
def set_tool_ui(self):
- ## Initialize form
+ # ## Initialize form
if self.app.defaults["tools_transform_rotate"]:
self.rotate_entry.set_value(self.app.defaults["tools_transform_rotate"])
else:
diff --git a/make_win.py b/make_win.py
index e029d2f6..6b9029d3 100644
--- a/make_win.py
+++ b/make_win.py
@@ -1,4 +1,4 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Juan Pablo Caram (c) #
@@ -11,12 +11,12 @@
# This is not an aid to install FlatCAM from source on #
# Windows platforms. It is only useful when FlatCAM is up #
# and running and ready to be packaged. #
-############################################################
+# ########################################################## ##
-############################################################
+# ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 #
-############################################################
+# ########################################################## ##
# Files not needed: Qt, tk.dll, tcl.dll, tk/, tcl/, vtk/,
diff --git a/postprocessors/Paste_1.py b/postprocessors/Paste_1.py
index 79587265..c397bddd 100644
--- a/postprocessors/Paste_1.py
+++ b/postprocessors/Paste_1.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/Repetier.py b/postprocessors/Repetier.py
index 74add556..3308598e 100644
--- a/postprocessors/Repetier.py
+++ b/postprocessors/Repetier.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/Roland_MDX_20.py b/postprocessors/Roland_MDX_20.py
index 3a451042..de1e872f 100644
--- a/postprocessors/Roland_MDX_20.py
+++ b/postprocessors/Roland_MDX_20.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/Toolchange_Custom.py b/postprocessors/Toolchange_Custom.py
index abdbf899..c98ef5fe 100644
--- a/postprocessors/Toolchange_Custom.py
+++ b/postprocessors/Toolchange_Custom.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/Toolchange_Probe_MACH3.py b/postprocessors/Toolchange_Probe_MACH3.py
index 60f42926..0df3cc66 100644
--- a/postprocessors/Toolchange_Probe_MACH3.py
+++ b/postprocessors/Toolchange_Probe_MACH3.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/Toolchange_manual.py b/postprocessors/Toolchange_manual.py
index 148fc2c7..d4fe3c08 100644
--- a/postprocessors/Toolchange_manual.py
+++ b/postprocessors/Toolchange_manual.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/default.py b/postprocessors/default.py
index d9e6a241..0b1e8db2 100644
--- a/postprocessors/default.py
+++ b/postprocessors/default.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Matthieu Berthomé #
# Date: 5/26/2017 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/grbl_11.py b/postprocessors/grbl_11.py
index cae2f39a..efa44c90 100644
--- a/postprocessors/grbl_11.py
+++ b/postprocessors/grbl_11.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Matthieu Berthomé #
# Date: 5/26/2017 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/grbl_laser.py b/postprocessors/grbl_laser.py
index 66285191..5065942f 100644
--- a/postprocessors/grbl_laser.py
+++ b/postprocessors/grbl_laser.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Matthieu Berthomé #
# Date: 5/26/2017 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/hpgl.py b/postprocessors/hpgl.py
index 9b4ca374..fde770ac 100644
--- a/postprocessors/hpgl.py
+++ b/postprocessors/hpgl.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/line_xyz.py b/postprocessors/line_xyz.py
index b9c7aebd..52f49179 100644
--- a/postprocessors/line_xyz.py
+++ b/postprocessors/line_xyz.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *
diff --git a/postprocessors/marlin.py b/postprocessors/marlin.py
index d0859faf..129cedd1 100644
--- a/postprocessors/marlin.py
+++ b/postprocessors/marlin.py
@@ -1,10 +1,10 @@
-############################################################
+# ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 #
# MIT Licence #
-############################################################
+# ########################################################## ##
from FlatCAMPostProc import *