- 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
This commit is contained in:
Marius Stanciu 2019-05-30 21:05:12 +03:00
parent ad7222a768
commit 8ee516ec14
55 changed files with 695 additions and 684 deletions

View File

@ -1,10 +1,10 @@
# ########################################################### # ######################################################### ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
# ########################################################### # ######################################################### ##
import urllib.request, urllib.parse, urllib.error import urllib.request, urllib.parse, urllib.error
import getopt import getopt
@ -25,9 +25,9 @@ import gc
from xml.dom.minidom import parseString as parse_xml_string from xml.dom.minidom import parseString as parse_xml_string
# ####################################### # ##################################### ##
# # Imports part of FlatCAM ## # # Imports part of FlatCAM # ##
# ####################################### # ##################################### ##
from ObjectCollection import * from ObjectCollection import *
from FlatCAMObj import * from FlatCAMObj import *
from flatcamGUI.PlotCanvas import * from flatcamGUI.PlotCanvas import *
@ -58,9 +58,9 @@ fcTranslate.apply_language('strings')
if '_' not in builtins.__dict__: if '_' not in builtins.__dict__:
_ = gettext.gettext _ = gettext.gettext
# ####################################### # ##################################### ##
# # App ## # # App # ##
# ####################################### # ##################################### ##
class App(QtCore.QObject): class App(QtCore.QObject):
@ -84,7 +84,7 @@ class App(QtCore.QObject):
elif opt == '--shellfile': elif opt == '--shellfile':
cmd_line_shellfile = arg cmd_line_shellfile = arg
# Logging ## # Logging # ##
log = logging.getLogger('base') log = logging.getLogger('base')
log.setLevel(logging.DEBUG) log.setLevel(logging.DEBUG)
# log.setLevel(logging.WARNING) # log.setLevel(logging.WARNING)
@ -94,8 +94,8 @@ class App(QtCore.QObject):
log.addHandler(handler) log.addHandler(handler)
# Version # Version
version = 8.917 version = 8.918
version_date = "2019/05/22" version_date = "2019/06/11"
beta = True beta = True
# current date now # current date now
@ -120,9 +120,9 @@ class App(QtCore.QObject):
# flag is True if saving action has been triggered # flag is True if saving action has been triggered
save_in_progress = False save_in_progress = False
# ################# # ############### ##
# # Signals ## # # Signals # ##
# ################# # ############### ##
# Inform the user # Inform the user
# Handled by: # Handled by:
@ -191,9 +191,9 @@ class App(QtCore.QObject):
self.main_thread = QtWidgets.QApplication.instance().thread() self.main_thread = QtWidgets.QApplication.instance().thread()
# ################## # ################ ##
# ## OS-specific ### # # ## OS-specific # ##
# ################## # ################ ##
# Folder for user settings. # Folder for user settings.
if sys.platform == 'win32': if sys.platform == 'win32':
@ -209,9 +209,9 @@ class App(QtCore.QObject):
self.data_path = os.path.expanduser('~') + '/.FlatCAM' self.data_path = os.path.expanduser('~') + '/.FlatCAM'
self.os = 'unix' self.os = 'unix'
# ############################## # ############################ ##
# ## Setup folders and files ### # # ## Setup folders and files # ##
# ############################## # ############################ ##
if not os.path.exists(self.data_path): if not os.path.exists(self.data_path):
os.makedirs(self.data_path) os.makedirs(self.data_path)
@ -272,9 +272,9 @@ class App(QtCore.QObject):
# variable to store mouse coordinates # variable to store mouse coordinates
self.mouse = [0, 0] self.mouse = [0, 0]
# ################### # ################# ##
# # Initialize GUI ## # # Initialize GUI # ##
# ################### # ################# ##
# FlatCAM colors used in plotting # FlatCAM colors used in plotting
self.FC_light_green = '#BBF268BF' 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.geom_update[int, int, int, int, int].connect(self.save_geometry)
self.ui.final_save.connect(self.final_save) self.ui.final_save.connect(self.final_save)
# ############# # ########### ##
# ### Data #### # # ## Data ## ##
# ############# # ########### ##
self.recent = [] self.recent = []
self.clipboard = QtWidgets.QApplication.clipboard() self.clipboard = QtWidgets.QApplication.clipboard()
self.proc_container = FCVisibleProcessContainer(self.ui.activity_view) 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) 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) self.ui.excellon_defaults_form.excellon_opt_group.pp_excellon_name_cb.addItem(name)
# ############################ # ########################## ##
# ### LOAD LANGUAGES #### # # ## LOAD LANGUAGES ## ##
# ############################ # ########################## ##
self.languages = fcTranslate.load_languages() self.languages = fcTranslate.load_languages()
for name in sorted(self.languages.values()): for name in sorted(self.languages.values()):
@ -880,16 +880,16 @@ class App(QtCore.QObject):
"tools_solderpaste_pp": 'Paste_1' "tools_solderpaste_pp": 'Paste_1'
}) })
# ############################## # ############################ ##
# ## Load defaults from file ### # # ## Load defaults from file # ##
# ############################## # ############################ ##
if user_defaults: if user_defaults:
self.load_defaults(filename='current_defaults') self.load_defaults(filename='current_defaults')
# ########################### # ######################### ##
# #### APPLY APP LANGUAGE ### # #### APPLY APP LANGUAGE # ##
# ########################### # ######################### ##
ret_val = fcTranslate.apply_language('strings') 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()) log.debug("App.__init__() --> Applied %s language." % str(ret_val).capitalize())
# ################################## # ################################ ##
# ## CREATE UNIQUE SERIAL NUMBER ### # # ## CREATE UNIQUE SERIAL NUMBER # ##
# ################################## # ################################ ##
chars = 'abcdefghijklmnopqrstuvwxyz0123456789' chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
if self.defaults['global_serial'] == 0 or len(str(self.defaults['global_serial'])) < 10: 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.tools_form = None
self.on_options_combo_change(0) # Will show the initial form self.on_options_combo_change(0) # Will show the initial form
# ## Define OBJECT COLLECTION ### # # ## Define OBJECT COLLECTION # ##
self.collection = ObjectCollection(self) self.collection = ObjectCollection(self)
self.ui.project_tab_layout.addWidget(self.collection.view) self.ui.project_tab_layout.addWidget(self.collection.view)
# ## # # ##
self.log.debug("Finished creating Object Collection.") 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 # 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_entry.set_value(self.defaults['global_plot_fill'])
self.ui.general_defaults_form.general_gui_group.pf_color_button.setStyleSheet( 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.defaults['global_proj_item_dis_color'])
self.ui.general_defaults_form.general_gui_group.proj_color_dis_button.setStyleSheet( 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]) "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 start_plot_time = time.time() # debug
self.plotcanvas = PlotCanvas(self.ui.right_layout, self) self.plotcanvas = PlotCanvas(self.ui.right_layout, self)
@ -1270,27 +1270,27 @@ class App(QtCore.QObject):
end_plot_time = time.time() end_plot_time = time.time()
self.log.debug("Finished Canvas initialization in %s seconds." % (str(end_plot_time - start_plot_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.geo_editor = FlatCAMGeoEditor(self, disabled=True)
self.exc_editor = FlatCAMExcEditor(self) self.exc_editor = FlatCAMExcEditor(self)
self.grb_editor = FlatCAMGrbEditor(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.collection.view.setMinimumWidth(self.ui.options_scroll_area.widget().sizeHint().width() +
# self.ui.options_scroll_area.verticalScrollBar().sizeHint().width()) # self.ui.options_scroll_area.verticalScrollBar().sizeHint().width())
self.collection.view.setMinimumWidth(290) self.collection.view.setMinimumWidth(290)
self.log.debug("Finished adding FlatCAM Editor's.") self.log.debug("Finished adding FlatCAM Editor's.")
# ### Worker #### # # ## Worker ## ##
if self.defaults["global_worker_number"]: if self.defaults["global_worker_number"]:
self.workers = WorkerStack(workers_number=int(self.defaults["global_worker_number"])) self.workers = WorkerStack(workers_number=int(self.defaults["global_worker_number"]))
else: else:
self.workers = WorkerStack(workers_number=2) self.workers = WorkerStack(workers_number=2)
self.worker_task.connect(self.workers.add_task) self.worker_task.connect(self.workers.add_task)
# ## Signal handling ### # # ## Signal handling # ##
# ## Custom signals # # ## Custom signals
self.inform.connect(self.info) self.inform.connect(self.info)
self.app_quit.connect(self.quit_application) self.app_quit.connect(self.quit_application)
self.message.connect(self.message_dialog) 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_opened.connect(lambda kind, filename: self.register_folder(filename))
self.file_saved.connect(lambda kind, filename: self.register_save_folder(filename)) self.file_saved.connect(lambda kind, filename: self.register_save_folder(filename))
# ## Standard signals # # ## Standard signals
# ## Menu # # ## Menu
self.ui.menufilenewproject.triggered.connect(self.on_file_new_click) self.ui.menufilenewproject.triggered.connect(self.on_file_new_click)
self.ui.menufilenewgeo.triggered.connect(self.new_geometry_object) self.ui.menufilenewgeo.triggered.connect(self.new_geometry_object)
self.ui.menufilenewgrb.triggered.connect(self.new_gerber_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_export_button.clicked.connect(self.on_export_preferences)
self.ui.pref_open_button.clicked.connect(self.on_preferences_open_folder) 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_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( self.ui.general_defaults_form.general_app_group.language_apply_btn.clicked.connect(
lambda: fcTranslate.on_language_apply_click(self, restart=True) 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( self.ui.general_defaults_form.general_app_group.units_radio.activated_custom.connect(
lambda: self.on_toggle_units(no_pref=False)) lambda: self.on_toggle_units(no_pref=False))
# ############################## # ############################ ##
# ## GUI PREFERENCES SIGNALS ### # # ## GUI PREFERENCES SIGNALS # ##
# ############################## # ############################ ##
# Setting plot colors signals # Setting plot colors signals
self.ui.general_defaults_form.general_gui_group.pf_color_entry.editingFinished.connect( self.ui.general_defaults_form.general_gui_group.pf_color_entry.editingFinished.connect(
@ -1559,20 +1559,20 @@ class App(QtCore.QObject):
else: else:
self.ui.splitter.setSizes([0, 1]) self.ui.splitter.setSizes([0, 1])
# ################### # ################# ##
# ## Other setups ### # # ## Other setups # ##
# ################### # ################# ##
# Sets up FlatCAMObj, FCProcess and FCProcessContainer. # Sets up FlatCAMObj, FCProcess and FCProcessContainer.
self.setup_obj_classes() self.setup_obj_classes()
self.setup_recent_items() self.setup_recent_items()
self.setup_component_editor() self.setup_component_editor()
# ############ # ########## ##
# ## Shell ### # # ## Shell # ##
# ############ # ########## ##
# ## # # ##
# Auto-complete KEYWORDS # Auto-complete KEYWORDS
self.tcl_commands_list = ['add_circle', 'add_poly', 'add_polygon', 'add_polyline', 'add_rectangle', self.tcl_commands_list = ['add_circle', 'add_poly', 'add_polygon', 'add_polyline', 'add_rectangle',
'aligndrill', 'clear', 'aligndrill', 'clear',
@ -1809,9 +1809,9 @@ class App(QtCore.QObject):
else: else:
self.ui.shell_dock.hide() self.ui.shell_dock.hide()
# ######################## # ###################### ##
# ## Tools and Plugins ### # # ## Tools and Plugins # ##
# ######################## # ###################### ##
self.dblsidedtool = None self.dblsidedtool = None
self.measurement_tool = 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 # always install tools only after the shell is initialized because the self.inform.emit() depends on shell
self.install_tools() self.install_tools()
# ## System Font Parsing ### # # ## System Font Parsing # ##
# self.f_parse = ParseFont(self) # self.f_parse = ParseFont(self)
# self.parse_system_fonts() # self.parse_system_fonts()
@ -1847,9 +1847,9 @@ class App(QtCore.QObject):
print("ERROR: ", ext) print("ERROR: ", ext)
sys.exit(2) sys.exit(2)
# ########################## # ######################## ##
# ### Check for updates #### # # ## Check for updates ## ##
# ########################## # ######################## ##
# Separate thread (Not worker) # Separate thread (Not worker)
# Check for updates on startup but only if the user consent and the app is not in Beta version # 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': []}) 'params': []})
self.thr2.start(QtCore.QThread.LowPriority) self.thr2.start(QtCore.QThread.LowPriority)
# ################################### # ################################# ##
# ### Variables for global usage #### # # ## Variables for global usage ## ##
# ################################### # ################################# ##
# coordinates for relative position display # coordinates for relative position display
self.rel_point1 = (0, 0) self.rel_point1 = (0, 0)
@ -1936,8 +1936,8 @@ class App(QtCore.QObject):
self.isHovering = False self.isHovering = False
self.notHovering = True self.notHovering = True
# ## Save defaults to factory_defaults.FlatConfig file ### # # ## Save defaults to factory_defaults.FlatConfig file # ##
# ## It's done only once after install ############# # # ## It's done only once after install ########### ##
factory_file = open(self.data_path + '/factory_defaults.FlatConfig') factory_file = open(self.data_path + '/factory_defaults.FlatConfig')
fac_def_from_file = factory_file.read() fac_def_from_file = factory_file.read()
factory_defaults = json.loads(fac_def_from_file) factory_defaults = json.loads(fac_def_from_file)
@ -2754,6 +2754,10 @@ class App(QtCore.QObject):
defaults_file_content = None 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 (*.*)" filter = "Config File (*.FlatConfig);;All Files (*.*)"
try: try:
filename, _f = QtWidgets.QFileDialog.getSaveFileName( filename, _f = QtWidgets.QFileDialog.getSaveFileName(
@ -2894,7 +2898,7 @@ class App(QtCore.QObject):
t0 = time.time() # Debug t0 = time.time() # Debug
## Create object # ## Create object
classdict = { classdict = {
"gerber": FlatCAMGerber, "gerber": FlatCAMGerber,
"excellon": FlatCAMExcellon, "excellon": FlatCAMExcellon,
@ -4229,7 +4233,7 @@ class App(QtCore.QObject):
pass pass
if current_layout == 'standard': if current_layout == 'standard':
### TOOLBAR INSTALLATION ### # ## TOOLBAR INSTALLATION # ##
self.ui.toolbarfile = QtWidgets.QToolBar('File Toolbar') self.ui.toolbarfile = QtWidgets.QToolBar('File Toolbar')
self.ui.toolbarfile.setObjectName('File_TB') self.ui.toolbarfile.setObjectName('File_TB')
self.ui.addToolBar(self.ui.toolbarfile) self.ui.addToolBar(self.ui.toolbarfile)
@ -4273,7 +4277,7 @@ class App(QtCore.QObject):
self.ui.corner_snap_btn.setVisible(False) self.ui.corner_snap_btn.setVisible(False)
self.ui.snap_magnet.setVisible(False) self.ui.snap_magnet.setVisible(False)
elif current_layout == 'compact': elif current_layout == 'compact':
### TOOLBAR INSTALLATION ### # ## TOOLBAR INSTALLATION # ##
self.ui.toolbarfile = QtWidgets.QToolBar('File Toolbar') self.ui.toolbarfile = QtWidgets.QToolBar('File Toolbar')
self.ui.toolbarfile.setObjectName('File_TB') self.ui.toolbarfile.setObjectName('File_TB')
self.ui.addToolBar(Qt.LeftToolBarArea, self.ui.toolbarfile) self.ui.addToolBar(Qt.LeftToolBarArea, self.ui.toolbarfile)
@ -4379,7 +4383,7 @@ class App(QtCore.QObject):
self.ui.code_editor.setPlainText(self.gcode_edited) self.ui.code_editor.setPlainText(self.gcode_edited)
file.close() file.close()
def handleSaveGCode(self,name=None, filt=None): def handleSaveGCode(self, name=None, filt=None):
self.report_usage("handleSaveGCode()") self.report_usage("handleSaveGCode()")
if filt: if filt:
@ -4469,7 +4473,7 @@ class App(QtCore.QObject):
cursor.endEditBlock() cursor.endEditBlock()
def on_tool_add_keypress(self): 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() self.units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
notebook_widget_name = self.ui.notebook.currentWidget().objectName() 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()) self.ui.grid_gap_y_entry.setText(self.sender().text())
def on_grid_add(self): 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() units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
grid_add_popup = FCInputDialog(title=_("New Grid ..."), grid_add_popup = FCInputDialog(title=_("New Grid ..."),
@ -5245,7 +5249,7 @@ class App(QtCore.QObject):
_("[WARNING_NOTCL] Adding New Grid cancelled ...")) _("[WARNING_NOTCL] Adding New Grid cancelled ..."))
def on_grid_delete(self): 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() units = self.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
grid_del_popup = FCInputDialog(title="Delete Grid ...", grid_del_popup = FCInputDialog(title="Delete Grid ...",
@ -5843,7 +5847,7 @@ class App(QtCore.QObject):
if self.call_source != 'app': if self.call_source != 'app':
self.editor2object(cleanup=True) self.editor2object(cleanup=True)
### EDITOR section # ## EDITOR section
self.geo_editor = FlatCAMGeoEditor(self, disabled=True) self.geo_editor = FlatCAMGeoEditor(self, disabled=True)
self.exc_editor = FlatCAMExcEditor(self) self.exc_editor = FlatCAMExcEditor(self)
self.grb_editor = FlatCAMGrbEditor(self) self.grb_editor = FlatCAMGrbEditor(self)
@ -6114,10 +6118,13 @@ class App(QtCore.QObject):
self.file_saved.emit("SVG", filename) self.file_saved.emit("SVG", filename)
def on_file_exportpng(self): def on_file_exportpng(self):
self.report_usage("on_file_exportpng") self.report_usage("on_file_exportpng")
App.log.debug("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() image = _screenshot()
data = np.asarray(image) data = np.asarray(image)
if not data.ndim == 3 and data.shape[-1] in (3, 4): 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, self.worker_task.emit({'fcn': self.import_dxf,
'params': [filename, type_of_obj]}) '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): def init_code_editor(self, name):
# Signals section # Signals section
@ -6634,6 +6641,10 @@ class App(QtCore.QObject):
self.report_usage("on_file_saveprojectas") 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 (*.*)" filter_ = "FlatCAM Project (*.FlatPrj);; All Files (*.*)"
try: try:
filename, _f = QtWidgets.QFileDialog.getSaveFileName( filename, _f = QtWidgets.QFileDialog.getSaveFileName(
@ -7481,7 +7492,7 @@ class App(QtCore.QObject):
# Object name # Object name
name = outname or filename.split('/')[-1].split('\\')[-1] name = outname or filename.split('/')[-1].split('\\')[-1]
# ## Object creation ### # # ## Object creation # ##
ret = self.new_object("gerber", name, obj_init, autoselected=False) ret = self.new_object("gerber", name, obj_init, autoselected=False)
if ret == 'fail': if ret == 'fail':
self.inform.emit(_('[ERROR_NOTCL] Open Gerber failed. Probable not a Gerber file.')) 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) self.file_opened.emit("project", filename)
# Clear the current project # Clear the current project
# # NOT THREAD SAFE ## # # NOT THREAD SAFE # ##
if run_from_arg is True: if run_from_arg is True:
pass pass
else: else:
@ -7896,7 +7907,7 @@ class App(QtCore.QObject):
if timeout is not None: if timeout is not None:
QtCore.QTimer.singleShot(timeout, report_quit) QtCore.QTimer.singleShot(timeout, report_quit)
# ### Block #### # # ## Block ## ##
loop.exec_() loop.exec_()
# Restore exception management # Restore exception management
@ -8201,7 +8212,7 @@ The normal flow when working in FlatCAM is the following:</span></p>
"&" + urllib.parse.urlencode(no_ststs_dict["global_ststs"]) "&" + urllib.parse.urlencode(no_ststs_dict["global_ststs"])
App.log.debug("Checking for updates @ %s" % full_url) App.log.debug("Checking for updates @ %s" % full_url)
### Get the data # ## Get the data
try: try:
f = urllib.request.urlopen(full_url) f = urllib.request.urlopen(full_url)
except: except:
@ -8221,7 +8232,7 @@ The normal flow when working in FlatCAM is the following:</span></p>
f.close() f.close()
### Latest version? # ## Latest version?
if self.version >= data["version"]: if self.version >= data["version"]:
App.log.debug("FlatCAM is up to date!") App.log.debug("FlatCAM is up to date!")
self.inform.emit(_("[success] 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:</span></p>
self.save_in_progress = True self.save_in_progress = True
with self.proc_container.new(_("Saving FlatCAM Project")) as proc: with self.proc_container.new(_("Saving FlatCAM Project")) as proc:
## Capture the latest changes # Capture the latest changes
# Current object # Current object
try: try:
self.collection.get_active().read_form() self.collection.get_active().read_form()

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
class LoudDict(dict): class LoudDict(dict):

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
import copy import copy
import inspect # TODO: For debugging only. import inspect # TODO: For debugging only.
@ -35,9 +35,9 @@ class ValidationError(Exception):
self.errors = errors self.errors = errors
# ####################################### # ##################################### ##
# # FlatCAMObj ## # # FlatCAMObj # ##
# ####################################### # ##################################### ##
class FlatCAMObj(QtCore.QObject): class FlatCAMObj(QtCore.QObject):
@ -2342,7 +2342,7 @@ class FlatCAMExcellon(FlatCAMObj, Excellon):
"Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj) "Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
app_obj.progress.emit(20) 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 # get the tool_table items in a list of row items
tool_table_items = self.get_selected_tools_table_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) "Initializer expected a FlatCAMGeometry, got %s" % type(geo_obj)
app_obj.progress.emit(20) 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 # get the tool_table items in a list of row items
tool_table_items = self.get_selected_tools_table_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 # insert an information only element in the front
tool_table_items.insert(0, [_("Tool_nr"), _("Diameter"), _("Drills_Nr"), _("Slots_Nr")]) 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' job_obj.origin_kind = 'excellon'
@ -2932,18 +2932,18 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
""" """
pts = [] pts = []
## Iterable: descend into each item. # Iterable: descend into each item.
try: try:
for subo in o: for subo in o:
pts += FlatCAMGeometry.get_pts(subo) pts += FlatCAMGeometry.get_pts(subo)
## Non-iterable # Non-iterable
except TypeError: except TypeError:
if o is not None: if o is not None:
if type(o) == MultiPolygon: if type(o) == MultiPolygon:
for poly in o: for poly in o:
pts += FlatCAMGeometry.get_pts(poly) pts += FlatCAMGeometry.get_pts(poly)
## Descend into .exerior and .interiors # ## Descend into .exerior and .interiors
elif type(o) == Polygon: elif type(o) == Polygon:
pts += FlatCAMGeometry.get_pts(o.exterior) pts += FlatCAMGeometry.get_pts(o.exterior)
for i in o.interiors: for i in o.interiors:
@ -2951,7 +2951,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
elif type(o) == MultiLineString: elif type(o) == MultiLineString:
for line in o: for line in o:
pts += FlatCAMGeometry.get_pts(line) pts += FlatCAMGeometry.get_pts(line)
## Has .coords: list them. # ## Has .coords: list them.
else: else:
pts += list(o.coords) pts += list(o.coords)
else: 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. # engine of FlatCAM. Most likely are generated by some of tools and are special cases of geometries.
self. special_group = None self. special_group = None
self.old_pp_state = ''
self.old_toolchangeg_state = ''
# Attributes to be included in serialization # Attributes to be included in serialization
# Always append to it because it carries contents # Always append to it because it carries contents
# from predecessors. # 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, 3, type_item)
self.ui.geo_tools_table.setCellWidget(row_no, 4, tool_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.setItem(row_no, 5, tool_uid_item) # Tool unique ID
self.ui.geo_tools_table.setCellWidget(row_no, 6, plot_item) 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, 3, type_item) # Toolpath Type
self.ui.cnc_tools_table.setItem(row_no, 4, tool_type_item) # Tool 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.setItem(row_no, 5, tool_uid_item) # Tool unique ID)
self.ui.cnc_tools_table.setCellWidget(row_no, 6, plot_item) self.ui.cnc_tools_table.setCellWidget(row_no, 6, plot_item)

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Matthieu Berthomé # # File Author: Matthieu Berthomé #
# Date: 5/26/2017 # # Date: 5/26/2017 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from importlib.machinery import SourceFileLoader from importlib.machinery import SourceFileLoader
import os import os

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from flatcamGUI.FlatCAMGUI import FlatCAMActivityView from flatcamGUI.FlatCAMGUI import FlatCAMActivityView
from PyQt5 import QtCore from PyQt5 import QtCore

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets, QtWidgets from PyQt5 import QtGui, QtCore, QtWidgets, QtWidgets
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
import os import os
import sys import sys

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from PyQt5 import QtCore from PyQt5 import QtCore

View File

@ -1,14 +1,14 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
############################################################ # ########################################################## ##
# File modified by: Dennis Hayrullin # # File modified by: Dennis Hayrullin #
############################################################ # ########################################################## ##
# from PyQt5.QtCore import QModelIndex # from PyQt5.QtCore import QModelIndex
from FlatCAMObj import * from FlatCAMObj import *
@ -210,7 +210,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
QtCore.QAbstractItemModel.__init__(self) QtCore.QAbstractItemModel.__init__(self)
### Icons for the list view # ## Icons for the list view
self.icons = {} self.icons = {}
for kind in ObjectCollection.icon_files: for kind in ObjectCollection.icon_files:
self.icons[kind] = QtGui.QPixmap(ObjectCollection.icon_files[kind]) self.icons[kind] = QtGui.QPixmap(ObjectCollection.icon_files[kind])
@ -230,7 +230,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
# print i.data(0) # print i.data(0)
# i.append_child(TreeItem(["empty"])) # i.append_child(TreeItem(["empty"]))
### Data ### # ## Data # ##
self.checked_indexes = [] self.checked_indexes = []
# Names of objects that are expected to become available. # Names of objects that are expected to become available.
@ -245,7 +245,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
self.app = app self.app = app
### View # ## View
self.view = KeySensitiveListView(app) self.view = KeySensitiveListView(app)
self.view.setModel(self) self.view.setModel(self)
@ -261,7 +261,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
font.setFamily("Seagoe UI") font.setFamily("Seagoe UI")
self.view.setFont(font) self.view.setFont(font)
## GUI Events # ## GUI Events
self.view.selectionModel().selectionChanged.connect(self.on_list_selection_change) self.view.selectionModel().selectionChanged.connect(self.on_list_selection_change)
self.view.activated.connect(self.on_item_activated) self.view.activated.connect(self.on_item_activated)
# self.view.keyPressed.connect(self.on_key) # self.view.keyPressed.connect(self.on_key)
@ -399,11 +399,11 @@ class ObjectCollection(QtCore.QAbstractItemModel):
if index.isValid(): if index.isValid():
obj = index.internalPointer().obj obj = index.internalPointer().obj
if obj: if obj:
old_name = str(obj.options['name']) old_name = obj.options['name']
new_name = str(data) new_name = str(data)
if old_name != new_name and new_name != '': if old_name != new_name and new_name != '':
# rename the object # rename the object
obj.options["name"] = str(data) obj.options["name"] = deepcopy(data)
# update the SHELL auto-completer model data # update the SHELL auto-completer model data
try: try:
@ -411,11 +411,12 @@ class ObjectCollection(QtCore.QAbstractItemModel):
self.app.myKeywords.append(new_name) self.app.myKeywords.append(new_name)
self.app.shell._edit.set_model_data(self.app.myKeywords) self.app.shell._edit.set_model_data(self.app.myKeywords)
self.app.ui.code_editor.set_model_data(self.app.myKeywords) self.app.ui.code_editor.set_model_data(self.app.myKeywords)
except: except Exception as e:
log.debug( 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 <b>{old}</b> to <b>{new}</b>").format(old=old_name, self.app.inform.emit(_("Object renamed from <b>{old}</b> to <b>{new}</b>").format(old=old_name,
new=new_name)) new=new_name))
@ -452,7 +453,7 @@ class ObjectCollection(QtCore.QAbstractItemModel):
# Prevent same name # Prevent same name
while name in self.get_names(): while name in self.get_names():
## Create a new name # ## Create a new name
# Ends with number? # Ends with number?
FlatCAMApp.App.log.debug("new_object(): Object name (%s) exists, changing." % name) FlatCAMApp.App.log.debug("new_object(): Object name (%s) exists, changing." % name)
match = re.search(r'(.*[^\d])?(\d+)$', name) match = re.search(r'(.*[^\d])?(\d+)$', name)

View File

@ -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 24.05.2019
- added a toggle Grid button to the canvas context menu in the Grids submenu - added a toggle Grid button to the canvas context menu in the Grids submenu

311
camlib.py
View File

@ -1,12 +1,11 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
#import traceback
from io import StringIO from io import StringIO
@ -58,6 +57,12 @@ if platform.architecture()[0] == '64bit':
from ortools.constraint_solver import pywrapcp from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import routing_enums_pb2 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 = logging.getLogger('base2')
log.setLevel(logging.DEBUG) log.setLevel(logging.DEBUG)
@ -66,11 +71,6 @@ handler = logging.StreamHandler()
handler.setFormatter(formatter) handler.setFormatter(formatter)
log.addHandler(handler) log.addHandler(handler)
import gettext
import FlatCAMTranslation as fcTranslate
fcTranslate.apply_language('strings')
import builtins
if '_' not in builtins.__dict__: if '_' not in builtins.__dict__:
_ = gettext.gettext _ = gettext.gettext
@ -132,21 +132,20 @@ class Geometry(object):
:param radius: Radius of the circle. :param radius: Radius of the circle.
:return: None :return: None
""" """
# TODO: Decide what solid_geometry is supposed to be and how we append to it.
if self.solid_geometry is None: if self.solid_geometry is None:
self.solid_geometry = [] self.solid_geometry = []
if type(self.solid_geometry) is list: 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 return
try: try:
self.solid_geometry = self.solid_geometry.union(Point(origin).buffer(radius, self.solid_geometry = self.solid_geometry.union(Point(origin).buffer(
int(int(self.geo_steps_per_circle) / 4))) radius, int(int(self.geo_steps_per_circle) / 4)))
except: except Exception as e:
#print "Failed to run union on polygons." log.error("Failed to run union on polygons. %s" % str(e))
log.error("Failed to run union on polygons.")
return return
def add_polygon(self, points): def add_polygon(self, points):
@ -165,9 +164,8 @@ class Geometry(object):
try: try:
self.solid_geometry = self.solid_geometry.union(Polygon(points)) self.solid_geometry = self.solid_geometry.union(Polygon(points))
except: except Exception as e:
#print "Failed to run union on polygons." log.error("Failed to run union on polygons. %s" % str(e))
log.error("Failed to run union on polygons.")
return return
def add_polyline(self, points): def add_polyline(self, points):
@ -186,13 +184,11 @@ class Geometry(object):
try: try:
self.solid_geometry = self.solid_geometry.union(LineString(points)) self.solid_geometry = self.solid_geometry.union(LineString(points))
except: except Exception as e:
#print "Failed to run union on polygons." log.error("Failed to run union on polylines. %s" % str(e))
log.error("Failed to run union on polylines.")
return return
def is_empty(self): def is_empty(self):
if isinstance(self.solid_geometry, BaseGeometry): if isinstance(self.solid_geometry, BaseGeometry):
return self.solid_geometry.is_empty return self.solid_geometry.is_empty
@ -213,18 +209,18 @@ class Geometry(object):
if self.solid_geometry is None: if self.solid_geometry is None:
self.solid_geometry = [] 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) flat_geometry = self.flatten(pathonly=True)
log.debug("%d paths" % len(flat_geometry)) log.debug("%d paths" % len(flat_geometry))
polygon=Polygon(points) polygon = Polygon(points)
toolgeo=cascaded_union(polygon) toolgeo = cascaded_union(polygon)
diffs=[] diffs = []
for target in flat_geometry: for target in flat_geometry:
if type(target) == LineString or type(target) == LinearRing: if type(target) == LineString or type(target) == LinearRing:
diffs.append(target.difference(toolgeo)) diffs.append(target.difference(toolgeo))
else: else:
log.warning("Not implemented.") log.warning("Not implemented.")
self.solid_geometry=cascaded_union(diffs) self.solid_geometry = cascaded_union(diffs)
def bounds(self): def bounds(self):
""" """
@ -336,7 +332,8 @@ class Geometry(object):
poly, which can can be iterable, contain iterable of, or poly, which can can be iterable, contain iterable of, or
be itself an implementer of .contains(). 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. :return: Polygon containing point or None.
""" """
@ -366,12 +363,12 @@ class Geometry(object):
if geometry is None: if geometry is None:
geometry = self.solid_geometry geometry = self.solid_geometry
## If iterable, expand recursively. # ## If iterable, expand recursively.
try: try:
for geo in geometry: for geo in geometry:
interiors.extend(self.get_interiors(geometry=geo)) interiors.extend(self.get_interiors(geometry=geo))
## Not iterable, get the interiors if polygon. # ## Not iterable, get the interiors if polygon.
except TypeError: except TypeError:
if type(geometry) == Polygon: if type(geometry) == Polygon:
interiors.extend(geometry.interiors) interiors.extend(geometry.interiors)
@ -393,12 +390,12 @@ class Geometry(object):
if geometry is None: if geometry is None:
geometry = self.solid_geometry geometry = self.solid_geometry
## If iterable, expand recursively. # ## If iterable, expand recursively.
try: try:
for geo in geometry: for geo in geometry:
exteriors.extend(self.get_exteriors(geometry=geo)) exteriors.extend(self.get_exteriors(geometry=geo))
## Not iterable, get the exterior if polygon. # ## Not iterable, get the exterior if polygon.
except TypeError: except TypeError:
if type(geometry) == Polygon: if type(geometry) == Polygon:
exteriors.append(geometry.exterior) exteriors.append(geometry.exterior)
@ -423,7 +420,7 @@ class Geometry(object):
if reset: if reset:
self.flat_geometry = [] self.flat_geometry = []
## If iterable, expand recursively. # ## If iterable, expand recursively.
try: try:
for geo in geometry: for geo in geometry:
if geo is not None: if geo is not None:
@ -431,7 +428,7 @@ class Geometry(object):
reset=False, reset=False,
pathonly=pathonly) pathonly=pathonly)
## Not iterable, do the actual indexing and add. # ## Not iterable, do the actual indexing and add.
except TypeError: except TypeError:
if pathonly and type(geometry) == Polygon: if pathonly and type(geometry) == Polygon:
self.flat_geometry.append(geometry.exterior) self.flat_geometry.append(geometry.exterior)
@ -480,18 +477,18 @@ class Geometry(object):
# if reset: # if reset:
# self.flat_geometry = [] # self.flat_geometry = []
# #
# ## If iterable, expand recursively. # # ## If iterable, expand recursively.
# try: # try:
# for geo in geometry: # for geo in geometry:
# self.flatten_to_paths(geometry=geo, reset=False) # 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: # except TypeError:
# if type(geometry) == Polygon: # if type(geometry) == Polygon:
# g = geometry.exterior # g = geometry.exterior
# self.flat_geometry.append(g) # 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[0])
# self.flat_geometry_rtree.insert(len(self.flat_geometry) - 1, g.coords[-1]) # self.flat_geometry_rtree.insert(len(self.flat_geometry) - 1, g.coords[-1])
# #
@ -694,7 +691,6 @@ class Geometry(object):
else: else:
scale_factor = 1 / dpi scale_factor = 1 / dpi
geos = [] geos = []
unscaled_geos = [] unscaled_geos = []
@ -715,7 +711,7 @@ class Geometry(object):
pass pass
try: try:
blue= src.read(3) blue = src.read(3)
except: except:
pass pass
@ -807,7 +803,7 @@ class Geometry(object):
assert type(polygon) == Polygon or type(polygon) == MultiPolygon, \ assert type(polygon) == Polygon or type(polygon) == MultiPolygon, \
"Expected a Polygon or MultiPolygon, got %s" % type(polygon) "Expected a Polygon or MultiPolygon, got %s" % type(polygon)
## The toolpaths # ## The toolpaths
# Index first and last points in paths # Index first and last points in paths
def get_pts(o): def get_pts(o):
return [o.coords[0], o.coords[-1]] return [o.coords[0], o.coords[-1]]
@ -893,7 +889,7 @@ class Geometry(object):
# Current buffer radius # Current buffer radius
radius = tooldia / 2 * (1 - overlap) radius = tooldia / 2 * (1 - overlap)
## The toolpaths # ## The toolpaths
# Index first and last points in paths # Index first and last points in paths
def get_pts(o): def get_pts(o):
return [o.coords[0], o.coords[-1]] return [o.coords[0], o.coords[-1]]
@ -973,7 +969,7 @@ class Geometry(object):
# log.debug("camlib.clear_polygon3()") # log.debug("camlib.clear_polygon3()")
## The toolpaths # ## The toolpaths
# Index first and last points in paths # Index first and last points in paths
def get_pts(o): def get_pts(o):
return [o.coords[0], o.coords[-1]] return [o.coords[0], o.coords[-1]]
@ -1071,7 +1067,7 @@ class Geometry(object):
# Assuming geolist is a flat list of flat elements # 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): def get_pts(o):
return [o.coords[0], o.coords[-1]] return [o.coords[0], o.coords[-1]]
@ -1085,7 +1081,7 @@ class Geometry(object):
# storage.insert(LineString(shape)) # storage.insert(LineString(shape))
# #storage.insert(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 = []
optimized_paths = FlatCAMRTreeStorage() optimized_paths = FlatCAMRTreeStorage()
optimized_paths.get_points = get_pts optimized_paths.get_points = get_pts
@ -1129,15 +1125,15 @@ class Geometry(object):
else: else:
# Have to lift tool. End path. # Have to lift tool. End path.
#log.debug("Path #%d not within boundary. Next." % path_count) # log.debug("Path #%d not within boundary. Next." % path_count)
#optimized_paths.append(geo) # optimized_paths.append(geo)
optimized_paths.insert(geo) optimized_paths.insert(geo)
geo = candidate geo = candidate
current_pt = geo.coords[-1] current_pt = geo.coords[-1]
# Next # Next
#pt, geo = storage.nearest(current_pt) # pt, geo = storage.nearest(current_pt)
except StopIteration: # Nothing left in storage. except StopIteration: # Nothing left in storage.
#pass #pass
@ -1159,7 +1155,7 @@ class Geometry(object):
log.debug("path_connect()") log.debug("path_connect()")
## Index first and last points in paths # ## Index first and last points in paths
def get_pts(o): def get_pts(o):
return [o.coords[0], o.coords[-1]] return [o.coords[0], o.coords[-1]]
# #
@ -1173,18 +1169,14 @@ class Geometry(object):
path_count = 0 path_count = 0
pt, geo = storage.nearest(origin) pt, geo = storage.nearest(origin)
storage.remove(geo) storage.remove(geo)
#optimized_geometry = [geo] # optimized_geometry = [geo]
optimized_geometry = FlatCAMRTreeStorage() optimized_geometry = FlatCAMRTreeStorage()
optimized_geometry.get_points = get_pts optimized_geometry.get_points = get_pts
#optimized_geometry.insert(geo) # optimized_geometry.insert(geo)
try: try:
while True: while True:
path_count += 1 path_count += 1
#print "geo is", geo
_, left = storage.nearest(geo.coords[0]) _, left = storage.nearest(geo.coords[0])
#print "left is", left
# If left touches geo, remove left from original # If left touches geo, remove left from original
# storage and append to geo. # storage and append to geo.
@ -1210,7 +1202,6 @@ class Geometry(object):
continue continue
_, right = storage.nearest(geo.coords[-1]) _, right = storage.nearest(geo.coords[-1])
#print "right is", right
# If right touches geo, remove left from original # If right touches geo, remove left from original
# storage and append to geo. # storage and append to geo.
@ -1243,7 +1234,7 @@ class Geometry(object):
if type(right) == LinearRing: if type(right) == LinearRing:
optimized_geometry.insert(right) optimized_geometry.insert(right)
else: else:
# Cannot exteng geo any further. Put it away. # Cannot extend geo any further. Put it away.
optimized_geometry.insert(geo) optimized_geometry.insert(geo)
# Continue with right. # Continue with right.
@ -1252,7 +1243,7 @@ class Geometry(object):
except StopIteration: # Nothing found in storage. except StopIteration: # Nothing found in storage.
optimized_geometry.insert(geo) optimized_geometry.insert(geo)
#print path_count # print path_count
log.debug("path_count = %d" % path_count) log.debug("path_count = %d" % path_count)
return optimized_geometry return optimized_geometry
@ -1288,7 +1279,7 @@ class Geometry(object):
def to_dict(self): 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``. Attributes to include are listed in ``self.ser_attrs``.
:return: A dictionary-encoded copy of the object. :return: A dictionary-encoded copy of the object.
@ -1485,7 +1476,7 @@ class ApertureMacro:
<Comment>: 0 <Text> <Comment>: 0 <Text>
""" """
## Regular expressions # ## Regular expressions
am1_re = re.compile(r'^%AM([^\*]+)\*(.+)?(%)?$') am1_re = re.compile(r'^%AM([^\*]+)\*(.+)?(%)?$')
am2_re = re.compile(r'(.*)%$') am2_re = re.compile(r'(.*)%$')
amcomm_re = re.compile(r'^0(.*)') amcomm_re = re.compile(r'^0(.*)')
@ -1496,8 +1487,8 @@ class ApertureMacro:
self.name = name self.name = name
self.raw = "" self.raw = ""
## These below are recomputed for every aperture # ## These below are recomputed for every aperture
## definition, in other words, are temporary variables. # ## definition, in other words, are temporary variables.
self.primitives = [] self.primitives = []
self.locvars = {} self.locvars = {}
self.geometry = None self.geometry = None
@ -1543,14 +1534,14 @@ class ApertureMacro:
# Separate parts # Separate parts
parts = self.raw.split('*') parts = self.raw.split('*')
#### Every part in the macro #### #### Every part in the macro ## ##
for part in parts: for part in parts:
### Comments. Ignored. # ## Comments. Ignored.
match = ApertureMacro.amcomm_re.search(part) match = ApertureMacro.amcomm_re.search(part)
if match: if match:
continue continue
### Variables # ## Variables
# These are variables defined locally inside the macro. They can be # These are variables defined locally inside the macro. They can be
# numerical constant or defind in terms of previously define # numerical constant or defind in terms of previously define
# variables, which can be defined locally or in an aperture # variables, which can be defined locally or in an aperture
@ -1575,14 +1566,14 @@ class ApertureMacro:
self.locvars[var] = eval(val) self.locvars[var] = eval(val)
continue continue
### Primitives # ## Primitives
# Each is an array. The first identifies the primitive, while the # Each is an array. The first identifies the primitive, while the
# rest depend on the primitive. All are strings representing a # rest depend on the primitive. All are strings representing a
# number and may contain variable definition. The values of these # number and may contain variable definition. The values of these
# variables are defined in an aperture definition. # variables are defined in an aperture definition.
match = ApertureMacro.amprim_re.search(part) match = ApertureMacro.amprim_re.search(part)
if match: if match:
## Replace all variables # ## Replace all variables
for v in self.locvars: for v in self.locvars:
# replaced the following line with the next to fix Mentor custom apertures not parsed OK # 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) # 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 * # Change x with *
part = re.sub(r'[xX]', "*", part) part = re.sub(r'[xX]', "*", part)
## Store # ## Store
elements = part.split(",") elements = part.split(",")
self.primitives.append([eval(x) for x in elements]) self.primitives.append([eval(x) for x in elements])
continue continue
@ -1754,8 +1745,8 @@ class ApertureMacro:
i = 1 # Number of rings created so far i = 1 # Number of rings created so far
## If the ring does not have an interior it means that it is # ## If the ring does not have an interior it means that it is
## a disk. Then stop. # ## a disk. Then stop.
while len(ring.interiors) > 0 and i < nrings: while len(ring.interiors) > 0 and i < nrings:
r -= thickness + gap r -= thickness + gap
if r <= 0: if r <= 0:
@ -1764,7 +1755,7 @@ class ApertureMacro:
result = cascaded_union([result, ring]) result = cascaded_union([result, ring])
i += 1 i += 1
## Crosshair # ## Crosshair
hor = LineString([(x - cross_len, y), (x + cross_len, y)]).buffer(cross_th/2.0, cap_style=2) 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) ver = LineString([(x, y-cross_len), (x, y + cross_len)]).buffer(cross_th/2.0, cap_style=2)
result = cascaded_union([result, hor, ver]) result = cascaded_union([result, hor, ver])
@ -1802,7 +1793,7 @@ class ApertureMacro:
:rtype: shapely.geometry.polygon :rtype: shapely.geometry.polygon
""" """
## Primitive makers # ## Primitive makers
makers = { makers = {
"1": ApertureMacro.make_circle, "1": ApertureMacro.make_circle,
"2": ApertureMacro.make_vectorline, "2": ApertureMacro.make_vectorline,
@ -1815,19 +1806,19 @@ class ApertureMacro:
"7": ApertureMacro.make_thermal "7": ApertureMacro.make_thermal
} }
## Store modifiers as local variables # ## Store modifiers as local variables
modifiers = modifiers or [] modifiers = modifiers or []
modifiers = [float(m) for m in modifiers] modifiers = [float(m) for m in modifiers]
self.locvars = {} self.locvars = {}
for i in range(0, len(modifiers)): for i in range(0, len(modifiers)):
self.locvars[str(i + 1)] = modifiers[i] self.locvars[str(i + 1)] = modifiers[i]
## Parse # ## Parse
self.primitives = [] # Cleanup self.primitives = [] # Cleanup
self.geometry = Polygon() self.geometry = Polygon()
self.parse_content() self.parse_content()
## Make the geometry # ## Make the geometry
for primitive in self.primitives: for primitive in self.primitives:
# Make the primitive # Make the primitive
prim_geo = makers[str(int(primitive[0]))](primitive[1:]) prim_geo = makers[str(int(primitive[0]))](primitive[1:])
@ -1898,9 +1889,7 @@ class Gerber (Geometry):
:rtype: Gerber :rtype: Gerber
""" """
# How to discretize a circle. # How to approximate a circle with lines.
# if steps_per_circle is None:
# steps_per_circle = int(Gerber.defaults['steps_per_circle'])
self.steps_per_circle = int(self.app.defaults["gerber_circle_steps"]) self.steps_per_circle = int(self.app.defaults["gerber_circle_steps"])
# Initialize parent # 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. """Zeros in Gerber numbers. If 'L' then remove leading zeros, if 'T' remove trailing zeros. Used during parsing.
""" """
## Gerber elements ## # ## Gerber elements # ##
''' '''
apertures = { apertures = {
'id':{ 'id':{
@ -1963,7 +1952,7 @@ class Gerber (Geometry):
self.ser_attrs += ['int_digits', 'frac_digits', 'apertures', self.ser_attrs += ['int_digits', 'frac_digits', 'apertures',
'aperture_macros', 'solid_geometry', 'source_file'] 'aperture_macros', 'solid_geometry', 'source_file']
#### Parser patterns #### # ### Parser patterns ## ##
# FS - Format Specification # FS - Format Specification
# The format of X and Y must be the same! # The format of X and Y must be the same!
# L-omit leading zeros, T-omit trailing zeros, D-no zero supression # L-omit leading zeros, T-omit trailing zeros, D-no zero supression
@ -1985,7 +1974,7 @@ class Gerber (Geometry):
# AM - Aperture Macro # AM - Aperture Macro
# Beginning of macro (Ends with *%): # 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 # Tool change
# May begin with G54 but that is deprecated # May begin with G54 but that is deprecated
@ -2159,7 +2148,7 @@ class Gerber (Geometry):
self.parse_lines(line_generator()) self.parse_lines(line_generator())
#@profile # @profile
def parse_lines(self, glines): def parse_lines(self, glines):
""" """
Main Gerber parser. Reads Gerber and populates ``self.paths``, ``self.apertures``, Main Gerber parser. Reads Gerber and populates ``self.paths``, ``self.apertures``,
@ -2228,7 +2217,7 @@ class Gerber (Geometry):
# If a region is being defined # If a region is being defined
making_region = False making_region = False
#### Parsing starts here #### # ### Parsing starts here ## ##
line_num = 0 line_num = 0
gline = "" gline = ""
try: try:
@ -2240,15 +2229,15 @@ class Gerber (Geometry):
gline = gline.strip(' \r\n') gline = gline.strip(' \r\n')
# log.debug("Line=%3s %s" % (line_num, gline)) # log.debug("Line=%3s %s" % (line_num, gline))
# ############################################################### # ############################################################# ##
# Ignored lines # # Ignored lines #
# Comments ###### # Comments #### ##
# ############################################################### # ############################################################# ##
match = self.comm_re.search(gline) match = self.comm_re.search(gline)
if match: if match:
continue continue
# Polarity change ######## # Polarity change ###### ##
# Example: %LPD*% or %LPC*% # Example: %LPD*% or %LPC*%
# If polarity changes, creates geometry from current # If polarity changes, creates geometry from current
# buffer, then adds or subtracts accordingly. # buffer, then adds or subtracts accordingly.
@ -2303,10 +2292,10 @@ class Gerber (Geometry):
current_polarity = new_polarity current_polarity = new_polarity
continue continue
# ############################################################### # ############################################################# ##
# Number format ################## # Number format ############################################### ##
# Example: %FSLAX24Y24*% # Example: %FSLAX24Y24*%
# ############################################################### # ############################################################# ##
# TODO: This is ignoring most of the format. Implement the rest. # TODO: This is ignoring most of the format. Implement the rest.
match = self.fmt_re.search(gline) match = self.fmt_re.search(gline)
if match: if match:
@ -2322,7 +2311,7 @@ class Gerber (Geometry):
log.debug("Gerber format found. Coordinates type = %s (Absolute or Relative)" % absolute) log.debug("Gerber format found. Coordinates type = %s (Absolute or Relative)" % absolute)
continue continue
### Mode (IN/MM) # ## Mode (IN/MM)
# Example: %MOIN*% # Example: %MOIN*%
match = self.mode_re.search(gline) match = self.mode_re.search(gline)
if match: if match:
@ -2332,9 +2321,9 @@ class Gerber (Geometry):
self.convert_units(match.group(1)) self.convert_units(match.group(1))
continue continue
# ############################################################### # ############################################################# ##
# Combined Number format and Mode --- Allegro does this ######### # Combined Number format and Mode --- Allegro does this ####### ##
# ############################################################### # ############################################################# ##
match = self.fmt_re_alt.search(gline) match = self.fmt_re_alt.search(gline)
if match: if match:
absolute = {'A': 'Absolute', 'I': 'Relative'}[match.group(2)] absolute = {'A': 'Absolute', 'I': 'Relative'}[match.group(2)]
@ -2353,9 +2342,9 @@ class Gerber (Geometry):
self.convert_units(match.group(5)) self.convert_units(match.group(5))
continue continue
# ############################################################### # ############################################################# ##
# Search for OrCAD way for having Number format # Search for OrCAD way for having Number format
# ############################################################### # ############################################################# ##
match = self.fmt_re_orcad.search(gline) match = self.fmt_re_orcad.search(gline)
if match: if match:
if match.group(1) is not None: if match.group(1) is not None:
@ -2379,9 +2368,9 @@ class Gerber (Geometry):
self.convert_units(match.group(5)) self.convert_units(match.group(5))
continue continue
# ############################################################### # ############################################################# ##
# Units (G70/1) OBSOLETE # Units (G70/1) OBSOLETE
# ############################################################### # ############################################################# ##
match = self.units_re.search(gline) match = self.units_re.search(gline)
if match: if match:
obs_gerber_units = {'0': 'IN', '1': 'MM'}[match.group(1)] 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)]) self.convert_units({'0': 'IN', '1': 'MM'}[match.group(1)])
continue continue
# ############################################################### # ############################################################# ##
# Absolute/relative coordinates G90/1 OBSOLETE ########## # Absolute/relative coordinates G90/1 OBSOLETE ######## ##
# ####################################################### # ##################################################### ##
match = self.absrel_re.search(gline) match = self.absrel_re.search(gline)
if match: if match:
absolute = {'0': "Absolute", '1': "Relative"}[match.group(1)] absolute = {'0': "Absolute", '1': "Relative"}[match.group(1)]
log.warning("Gerber obsolete coordinates type found = %s (Absolute or Relative) " % absolute) log.warning("Gerber obsolete coordinates type found = %s (Absolute or Relative) " % absolute)
continue continue
# ############################################################### # ############################################################# ##
# Aperture Macros ####################################### # Aperture Macros ##################################### ##
# Having this at the beginning will slow things down # Having this at the beginning will slow things down
# but macros can have complicated statements than could # but macros can have complicated statements than could
# be caught by other patterns. # be caught by other patterns.
# ############################################################### # ############################################################# ##
if current_macro is None: # No macro started yet if current_macro is None: # No macro started yet
match = self.am1_re.search(gline) match = self.am1_re.search(gline)
# Start macro if match, else not an AM, carry on. # Start macro if match, else not an AM, carry on.
@ -2431,18 +2420,18 @@ class Gerber (Geometry):
self.aperture_macros[current_macro].append(gline) self.aperture_macros[current_macro].append(gline)
continue continue
### Aperture definitions %ADD... # ## Aperture definitions %ADD...
match = self.ad_re.search(gline) match = self.ad_re.search(gline)
if match: if match:
# log.info("Found aperture definition. Line %d: %s" % (line_num, gline)) # log.info("Found aperture definition. Line %d: %s" % (line_num, gline))
self.aperture_parse(match.group(1), match.group(2), match.group(3)) self.aperture_parse(match.group(1), match.group(2), match.group(3))
continue continue
# ############################################################### # ############################################################# ##
# Operation code alone ######################## # Operation code alone ###################### ##
# Operation code alone, usually just D03 (Flash) # Operation code alone, usually just D03 (Flash)
# self.opcode_re = re.compile(r'^D0?([123])\*$') # self.opcode_re = re.compile(r'^D0?([123])\*$')
# ############################################################### # ############################################################# ##
match = self.opcode_re.search(gline) match = self.opcode_re.search(gline)
if match: if match:
current_operation_code = int(match.group(1)) current_operation_code = int(match.group(1))
@ -2479,10 +2468,10 @@ class Gerber (Geometry):
continue continue
# ############################################################### # ############################################################# ##
# Tool/aperture change # Tool/aperture change
# Example: D12* # Example: D12*
# ############################################################### # ############################################################# ##
match = self.tool_re.search(gline) match = self.tool_re.search(gline)
if match: if match:
current_aperture = match.group(1) current_aperture = match.group(1)
@ -2529,9 +2518,9 @@ class Gerber (Geometry):
continue continue
# ############################################################### # ############################################################# ##
# G36* - Begin region # G36* - Begin region
# ############################################################### # ############################################################# ##
if self.regionon_re.search(gline): if self.regionon_re.search(gline):
if len(path) > 1: if len(path) > 1:
# Take care of what is left in the path # Take care of what is left in the path
@ -2563,9 +2552,9 @@ class Gerber (Geometry):
making_region = True making_region = True
continue continue
# ############################################################### # ############################################################# ##
# G37* - End region # G37* - End region
# ############################################################### # ############################################################# ##
if self.regionoff_re.search(gline): if self.regionoff_re.search(gline):
making_region = False making_region = False
@ -2632,7 +2621,7 @@ class Gerber (Geometry):
path = [[current_x, current_y]] # Start new path path = [[current_x, current_y]] # Start new path
continue continue
### G01/2/3* - Interpolation mode change # ## G01/2/3* - Interpolation mode change
# Can occur along with coordinates and operation code but # Can occur along with coordinates and operation code but
# sometimes by itself (handled here). # sometimes by itself (handled here).
# Example: G01* # Example: G01*
@ -2641,7 +2630,7 @@ class Gerber (Geometry):
current_interpolation_mode = int(match.group(1)) current_interpolation_mode = int(match.group(1))
continue continue
### G01 - Linear interpolation plus flashes # ## G01 - Linear interpolation plus flashes
# Operation code (D0x) missing is deprecated... oh well I will support it. # Operation code (D0x) missing is deprecated... oh well I will support it.
# REGEX: r'^(?:G0?(1))?(?:X(-?\d+))?(?:Y(-?\d+))?(?:D0([123]))?\*$' # REGEX: r'^(?:G0?(1))?(?:X(-?\d+))?(?:Y(-?\d+))?(?:D0([123]))?\*$'
match = self.lin_re.search(gline) 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)) # log.debug("Line_number=%3s X=%s Y=%s (%s)" % (line_num, linear_x, linear_y, gline))
continue continue
### G74/75* - Single or multiple quadrant arcs # ## G74/75* - Single or multiple quadrant arcs
match = self.quad_re.search(gline) match = self.quad_re.search(gline)
if match: if match:
if match.group(1) == '4': if match.group(1) == '4':
@ -2905,7 +2894,7 @@ class Gerber (Geometry):
quadrant_mode = 'MULTI' quadrant_mode = 'MULTI'
continue continue
### G02/3 - Circular interpolation # ## G02/3 - Circular interpolation
# 2-clockwise, 3-counterclockwise # 2-clockwise, 3-counterclockwise
# Ex. format: G03 X0 Y50 I-50 J0 where the X, Y coords are the coords of the End Point # 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) match = self.circ_re.search(gline)
@ -3084,12 +3073,12 @@ class Gerber (Geometry):
else: else:
log.warning("Invalid arc in line %d." % line_num) log.warning("Invalid arc in line %d." % line_num)
## EOF # ## EOF
match = self.eof_re.search(gline) match = self.eof_re.search(gline)
if match: if match:
continue 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)) log.warning("Line ignored (%d): %s" % (line_num, gline))
if len(path) > 1: if len(path) > 1:
@ -3100,7 +3089,7 @@ class Gerber (Geometry):
pass pass
else: else:
# EOF, create shapely LineString if something still in path # EOF, create shapely LineString if something still in path
## --- Buffered --- # ## --- Buffered ---
geo_dict = dict() geo_dict = dict()
# this treats the case when we are storing geometry as paths # 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.")) self.app.inform.emit(_("[success] Gerber Scale done."))
## solid_geometry ??? # ## solid_geometry ???
# It's a cascaded union of objects. # It's a cascaded union of objects.
# self.solid_geometry = affinity.scale(self.solid_geometry, factor, # self.solid_geometry = affinity.scale(self.solid_geometry, factor,
# factor, origin=(0, 0)) # factor, origin=(0, 0))
@ -3435,7 +3424,7 @@ class Gerber (Geometry):
else: else:
return affinity.translate(obj, xoff=dx, yoff=dy) return affinity.translate(obj, xoff=dx, yoff=dy)
## Solid geometry # ## Solid geometry
self.solid_geometry = offset_geom(self.solid_geometry) self.solid_geometry = offset_geom(self.solid_geometry)
self.follow_geometry = offset_geom(self.follow_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.num_tools = [] # List for keeping the tools sorted
self.index_per_tool = {} # Dictionary to store the indexed points for each tool 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 #self.units = units
# Trailing "T" or leading "L" (default) # Trailing "T" or leading "L" (default)
@ -3708,7 +3697,7 @@ class Excellon(Geometry):
'excellon_format_upper_in', 'excellon_format_lower_in', 'excellon_units', 'slots', 'excellon_format_upper_in', 'excellon_format_lower_in', 'excellon_units', 'slots',
'source_file'] 'source_file']
#### Patterns #### #### Patterns ## ##
# Regex basics: # Regex basics:
# ^ - beginning # ^ - beginning
# $ - end # $ - end
@ -3855,7 +3844,7 @@ class Excellon(Geometry):
line_units = '' line_units = ''
#### Parsing starts here #### #### Parsing starts here ## ##
line_num = 0 # Line number line_num = 0 # Line number
eline = "" eline = ""
try: try:
@ -3946,7 +3935,7 @@ class Excellon(Geometry):
log.warning("Found end of the header: %s" % eline) log.warning("Found end of the header: %s" % eline)
continue continue
## Alternative units format M71/M72 # ## Alternative units format M71/M72
# Supposed to be just in the body (yes, the body) # Supposed to be just in the body (yes, the body)
# but some put it in the header (PADS for example). # but some put it in the header (PADS for example).
# Will detect anywhere. Occurrence will change the # Will detect anywhere. Occurrence will change the
@ -3966,10 +3955,10 @@ class Excellon(Geometry):
':' + str(self.excellon_format_lower_in)) ':' + str(self.excellon_format_lower_in))
continue continue
#### Body #### #### Body ## ##
if not in_header: if not in_header:
## Tool change ## # ## Tool change # ##
match = self.toolsel_re.search(eline) match = self.toolsel_re.search(eline)
if match: if match:
current_tool = str(int(match.group(1))) current_tool = str(int(match.group(1)))
@ -4009,7 +3998,7 @@ class Excellon(Geometry):
continue continue
## Allegro Type Tool change ## # ## Allegro Type Tool change # ##
if allegro_warning is True: if allegro_warning is True:
match = self.absinc_re.search(eline) match = self.absinc_re.search(eline)
match1 = self.stop_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) log.debug(" Tool change for Allegro type of Excellon: %s" % current_tool)
continue continue
## Slots parsing for drilled slots (contain G85) # ## Slots parsing for drilled slots (contain G85)
# a Excellon drilled slot line may look like this: # a Excellon drilled slot line may look like this:
# X01125Y0022244G85Y0027756 # X01125Y0022244G85Y0027756
match = self.slots_re.search(eline) match = self.slots_re.search(eline)
@ -4032,7 +4021,7 @@ class Excellon(Geometry):
start_coords_match = match.group(1) start_coords_match = match.group(1)
stop_coords_match = match.group(2) 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 # get the coordinates for slot start and for slot stop into variables
start_coords_noperiod = self.coordsnoperiod_re.search(start_coords_match) start_coords_noperiod = self.coordsnoperiod_re.search(start_coords_match)
stop_coords_noperiod = self.coordsnoperiod_re.search(stop_coords_match) stop_coords_noperiod = self.coordsnoperiod_re.search(stop_coords_match)
@ -4101,7 +4090,7 @@ class Excellon(Geometry):
) )
continue 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 # get the coordinates for slot start and for slot stop into variables
start_coords_period = self.coordsperiod_re.search(start_coords_match) start_coords_period = self.coordsperiod_re.search(start_coords_match)
stop_coords_period = self.coordsperiod_re.search(stop_coords_match) stop_coords_period = self.coordsperiod_re.search(stop_coords_match)
@ -4170,7 +4159,7 @@ class Excellon(Geometry):
) )
continue continue
## Coordinates without period ## # ## Coordinates without period # ##
match = self.coordsnoperiod_re.search(eline) match = self.coordsnoperiod_re.search(eline)
if match: if match:
matchr = self.repeat_re.search(eline) matchr = self.repeat_re.search(eline)
@ -4201,7 +4190,7 @@ class Excellon(Geometry):
log.error("Missing coordinates") log.error("Missing coordinates")
continue continue
## Excellon Routing parse # ## Excellon Routing parse
if len(re.findall("G00", eline)) > 0: if len(re.findall("G00", eline)) > 0:
self.match_routing_start = 'G00' self.match_routing_start = 'G00'
@ -4251,7 +4240,7 @@ class Excellon(Geometry):
# log.debug("{:15} {:8} {:8}".format(eline, x, y)) # log.debug("{:15} {:8} {:8}".format(eline, x, y))
continue continue
## Coordinates with period: Use literally. ## # ## Coordinates with period: Use literally. # ##
match = self.coordsperiod_re.search(eline) match = self.coordsperiod_re.search(eline)
if match: if match:
matchr = self.repeat_re.search(eline) matchr = self.repeat_re.search(eline)
@ -4282,7 +4271,7 @@ class Excellon(Geometry):
log.error("Missing coordinates") log.error("Missing coordinates")
continue continue
## Excellon Routing parse # ## Excellon Routing parse
if len(re.findall("G00", eline)) > 0: if len(re.findall("G00", eline)) > 0:
self.match_routing_start = 'G00' self.match_routing_start = 'G00'
@ -4333,10 +4322,10 @@ class Excellon(Geometry):
# log.debug("{:15} {:8} {:8}".format(eline, x, y)) # log.debug("{:15} {:8} {:8}".format(eline, x, y))
continue continue
#### Header #### #### Header ## ##
if in_header: if in_header:
## Tool definitions ## # ## Tool definitions # ##
match = self.toolset_re.search(eline) match = self.toolset_re.search(eline)
if match: if match:
@ -4354,7 +4343,7 @@ class Excellon(Geometry):
log.debug(" Tool definition: %s %s" % (name, spec)) log.debug(" Tool definition: %s %s" % (name, spec))
continue continue
## Units and number format ## # ## Units and number format # ##
match = self.units_re.match(eline) match = self.units_re.match(eline)
if match: if match:
self.units_found = match.group(1) self.units_found = match.group(1)
@ -4412,7 +4401,7 @@ class Excellon(Geometry):
log.warning("Type of zeros found: %s" % self.zeros) log.warning("Type of zeros found: %s" % self.zeros)
continue continue
## Units and number format outside header## # ## Units and number format outside header# ##
match = self.units_re.match(eline) match = self.units_re.match(eline)
if match: if match:
self.units_found = match.group(1) 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 # 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 # 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. # 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 # flatCAM expects the number of digits entered into the defaults
if self.units.lower() == "in": # Inches is 00.0000 if self.units.lower() == "in": # Inches is 00.0000
@ -5284,7 +5273,7 @@ class CNCjob(Geometry):
self.postdata['toolC'] = exobj.tools[tool]["C"] self.postdata['toolC'] = exobj.tools[tool]["C"]
self.tooldia = exobj.tools[tool]["C"] self.tooldia = exobj.tools[tool]["C"]
################################################ ############################################## ##
# Create the data. # Create the data.
node_list = [] node_list = []
locations = create_data_array() locations = create_data_array()
@ -5334,7 +5323,7 @@ class CNCjob(Geometry):
log.warning('No solution found.') log.warning('No solution found.')
else: else:
log.warning('Specify an instance greater than 0.') log.warning('Specify an instance greater than 0.')
################################################ ############################################## ##
# Only if tool has points. # Only if tool has points.
if tool in points: if tool in points:
@ -5390,7 +5379,7 @@ class CNCjob(Geometry):
self.postdata['toolC']=exobj.tools[tool]["C"] self.postdata['toolC']=exobj.tools[tool]["C"]
self.tooldia = exobj.tools[tool]["C"] self.tooldia = exobj.tools[tool]["C"]
################################################ ############################################## ##
node_list = [] node_list = []
locations = create_data_array() locations = create_data_array()
tsp_size = len(locations) tsp_size = len(locations)
@ -5432,7 +5421,7 @@ class CNCjob(Geometry):
log.warning('No solution found.') log.warning('No solution found.')
else: else:
log.warning('Specify an instance greater than 0.') log.warning('Specify an instance greater than 0.')
################################################ ############################################## ##
# Only if tool has points. # Only if tool has points.
if tool in points: if tool in points:
@ -5588,7 +5577,7 @@ class CNCjob(Geometry):
else: else:
temp_solid_geometry = geometry 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) flat_geometry = self.flatten(temp_solid_geometry, pathonly=True)
log.debug("%d paths" % len(flat_geometry)) log.debug("%d paths" % len(flat_geometry))
@ -5665,7 +5654,7 @@ class CNCjob(Geometry):
"This is dangerous, skipping %s file") % self.options['name']) "This is dangerous, skipping %s file") % self.options['name'])
return 'fail' return 'fail'
## Index first and last points in paths # ## Index first and last points in paths
# What points to index. # What points to index.
def get_pts(o): def get_pts(o):
return [o.coords[0], o.coords[-1]] return [o.coords[0], o.coords[-1]]
@ -5719,7 +5708,7 @@ class CNCjob(Geometry):
if self.dwell is True: if self.dwell is True:
self.gcode += self.doformat(p.dwell_code) # Dwell time 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...") log.debug("Starting G-Code...")
path_count = 0 path_count = 0
current_pt = (0, 0) current_pt = (0, 0)
@ -5855,7 +5844,7 @@ class CNCjob(Geometry):
else: else:
temp_solid_geometry = geometry.solid_geometry 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) flat_geometry = self.flatten(temp_solid_geometry, pathonly=True)
log.debug("%d paths" % len(flat_geometry)) log.debug("%d paths" % len(flat_geometry))
@ -5928,7 +5917,7 @@ class CNCjob(Geometry):
"This is dangerous, skipping %s file") % self.options['name']) "This is dangerous, skipping %s file") % self.options['name'])
return 'fail' return 'fail'
## Index first and last points in paths # ## Index first and last points in paths
# What points to index. # What points to index.
def get_pts(o): def get_pts(o):
return [o.coords[0], o.coords[-1]] return [o.coords[0], o.coords[-1]]
@ -6041,7 +6030,7 @@ class CNCjob(Geometry):
log.debug("Generate_from_solderpaste_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. # What points to index.
def get_pts(o): def get_pts(o):
return [o.coords[0], o.coords[-1]] return [o.coords[0], o.coords[-1]]
@ -6077,7 +6066,7 @@ class CNCjob(Geometry):
else self.app.defaults['tools_solderpaste_pp'] else self.app.defaults['tools_solderpaste_pp']
p = self.app.postprocessors[self.pp_solderpaste_name] 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) flat_geometry = self.flatten(kwargs['solid_geometry'], pathonly=True)
log.debug("%d paths" % len(flat_geometry)) 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.spindle_off_code)
self.gcode += self.doformat(p.toolchange_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...") log.debug("Starting SolderPaste G-Code...")
path_count = 0 path_count = 0
current_pt = (0, 0) current_pt = (0, 0)
@ -6355,12 +6344,12 @@ class CNCjob(Geometry):
gobj = self.codes_split(line) gobj = self.codes_split(line)
## Units # ## Units
if 'G' in gobj and (gobj['G'] == 20.0 or gobj['G'] == 21.0): if 'G' in gobj and (gobj['G'] == 20.0 or gobj['G'] == 21.0):
self.units = {20.0: "IN", 21.0: "MM"}[gobj['G']] self.units = {20.0: "IN", 21.0: "MM"}[gobj['G']]
continue continue
## Changing height # ## Changing height
if 'Z' in gobj: if 'Z' in gobj:
if 'Roland' in self.pp_excellon_name or 'Roland' in self.pp_geometry_name: if 'Roland' in self.pp_excellon_name or 'Roland' in self.pp_geometry_name:
pass pass
@ -7699,7 +7688,7 @@ class FlatCAMRTree(object):
# Python RTree Index # Python RTree Index
self.rti = rtindex.Index() self.rti = rtindex.Index()
## Track object-point relationship # ## Track object-point relationship
# Each is list of points in object. # Each is list of points in object.
self.obj2points = [] self.obj2points = []

View File

@ -726,11 +726,11 @@ class FlatCAMExcEditor(QtCore.QObject):
self.app = app self.app = app
self.canvas = self.app.plotcanvas 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.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().upper()
self.exc_edit_widget = QtWidgets.QWidget() self.exc_edit_widget = QtWidgets.QWidget()
## Box for custom widgets # ## Box for custom widgets
# This gets populated in offspring implementations. # This gets populated in offspring implementations.
layout = QtWidgets.QVBoxLayout() layout = QtWidgets.QVBoxLayout()
self.exc_edit_widget.setLayout(layout) self.exc_edit_widget.setLayout(layout)
@ -744,22 +744,22 @@ class FlatCAMExcEditor(QtCore.QObject):
self.tools_box.setContentsMargins(0, 0, 0, 0) self.tools_box.setContentsMargins(0, 0, 0, 0)
self.drills_frame.setLayout(self.tools_box) 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.title_box = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(self.title_box) self.tools_box.addLayout(self.title_box)
## Page Title icon # ## Page Title icon
pixmap = QtGui.QPixmap('share/flatcam_icon32.png') pixmap = QtGui.QPixmap('share/flatcam_icon32.png')
self.icon = QtWidgets.QLabel() self.icon = QtWidgets.QLabel()
self.icon.setPixmap(pixmap) self.icon.setPixmap(pixmap)
self.title_box.addWidget(self.icon, stretch=0) self.title_box.addWidget(self.icon, stretch=0)
## Title label # ## Title label
self.title_label = QtWidgets.QLabel("<font size=5><b>%s</b></font>" % _('Excellon Editor')) self.title_label = QtWidgets.QLabel("<font size=5><b>%s</b></font>" % _('Excellon Editor'))
self.title_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.title_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
self.title_box.addWidget(self.title_label, stretch=1) self.title_box.addWidget(self.title_label, stretch=1)
## Object name # ## Object name
self.name_box = QtWidgets.QHBoxLayout() self.name_box = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(self.name_box) self.tools_box.addLayout(self.name_box)
name_label = QtWidgets.QLabel(_("Name:")) name_label = QtWidgets.QLabel(_("Name:"))
@ -767,7 +767,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.name_entry = FCEntry() self.name_entry = FCEntry()
self.name_box.addWidget(self.name_entry) self.name_box.addWidget(self.name_entry)
#### Tools Drills #### #### Tools Drills ## ##
self.tools_table_label = QtWidgets.QLabel("<b>%s</b>" % _('Tools Table')) self.tools_table_label = QtWidgets.QLabel("<b>%s</b>" % _('Tools Table'))
self.tools_table_label.setToolTip( self.tools_table_label.setToolTip(
_( "Tools in this Excellon object\n" _( "Tools in this Excellon object\n"
@ -789,7 +789,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.empty_label = QtWidgets.QLabel('') self.empty_label = QtWidgets.QLabel('')
self.tools_box.addWidget(self.empty_label) self.tools_box.addWidget(self.empty_label)
#### Add a new Tool #### #### Add a new Tool ## ##
self.addtool_label = QtWidgets.QLabel('<b>%s</b>' % _('Add/Delete Tool')) self.addtool_label = QtWidgets.QLabel('<b>%s</b>' % _('Add/Delete Tool'))
self.addtool_label.setToolTip( self.addtool_label.setToolTip(
_("Add/Delete a tool to the tool list\n" _("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_box.setContentsMargins(0, 0, 0, 0)
self.resize_frame.setLayout(self.resize_box) self.resize_frame.setLayout(self.resize_box)
#### Resize a drill #### #### Resize a drill ## ##
self.emptyresize_label = QtWidgets.QLabel('') self.emptyresize_label = QtWidgets.QLabel('')
self.resize_box.addWidget(self.emptyresize_label) 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_box.setContentsMargins(0, 0, 0, 0)
self.array_frame.setLayout(self.array_box) self.array_frame.setLayout(self.array_box)
#### Add DRILL Array #### #### Add DRILL Array ## ##
self.emptyarray_label = QtWidgets.QLabel('') self.emptyarray_label = QtWidgets.QLabel('')
self.array_box.addWidget(self.emptyarray_label) self.array_box.addWidget(self.emptyarray_label)
@ -1001,7 +1001,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.array_frame.hide() self.array_frame.hide()
self.tools_box.addStretch() self.tools_box.addStretch()
## Toolbar events and properties # ## Toolbar events and properties
self.tools_exc = { self.tools_exc = {
"drill_select": {"button": self.app.ui.select_drill_btn, "drill_select": {"button": self.app.ui.select_drill_btn,
"constructor": FCDrillSelect}, "constructor": FCDrillSelect},
@ -1017,7 +1017,7 @@ class FlatCAMExcEditor(QtCore.QObject):
"constructor": FCDrillMove}, "constructor": FCDrillMove},
} }
### Data # ## Data
self.active_tool = None self.active_tool = None
self.in_action = False self.in_action = False
@ -1090,7 +1090,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.shapes.enabled = False self.shapes.enabled = False
self.tool_shape.enabled = False self.tool_shape.enabled = False
## List of selected shapes. # ## List of selected shapes.
self.selected = [] self.selected = []
self.move_timer = QtCore.QTimer() self.move_timer = QtCore.QTimer()
@ -1160,7 +1160,7 @@ class FlatCAMExcEditor(QtCore.QObject):
@staticmethod @staticmethod
def make_storage(): def make_storage():
## Shape storage. # ## Shape storage.
storage = FlatCAMRTreeStorage() storage = FlatCAMRTreeStorage()
storage.get_points = DrawToolShape.get_pts storage.get_points = DrawToolShape.get_pts
@ -1739,7 +1739,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.drills_frame.hide() self.drills_frame.hide()
def connect_canvas_event_handlers(self): def connect_canvas_event_handlers(self):
## Canvas events # ## Canvas events
# first connect to new, then disconnect the old handlers # first connect to new, then disconnect the old handlers
# don't ask why but if there is nothing connected I've seen issues # 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: if self.active_tool is None:
return return
### Snap coordinates # ## Snap coordinates
if self.app.grid_status(): if self.app.grid_status():
x, y = self.app.geo_editor.snap(x, y) x, y = self.app.geo_editor.snap(x, y)
self.app.app_cursor.enabled = True self.app.app_cursor.enabled = True
@ -2419,7 +2419,7 @@ class FlatCAMExcEditor(QtCore.QObject):
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: " self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (dx, dy)) "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (dx, dy))
### Utility geometry (animated) # ## Utility geometry (animated)
geo = self.active_tool.utility_geometry(data=(x, y)) geo = self.active_tool.utility_geometry(data=(x, y))
if isinstance(geo, DrawToolShape) and geo.geo is not None: 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.tool_shape.clear(update=True)
self.draw_utility_geometry(geo=geo) 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: if event.is_dragging == 1 and event.button == 1:
# I make an exception for FCDrillAdd and FCDrillArray because clicking and dragging while making regions # I make an exception for FCDrillAdd and FCDrillArray because clicking and dragging while making regions
# can create strange issues # can create strange issues
@ -2553,13 +2553,13 @@ class FlatCAMExcEditor(QtCore.QObject):
for geo in geometry: for geo in geometry:
plot_elements += self.plot_shape(geometry=geo, color=color, linewidth=linewidth) plot_elements += self.plot_shape(geometry=geo, color=color, linewidth=linewidth)
## Non-iterable # ## Non-iterable
except TypeError: except TypeError:
## DrawToolShape # ## DrawToolShape
if isinstance(geometry, DrawToolShape): if isinstance(geometry, DrawToolShape):
plot_elements += self.plot_shape(geometry=geometry.geo, color=color, linewidth=linewidth) 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: if type(geometry) == Polygon:
plot_elements += self.plot_shape(geometry=geometry.exterior, color=color, linewidth=linewidth) plot_elements += self.plot_shape(geometry=geometry.exterior, color=color, linewidth=linewidth)
plot_elements += self.plot_shape(geometry=geometry.interiors, color=color, linewidth=linewidth) plot_elements += self.plot_shape(geometry=geometry.interiors, color=color, linewidth=linewidth)

View File

@ -1,15 +1,15 @@
# ########################################################### # ######################################################### ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
# ########################################################### # ######################################################### ##
# ########################################################### # # ########################################################### #
# File Modified: Marius Adrian Stanciu (c) # # File Modified: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# ########################################################### # ######################################################### ##
from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt, QSettings from PyQt5.QtCore import Qt, QSettings
@ -629,7 +629,7 @@ class TransformEditorTool(FlatCAMTool):
self.transform_lay = QtWidgets.QVBoxLayout() self.transform_lay = QtWidgets.QVBoxLayout()
self.layout.addLayout(self.transform_lay) self.layout.addLayout(self.transform_lay)
## Title # ## Title
title_label = QtWidgets.QLabel("%s" % (_('Editor %s') % self.toolName)) title_label = QtWidgets.QLabel("%s" % (_('Editor %s') % self.toolName))
title_label.setStyleSheet(""" title_label.setStyleSheet("""
QLabel QLabel
@ -2917,9 +2917,9 @@ class FCTransform(FCShapeTool):
self.draw_app.transform_tool.run() self.draw_app.transform_tool.run()
# ####################### # ##################### ##
# ## Main Application ### # # ## Main Application # ##
# ####################### # ##################### ##
class FlatCAMGeoEditor(QtCore.QObject): class FlatCAMGeoEditor(QtCore.QObject):
transform_complete = QtCore.pyqtSignal() transform_complete = QtCore.pyqtSignal()
@ -2935,7 +2935,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
self.app = app self.app = app
self.canvas = app.plotcanvas self.canvas = app.plotcanvas
## Toolbar events and properties # ## Toolbar events and properties
self.tools = { self.tools = {
"select": {"button": self.app.ui.geo_select_btn, "select": {"button": self.app.ui.geo_select_btn,
"constructor": FCSelect}, "constructor": FCSelect},
@ -2965,7 +2965,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
"constructor": FCCopy} "constructor": FCCopy}
} }
# ## Data # # ## Data
self.active_tool = None self.active_tool = None
self.storage = FlatCAMGeoEditor.make_storage() self.storage = FlatCAMGeoEditor.make_storage()
@ -3413,7 +3413,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
if multigeo_tool: if multigeo_tool:
self.multigeo_tool = multigeo_tool self.multigeo_tool = multigeo_tool
geo_to_edit = fcgeometry.flatten(geometry=fcgeometry.tools[self.multigeo_tool]['solid_geometry']) 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'])) format(tool=self.multigeo_tool, dia=fcgeometry.tools[self.multigeo_tool]['tooldia']))
else: else:
geo_to_edit = fcgeometry.flatten() geo_to_edit = fcgeometry.flatten()
@ -3569,7 +3569,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
if self.active_tool is None: if self.active_tool is None:
return return
# ## Snap coordinates # # ## Snap coordinates
if self.app.grid_status(): if self.app.grid_status():
x, y = self.snap(x, y) x, y = self.snap(x, y)
self.app.app_cursor.enabled = True 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): if event.button == 1 and event.is_dragging == 1 and isinstance(self.active_tool, FCEraser):
pass pass
else: else:
# ## Utility geometry (animated) # # ## Utility geometry (animated)
geo = self.active_tool.utility_geometry(data=(x, y)) geo = self.active_tool.utility_geometry(data=(x, y))
if isinstance(geo, DrawToolShape) and geo.geo is not None: if isinstance(geo, DrawToolShape) and geo.geo is not None:
# Remove any previous utility shape # Remove any previous utility shape
self.tool_shape.clear(update=True) self.tool_shape.clear(update=True)
self.draw_utility_geometry(geo=geo) self.draw_utility_geometry(geo=geo)
# ## Selection area on canvas section ### # # ## Selection area on canvas section # ##
dx = pos[0] - self.pos[0] dx = pos[0] - self.pos[0]
if event.is_dragging == 1 and event.button == 1: if event.is_dragging == 1 and event.button == 1:
self.app.delete_selection_shape() self.app.delete_selection_shape()
@ -3938,9 +3938,9 @@ class FlatCAMGeoEditor(QtCore.QObject):
snap_x, snap_y = (x, y) snap_x, snap_y = (x, y)
snap_distance = Inf snap_distance = Inf
# ## Object (corner?) snap # # ## Object (corner?) snap
# ## No need for the objects, just the coordinates # # ## No need for the objects, just the coordinates
# ## in the index. # # ## in the index.
if self.options["corner_snap"]: if self.options["corner_snap"]:
try: try:
nearest_pt, shape = self.storage.nearest((x, y)) nearest_pt, shape = self.storage.nearest((x, y))
@ -3952,7 +3952,7 @@ class FlatCAMGeoEditor(QtCore.QObject):
except (StopIteration, AssertionError): except (StopIteration, AssertionError):
pass pass
# ## Grid snap # # ## Grid snap
if self.options["grid_snap"]: if self.options["grid_snap"]:
if self.options["global_gridx"] != 0: if self.options["global_gridx"] != 0:
snap_x_ = round(x / self.options["global_gridx"]) * self.options['global_gridx'] snap_x_ = round(x / self.options["global_gridx"]) * self.options['global_gridx']

View File

@ -52,7 +52,7 @@ class DrawToolShape(object):
""" """
pts = [] pts = []
## Iterable: descend into each item. # ## Iterable: descend into each item.
try: try:
for sub_o in o: for sub_o in o:
pts += DrawToolShape.get_pts(sub_o) pts += DrawToolShape.get_pts(sub_o)
@ -64,7 +64,7 @@ class DrawToolShape(object):
if isinstance(o, DrawToolShape): if isinstance(o, DrawToolShape):
pts += DrawToolShape.get_pts(o.geo) pts += DrawToolShape.get_pts(o.geo)
## Descend into .exerior and .interiors # ## Descend into .exerior and .interiors
elif type(o) == Polygon: elif type(o) == Polygon:
pts += DrawToolShape.get_pts(o.exterior) pts += DrawToolShape.get_pts(o.exterior)
for i in o.interiors: for i in o.interiors:
@ -72,7 +72,7 @@ class DrawToolShape(object):
elif type(o) == MultiLineString: elif type(o) == MultiLineString:
for line in o: for line in o:
pts += DrawToolShape.get_pts(line) pts += DrawToolShape.get_pts(line)
## Has .coords: list them. # ## Has .coords: list them.
else: else:
if DrawToolShape.tolerance is not None: if DrawToolShape.tolerance is not None:
pts += list(o.simplify(DrawToolShape.tolerance).coords) pts += list(o.simplify(DrawToolShape.tolerance).coords)
@ -2274,7 +2274,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
layout.addLayout(self.custom_box) layout.addLayout(self.custom_box)
# ### Gerber Apertures #### # # ## Gerber Apertures ## ##
self.apertures_table_label = QtWidgets.QLabel(_('<b>Apertures:</b>')) self.apertures_table_label = QtWidgets.QLabel(_('<b>Apertures:</b>'))
self.apertures_table_label.setToolTip( self.apertures_table_label.setToolTip(
_("Apertures Table for the Gerber Object.") _("Apertures Table for the Gerber Object.")
@ -2316,7 +2316,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.apertures_box.setContentsMargins(0, 0, 0, 0) self.apertures_box.setContentsMargins(0, 0, 0, 0)
self.apertures_frame.setLayout(self.apertures_box) self.apertures_frame.setLayout(self.apertures_box)
# ### Add/Delete an new Aperture #### # # ## Add/Delete an new Aperture ## ##
grid1 = QtWidgets.QGridLayout() grid1 = QtWidgets.QGridLayout()
self.apertures_box.addLayout(grid1) self.apertures_box.addLayout(grid1)
@ -2390,7 +2390,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
hlay_ad.addWidget(self.addaperture_btn) hlay_ad.addWidget(self.addaperture_btn)
hlay_ad.addWidget(self.delaperture_btn) hlay_ad.addWidget(self.delaperture_btn)
# ## BUFFER TOOL ### # # ## BUFFER TOOL # ##
self.buffer_tool_frame = QtWidgets.QFrame() self.buffer_tool_frame = QtWidgets.QFrame()
self.buffer_tool_frame.setContentsMargins(0, 0, 0, 0) self.buffer_tool_frame.setContentsMargins(0, 0, 0, 0)
@ -2434,7 +2434,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.buffer_button = QtWidgets.QPushButton(_("Buffer")) self.buffer_button = QtWidgets.QPushButton(_("Buffer"))
hlay_buf.addWidget(self.buffer_button) hlay_buf.addWidget(self.buffer_button)
# ## SCALE TOOL ### # # ## SCALE TOOL # ##
self.scale_tool_frame = QtWidgets.QFrame() self.scale_tool_frame = QtWidgets.QFrame()
self.scale_tool_frame.setContentsMargins(0, 0, 0, 0) 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_box.setContentsMargins(0, 0, 0, 0)
self.array_frame.setLayout(self.array_box) self.array_frame.setLayout(self.array_box)
# ### Add Pad Array #### # # ## Add Pad Array ## ##
self.emptyarray_label = QtWidgets.QLabel('') self.emptyarray_label = QtWidgets.QLabel('')
self.array_box.addWidget(self.emptyarray_label) self.array_box.addWidget(self.emptyarray_label)
@ -2633,7 +2633,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
"constructor": FCApertureMove}, "constructor": FCApertureMove},
} }
# ## Data # # ## Data
self.active_tool = None self.active_tool = None
self.storage_dict = {} self.storage_dict = {}
@ -3479,9 +3479,9 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.gerber_obj.apertures = conv_apertures self.gerber_obj.apertures = conv_apertures
# ############################################################### # ############################################################# ##
# APPLY CLEAR_GEOMETRY on the SOLID_GEOMETRY # APPLY CLEAR_GEOMETRY on the SOLID_GEOMETRY
# ############################################################### # ############################################################# ##
# log.warning("Applying clear geometry in the apertures dict.") # log.warning("Applying clear geometry in the apertures dict.")
# list of clear geos that are to be applied to the entire file # 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: if self.active_tool is None:
return return
# ## Snap coordinates # # ## Snap coordinates
if self.app.grid_status(): if self.app.grid_status():
x, y = self.app.geo_editor.snap(x, y) x, y = self.app.geo_editor.snap(x, y)
self.app.app_cursor.enabled = True self.app.app_cursor.enabled = True
@ -4104,7 +4104,7 @@ class FlatCAMGrbEditor(QtCore.QObject):
self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: " self.app.ui.rel_position_label.setText("<b>Dx</b>: %.4f&nbsp;&nbsp; <b>Dy</b>: "
"%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (dx, dy)) "%.4f&nbsp;&nbsp;&nbsp;&nbsp;" % (dx, dy))
# ## Utility geometry (animated) # # ## Utility geometry (animated)
geo = self.active_tool.utility_geometry(data=(x, y)) geo = self.active_tool.utility_geometry(data=(x, y))
if isinstance(geo, DrawToolShape) and geo.geo is not None: 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.tool_shape.clear(update=True)
self.draw_utility_geometry(geo=geo) 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: 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 # 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 # create strange issues like missing a point in a track/region

View File

@ -1,15 +1,15 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
############################################################ # ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu # # File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 # # Date: 3/10/2019 #
############################################################ # ########################################################## ##
from PyQt5.QtCore import QSettings from PyQt5.QtCore import QSettings
from flatcamGUI.GUIElements import * from flatcamGUI.GUIElements import *
@ -37,16 +37,16 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.app = app self.app = app
# Divine icon pack by Ipapun @ finicons.com # 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() self.menu = self.menuBar()
### File ### # ## File # ##
self.menufile = self.menu.addMenu(_('&File')) self.menufile = self.menu.addMenu(_('&File'))
self.menufile.setToolTipsVisible(True) self.menufile.setToolTipsVisible(True)
@ -226,7 +226,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# exitAction.setStatusTip('Exit application') # exitAction.setStatusTip('Exit application')
self.menufile.addAction(self.menufile_exit) self.menufile.addAction(self.menufile_exit)
### Edit ### # ## Edit # ##
self.menuedit = self.menu.addMenu(_('&Edit')) self.menuedit = self.menu.addMenu(_('&Edit'))
# Separator # Separator
self.menuedit.addSeparator() self.menuedit.addSeparator()
@ -305,7 +305,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.menuedit.addSeparator() self.menuedit.addSeparator()
self.menueditpreferences = self.menuedit.addAction(QtGui.QIcon('share/pref.png'), _('&Preferences\tSHIFT+P')) self.menueditpreferences = self.menuedit.addAction(QtGui.QIcon('share/pref.png'), _('&Preferences\tSHIFT+P'))
### Options ### # ## Options # ##
self.menuoptions = self.menu.addMenu(_('&Options')) self.menuoptions = self.menu.addMenu(_('&Options'))
# self.menuoptions_transfer = self.menuoptions.addMenu(QtGui.QIcon('share/transfer.png'), 'Transfer 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") # self.menuoptions_transfer_a2p = self.menuoptions_transfer.addAction("Application to Project")
@ -344,7 +344,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# Separator # Separator
self.menuoptions.addSeparator() self.menuoptions.addSeparator()
### View ### # ## View # ##
self.menuview = self.menu.addMenu(_('&View')) self.menuview = self.menu.addMenu(_('&View'))
self.menuviewenable = self.menuview.addAction(QtGui.QIcon('share/replot16.png'), _('Enable all plots\tALT+1')) 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'), 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'), self.menuview_toggle_workspace = self.menuview.addAction(QtGui.QIcon('share/workspace24.png'),
_("Toggle Workspace\tSHIFT+W")) _("Toggle Workspace\tSHIFT+W"))
### Tool ### # ## Tool # ##
# self.menutool = self.menu.addMenu('&Tool') # self.menutool = self.menu.addMenu('&Tool')
self.menutool = QtWidgets.QMenu(_('&Tool')) self.menutool = QtWidgets.QMenu(_('&Tool'))
self.menutoolaction = self.menu.addMenu(self.menutool) self.menutoolaction = self.menu.addMenu(self.menutool)
self.menutoolshell = self.menutool.addAction(QtGui.QIcon('share/shell16.png'), _('&Command Line\tS')) self.menutoolshell = self.menutool.addAction(QtGui.QIcon('share/shell16.png'), _('&Command Line\tS'))
### Help ### # ## Help # ##
self.menuhelp = self.menu.addMenu(_('&Help')) self.menuhelp = self.menu.addMenu(_('&Help'))
self.menuhelp_manual = self.menuhelp.addAction(QtGui.QIcon('share/globe16.png'), _('Help\tF1')) 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')) 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')) 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.editor_menu = QtWidgets.QMenu("Editor")
# self.menu.addMenu(self.editor_menu) # self.menu.addMenu(self.editor_menu)
self.geo_editor_menu = QtWidgets.QMenu(">Geo Editor<") 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( self.exc_move_drill_menuitem = self.exc_editor_menu.addAction(
QtGui.QIcon('share/move32.png'),_( 'Move Drill(s)\tM')) 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.grb_editor_menu = QtWidgets.QMenu(_(">Gerber Editor<"))
self.menu.addMenu(self.grb_editor_menu) 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.menuAction().setVisible(False)
self.exc_editor_menu.setDisabled(True) self.exc_editor_menu.setDisabled(True)
# ############################### # ############################# ##
# ## Project Tab Context menu ### # # ## Project Tab Context menu # ##
# ############################### # ############################# ##
self.menuproject = QtWidgets.QMenu() self.menuproject = QtWidgets.QMenu()
self.menuprojectenable = self.menuproject.addAction(QtGui.QIcon('share/replot32.png'), _('Enable Plot')) 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')) self.menuprojectproperties = self.menuproject.addAction(QtGui.QIcon('share/properties32.png'), _('Properties'))
# ############### # ############# ##
# ## Splitter ### # # ## Splitter # ##
# ############### # ############# ##
# IMPORTANT # # IMPORTANT #
# The order: SPITTER -> NOTEBOOK -> SNAP TOOLBAR is important and without it the GUI will not be initialized as # 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.addWidget(self.notebook)
self.splitter_left.setHandleWidth(0) self.splitter_left.setHandleWidth(0)
############### ############# ##
### Toolbar ### # ## Toolbar # ##
############### ############# ##
### TOOLBAR INSTALLATION ### # ## TOOLBAR INSTALLATION # ##
self.toolbarfile = QtWidgets.QToolBar(_('File Toolbar')) self.toolbarfile = QtWidgets.QToolBar(_('File Toolbar'))
self.toolbarfile.setObjectName('File_TB') self.toolbarfile.setObjectName('File_TB')
self.addToolBar(self.toolbarfile) self.addToolBar(self.toolbarfile)
@ -608,7 +608,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.snap_toolbar.setMaximumHeight(30) self.snap_toolbar.setMaximumHeight(30)
self.splitter_left.addWidget(self.snap_toolbar) 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'), self.file_open_gerber_btn = self.toolbarfile.addAction(QtGui.QIcon('share/flatcam_icon32.png'),
_("Open Gerber")) _("Open Gerber"))
self.file_open_excellon_btn = self.toolbarfile.addAction(QtGui.QIcon('share/drill32.png'), _("Open Excellon")) 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_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")) 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.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.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")) 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.toolbargeo.addSeparator()
self.delete_btn = self.toolbargeo.addAction(QtGui.QIcon('share/cancel_edit32.png'), _("&Delete")) 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.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.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")) 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) # self.toolbarview.setVisible(False)
### Shell Toolbar ### # ## Shell Toolbar # ##
self.shell_btn = self.toolbarshell.addAction(QtGui.QIcon('share/shell32.png'), _("&Command Line")) 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.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.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")) 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.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")) 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.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_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/plus16.png'), _('Add Drill Hole'))
self.add_drill_array_btn = self.exc_edit_toolbar.addAction( self.add_drill_array_btn = self.exc_edit_toolbar.addAction(
@ -672,7 +672,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.exc_edit_toolbar.addSeparator() self.exc_edit_toolbar.addSeparator()
self.move_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move Drill")) 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_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_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')) 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_edit_toolbar.addSeparator()
self.geo_move_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move Objects ")) 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_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.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')) 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.grb_edit_toolbar.addSeparator()
self.aperture_move_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move")) 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 # Snap GRID toolbar is always active to facilitate usage of measurements done on GRID
# self.addToolBar(self.snap_toolbar) # 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) self.snap_magnet = self.snap_toolbar.addWidget(self.snap_max_dist_entry)
################ ############## ##
### Notebook ### # ## Notebook # ##
################ ############## ##
### Project ### # ## Project # ##
# self.project_tab = QtWidgets.QWidget() # self.project_tab = QtWidgets.QWidget()
# self.project_tab.setObjectName("project_tab") # self.project_tab.setObjectName("project_tab")
# # project_tab.setMinimumWidth(250) # Hack # # project_tab.setMinimumWidth(250) # Hack
@ -791,7 +791,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.notebook.addTab(self.project_tab, _("Project")) self.notebook.addTab(self.project_tab, _("Project"))
self.project_frame.setDisabled(False) self.project_frame.setDisabled(False)
### Selected ### # ## Selected # ##
self.selected_tab = QtWidgets.QWidget() self.selected_tab = QtWidgets.QWidget()
self.selected_tab.setObjectName("selected_tab") self.selected_tab.setObjectName("selected_tab")
self.selected_tab_layout = QtWidgets.QVBoxLayout(self.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.selected_tab_layout.addWidget(self.selected_scroll_area)
self.notebook.addTab(self.selected_tab, _("Selected")) self.notebook.addTab(self.selected_tab, _("Selected"))
### Tool ### # ## Tool # ##
self.tool_tab = QtWidgets.QWidget() self.tool_tab = QtWidgets.QWidget()
self.tool_tab.setObjectName("tool_tab") self.tool_tab.setObjectName("tool_tab")
self.tool_tab_layout = QtWidgets.QVBoxLayout(self.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 # 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) 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.preferences_tab = QtWidgets.QWidget()
self.pref_tab_layout = QtWidgets.QVBoxLayout(self.preferences_tab) self.pref_tab_layout = QtWidgets.QVBoxLayout(self.preferences_tab)
self.pref_tab_layout.setContentsMargins(2, 2, 2, 2) 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.")) "which is the file storing the working default preferences."))
self.pref_tab_bottom_layout_2.addWidget(self.pref_save_button) 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.shortcuts_tab = QtWidgets.QWidget()
self.sh_tab_layout = QtWidgets.QVBoxLayout() self.sh_tab_layout = QtWidgets.QVBoxLayout()
self.sh_tab_layout.setContentsMargins(2, 2, 2, 2) self.sh_tab_layout.setContentsMargins(2, 2, 2, 2)
@ -1574,9 +1574,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.sh_hlay.addWidget(self.sh_editor) 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 = FCMenu()
self.popmenu_disable = self.popMenu.addAction(QtGui.QIcon('share/disable32.png'), _("Disable Plot")) 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")) 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 = QtWidgets.QWidget()
self.cncjob_tab_layout = QtWidgets.QGridLayout(self.cncjob_tab) self.cncjob_tab_layout = QtWidgets.QGridLayout(self.cncjob_tab)
self.cncjob_tab_layout.setContentsMargins(2, 2, 2, 2) self.cncjob_tab_layout.setContentsMargins(2, 2, 2, 2)
@ -1687,9 +1687,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
cnc_tab_lay_4.addWidget(self.buttonSave) cnc_tab_lay_4.addWidget(self.buttonSave)
self.cncjob_tab_layout.addLayout(cnc_tab_lay_4, 2, 4, 1, 1) 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.infobar = self.statusBar()
self.fcinfo = FlatCAMInfoBar() self.fcinfo = FlatCAMInfoBar()
self.infobar.addWidget(self.fcinfo, stretch=1) self.infobar.addWidget(self.fcinfo, stretch=1)
@ -1744,9 +1744,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# log.debug("FlatCAMGUI.__init__() --> UI state not restored. IOError") # log.debug("FlatCAMGUI.__init__() --> UI state not restored. IOError")
# pass # pass
###################### #################### ##
### INITIALIZE GUI ### # ## INITIALIZE GUI # ##
###################### #################### ##
self.grid_snap_btn.setCheckable(True) self.grid_snap_btn.setCheckable(True)
self.corner_snap_btn.setCheckable(True) self.corner_snap_btn.setCheckable(True)
@ -1831,7 +1831,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
def populate_toolbars(self): def populate_toolbars(self):
### File Toolbar ### # ## File Toolbar # ##
self.file_open_gerber_btn = self.toolbarfile.addAction(QtGui.QIcon('share/flatcam_icon32.png'), self.file_open_gerber_btn = self.toolbarfile.addAction(QtGui.QIcon('share/flatcam_icon32.png'),
_("Open Gerber")) _("Open Gerber"))
self.file_open_excellon_btn = self.toolbarfile.addAction(QtGui.QIcon('share/drill32.png'), _("Open Excellon")) 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_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")) 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.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.newexc_btn = self.toolbargeo.addAction(QtGui.QIcon('share/new_exc32.png'), _("New Blank Excellon"))
self.toolbargeo.addSeparator() self.toolbargeo.addSeparator()
@ -1851,7 +1851,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.toolbargeo.addSeparator() self.toolbargeo.addSeparator()
self.delete_btn = self.toolbargeo.addAction(QtGui.QIcon('share/cancel_edit32.png'), _("&Delete")) 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.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.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")) 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) # self.toolbarview.setVisible(False)
### Shell Toolbar ### # ## Shell Toolbar # ##
self.shell_btn = self.toolbarshell.addAction(QtGui.QIcon('share/shell32.png'), _("&Command Line")) 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.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.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")) self.ncc_btn = self.toolbartools.addAction(QtGui.QIcon('share/ncc16.png'), _("NCC Tool"))
@ -1882,7 +1882,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
_("Calculators Tool")) _("Calculators Tool"))
self.transform_btn = self.toolbartools.addAction(QtGui.QIcon('share/transform.png'), _("Transform 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.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_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/plus16.png'), _('Add Drill Hole'))
self.add_drill_array_btn = self.exc_edit_toolbar.addAction( self.add_drill_array_btn = self.exc_edit_toolbar.addAction(
@ -1897,7 +1897,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.exc_edit_toolbar.addSeparator() self.exc_edit_toolbar.addSeparator()
self.move_drill_btn = self.exc_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move Drill")) 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_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_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')) 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_edit_toolbar.addSeparator()
self.geo_move_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move Objects")) 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_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.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')) 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.grb_edit_toolbar.addSeparator()
self.aperture_move_btn = self.grb_edit_toolbar.addAction(QtGui.QIcon('share/move32.png'), _("Move")) 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 # Snap GRID toolbar is always active to facilitate usage of measurements done on GRID
# self.addToolBar(self.snap_toolbar) # self.addToolBar(self.snap_toolbar)
@ -2813,7 +2813,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# Add Track # Add Track
if key == QtCore.Qt.Key_T or key == 'T': if key == QtCore.Qt.Key_T or key == 'T':
self.app.grb_editor.launched_from_shortcuts = True 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') self.app.grb_editor.select_tool('track')
return return
@ -2990,7 +2990,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
# Add Tool # Add Tool
if key == QtCore.Qt.Key_T or key == 'T': if key == QtCore.Qt.Key_T or key == 'T':
self.app.exc_editor.launched_from_shortcuts = True 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() self.units = self.general_defaults_form.general_app_group.units_radio.get_value().upper()
tool_add_popup = FCInputDialog(title=_("New Tool ..."), tool_add_popup = FCInputDialog(title=_("New Tool ..."),
text=_('Enter a Tool Diameter:'), text=_('Enter a Tool Diameter:'),
@ -3996,7 +3996,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI):
self.setTitle(str("Gerber General")) self.setTitle(str("Gerber General"))
## Plot options # ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>")) self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>"))
self.layout.addWidget(self.plot_options_label) self.layout.addWidget(self.plot_options_label)
@ -4045,7 +4045,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Gerber Options"))) self.setTitle(str(_("Gerber Options")))
## Isolation Routing # ## Isolation Routing
self.isolation_routing_label = QtWidgets.QLabel(_("<b>Isolation Routing:</b>")) self.isolation_routing_label = QtWidgets.QLabel(_("<b>Isolation Routing:</b>"))
self.isolation_routing_label.setToolTip( self.isolation_routing_label.setToolTip(
_("Create a Geometry object with\n" _("Create a Geometry object with\n"
@ -4104,7 +4104,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
) )
grid0.addWidget(self.combine_passes_cb, 4, 0) grid0.addWidget(self.combine_passes_cb, 4, 0)
## Clear non-copper regions # ## Clear non-copper regions
self.clearcopper_label = QtWidgets.QLabel(_("<b>Clear non-copper:</b>")) self.clearcopper_label = QtWidgets.QLabel(_("<b>Clear non-copper:</b>"))
self.clearcopper_label.setToolTip( self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n" _("Create a Geometry object with\n"
@ -4135,7 +4135,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI):
) )
grid1.addWidget(self.noncopper_rounded_cb, 1, 0, 1, 2) grid1.addWidget(self.noncopper_rounded_cb, 1, 0, 1, 2)
## Bounding box # ## Bounding box
self.boundingbox_label = QtWidgets.QLabel(_('<b>Bounding Box:</b>')) self.boundingbox_label = QtWidgets.QLabel(_('<b>Bounding Box:</b>'))
self.layout.addWidget(self.boundingbox_label) self.layout.addWidget(self.boundingbox_label)
@ -4170,7 +4170,7 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Gerber Adv. Options"))) self.setTitle(str(_("Gerber Adv. Options")))
## Advanced Gerber Parameters # ## Advanced Gerber Parameters
self.adv_param_label = QtWidgets.QLabel(_("<b>Advanced Param.:</b>")) self.adv_param_label = QtWidgets.QLabel(_("<b>Advanced Param.:</b>"))
self.adv_param_label.setToolTip( self.adv_param_label.setToolTip(
_("A list of Gerber advanced parameters.\n" _("A list of Gerber advanced parameters.\n"
@ -4619,7 +4619,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Excellon Options"))) self.setTitle(str(_("Excellon Options")))
## Create CNC Job # ## Create CNC Job
self.cncjob_label = QtWidgets.QLabel(_('<b>Create CNC Job</b>')) self.cncjob_label = QtWidgets.QLabel(_('<b>Create CNC Job</b>'))
self.cncjob_label.setToolTip( self.cncjob_label.setToolTip(
_("Parameters used to create a CNC Job object\n" _("Parameters used to create a CNC Job object\n"
@ -4748,7 +4748,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI):
excellon_gcode_type_label.hide() excellon_gcode_type_label.hide()
self.excellon_gcode_type_radio.setVisible(False) self.excellon_gcode_type_radio.setVisible(False)
#### Milling Holes #### #### Milling Holes ## ##
self.mill_hole_label = QtWidgets.QLabel(_('<b>Mill Holes</b>')) self.mill_hole_label = QtWidgets.QLabel(_('<b>Mill Holes</b>'))
self.mill_hole_label.setToolTip( self.mill_hole_label.setToolTip(
_("Create Geometry for milling holes.") _("Create Geometry for milling holes.")
@ -4793,9 +4793,9 @@ class ExcellonAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Excellon Adv. Options"))) self.setTitle(str(_("Excellon Adv. Options")))
###################### #################### ##
## ADVANCED OPTIONS ## # ## ADVANCED OPTIONS # ##
###################### #################### ##
self.cncjob_label = QtWidgets.QLabel(_('<b>Advanced Options:</b>')) self.cncjob_label = QtWidgets.QLabel(_('<b>Advanced Options:</b>'))
self.cncjob_label.setToolTip( self.cncjob_label.setToolTip(
@ -5035,7 +5035,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Geometry General"))) self.setTitle(str(_("Geometry General")))
## Plot options # ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>")) self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>"))
self.layout.addWidget(self.plot_options_label) self.layout.addWidget(self.plot_options_label)
@ -5086,7 +5086,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Geometry Options"))) self.setTitle(str(_("Geometry Options")))
# ------------------------------ # ------------------------------
## Create CNC Job # ## Create CNC Job
# ------------------------------ # ------------------------------
self.cncjob_label = QtWidgets.QLabel(_('<b>Create CNC Job:</b>')) self.cncjob_label = QtWidgets.QLabel(_('<b>Create CNC Job:</b>'))
self.cncjob_label.setToolTip( self.cncjob_label.setToolTip(
@ -5245,7 +5245,7 @@ class GeometryAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Geometry Adv. Options"))) self.setTitle(str(_("Geometry Adv. Options")))
# ------------------------------ # ------------------------------
## Advanced Options # ## Advanced Options
# ------------------------------ # ------------------------------
self.cncjob_label = QtWidgets.QLabel(_('<b>Advanced Options:</b>')) self.cncjob_label = QtWidgets.QLabel(_('<b>Advanced Options:</b>'))
self.cncjob_label.setToolTip( self.cncjob_label.setToolTip(
@ -5407,7 +5407,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("CNC Job General"))) self.setTitle(str(_("CNC Job General")))
## Plot options # ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>")) self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>"))
self.layout.addWidget(self.plot_options_label) self.layout.addWidget(self.plot_options_label)
@ -5493,7 +5493,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("CNC Job Options"))) self.setTitle(str(_("CNC Job Options")))
## Export G-Code # ## Export G-Code
self.export_gcode_label = QtWidgets.QLabel(_("<b>Export G-Code:</b>")) self.export_gcode_label = QtWidgets.QLabel(_("<b>Export G-Code:</b>"))
self.export_gcode_label.setToolTip( self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n" _("Export and save G-Code to\n"
@ -5534,7 +5534,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("CNC Job Adv. Options"))) self.setTitle(str(_("CNC Job Adv. Options")))
## Export G-Code # ## Export G-Code
self.export_gcode_label = QtWidgets.QLabel(_("<b>Export G-Code:</b>")) self.export_gcode_label = QtWidgets.QLabel(_("<b>Export G-Code:</b>"))
self.export_gcode_label.setToolTip( self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n" _("Export and save G-Code to\n"
@ -5617,7 +5617,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("NCC Tool Options"))) self.setTitle(str(_("NCC Tool Options")))
## Clear non-copper regions # ## Clear non-copper regions
self.clearcopper_label = QtWidgets.QLabel(_("<b>Parameters:</b>")) self.clearcopper_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.clearcopper_label.setToolTip( self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n" _("Create a Geometry object with\n"
@ -5718,7 +5718,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Cutout Tool Options"))) self.setTitle(str(_("Cutout Tool Options")))
## Board cuttout # ## Board cuttout
self.board_cutout_label = QtWidgets.QLabel(_("<b>Parameters:</b>")) self.board_cutout_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.board_cutout_label.setToolTip( self.board_cutout_label.setToolTip(
_("Create toolpaths to cut around\n" _("Create toolpaths to cut around\n"
@ -5797,7 +5797,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("2Sided Tool Options"))) self.setTitle(str(_("2Sided Tool Options")))
## Board cuttout # ## Board cuttout
self.dblsided_label = QtWidgets.QLabel(_("<b>Parameters:</b>")) self.dblsided_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.dblsided_label.setToolTip( self.dblsided_label.setToolTip(
_("A tool to help in creating a double sided\n" _("A tool to help in creating a double sided\n"
@ -5808,7 +5808,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout() grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0) self.layout.addLayout(grid0)
## Drill diameter for alignment holes # ## Drill diameter for alignment holes
self.drill_dia_entry = LengthEntry() self.drill_dia_entry = LengthEntry()
self.dd_label = QtWidgets.QLabel(_("Drill diam.:")) self.dd_label = QtWidgets.QLabel(_("Drill diam.:"))
self.dd_label.setToolTip( self.dd_label.setToolTip(
@ -5818,7 +5818,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.dd_label, 0, 0) grid0.addWidget(self.dd_label, 0, 0)
grid0.addWidget(self.drill_dia_entry, 0, 1) grid0.addWidget(self.drill_dia_entry, 0, 1)
## Axis # ## Axis
self.mirror_axis_radio = RadioSet([{'label': 'X', 'value': 'X'}, self.mirror_axis_radio = RadioSet([{'label': 'X', 'value': 'X'},
{'label': 'Y', 'value': 'Y'}]) {'label': 'Y', 'value': 'Y'}])
self.mirax_label = QtWidgets.QLabel(_("Mirror Axis:")) self.mirax_label = QtWidgets.QLabel(_("Mirror Axis:"))
@ -5831,7 +5831,7 @@ class Tools2sidedPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.mirax_label, 2, 0) grid0.addWidget(self.mirax_label, 2, 0)
grid0.addWidget(self.mirror_axis_radio, 2, 1) grid0.addWidget(self.mirror_axis_radio, 2, 1)
## Axis Location # ## Axis Location
self.axis_location_radio = RadioSet([{'label': 'Point', 'value': 'point'}, self.axis_location_radio = RadioSet([{'label': 'Point', 'value': 'point'},
{'label': 'Box', 'value': 'box'}]) {'label': 'Box', 'value': 'box'}])
self.axloc_label = QtWidgets.QLabel(_("Axis Ref:")) self.axloc_label = QtWidgets.QLabel(_("Axis Ref:"))
@ -5855,7 +5855,7 @@ class ToolsPaintPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Paint Tool Options"))) self.setTitle(str(_("Paint Tool Options")))
# ------------------------------ # ------------------------------
## Paint area # ## Paint area
# ------------------------------ # ------------------------------
self.paint_label = QtWidgets.QLabel(_('<b>Parameters:</b>')) self.paint_label = QtWidgets.QLabel(_('<b>Parameters:</b>'))
self.paint_label.setToolTip( self.paint_label.setToolTip(
@ -5959,7 +5959,7 @@ class ToolsFilmPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Film Tool Options"))) self.setTitle(str(_("Film Tool Options")))
## Board cuttout # ## Board cuttout
self.film_label = QtWidgets.QLabel(_("<b>Parameters:</b>")) self.film_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.film_label.setToolTip( self.film_label.setToolTip(
_("Create a PCB film from a Gerber or Geometry\n" _("Create a PCB film from a Gerber or Geometry\n"
@ -6020,7 +6020,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Panelize Tool Options"))) self.setTitle(str(_("Panelize Tool Options")))
## Board cuttout # ## Board cuttout
self.panelize_label = QtWidgets.QLabel(_("<b>Parameters:</b>")) self.panelize_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.panelize_label.setToolTip( self.panelize_label.setToolTip(
_("Create an object that contains an array of (x, y) elements,\n" _("Create an object that contains an array of (x, y) elements,\n"
@ -6032,7 +6032,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout() grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0) self.layout.addLayout(grid0)
## Spacing Columns # ## Spacing Columns
self.pspacing_columns = FCEntry() self.pspacing_columns = FCEntry()
self.spacing_columns_label = QtWidgets.QLabel(_("Spacing cols:")) self.spacing_columns_label = QtWidgets.QLabel(_("Spacing cols:"))
self.spacing_columns_label.setToolTip( self.spacing_columns_label.setToolTip(
@ -6042,7 +6042,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.spacing_columns_label, 0, 0) grid0.addWidget(self.spacing_columns_label, 0, 0)
grid0.addWidget(self.pspacing_columns, 0, 1) grid0.addWidget(self.pspacing_columns, 0, 1)
## Spacing Rows # ## Spacing Rows
self.pspacing_rows = FCEntry() self.pspacing_rows = FCEntry()
self.spacing_rows_label = QtWidgets.QLabel(_("Spacing rows:")) self.spacing_rows_label = QtWidgets.QLabel(_("Spacing rows:"))
self.spacing_rows_label.setToolTip( self.spacing_rows_label.setToolTip(
@ -6052,7 +6052,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.spacing_rows_label, 1, 0) grid0.addWidget(self.spacing_rows_label, 1, 0)
grid0.addWidget(self.pspacing_rows, 1, 1) grid0.addWidget(self.pspacing_rows, 1, 1)
## Columns # ## Columns
self.pcolumns = FCEntry() self.pcolumns = FCEntry()
self.columns_label = QtWidgets.QLabel(_("Columns:")) self.columns_label = QtWidgets.QLabel(_("Columns:"))
self.columns_label.setToolTip( self.columns_label.setToolTip(
@ -6061,7 +6061,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.columns_label, 2, 0) grid0.addWidget(self.columns_label, 2, 0)
grid0.addWidget(self.pcolumns, 2, 1) grid0.addWidget(self.pcolumns, 2, 1)
## Rows # ## Rows
self.prows = FCEntry() self.prows = FCEntry()
self.rows_label = QtWidgets.QLabel(_("Rows:")) self.rows_label = QtWidgets.QLabel(_("Rows:"))
self.rows_label.setToolTip( self.rows_label.setToolTip(
@ -6070,7 +6070,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.rows_label, 3, 0) grid0.addWidget(self.rows_label, 3, 0)
grid0.addWidget(self.prows, 3, 1) 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'}, self.panel_type_radio = RadioSet([{'label': 'Gerber', 'value': 'gerber'},
{'label': 'Geo', 'value': 'geometry'}]) {'label': 'Geo', 'value': 'geometry'}])
self.panel_type_label = QtWidgets.QLabel(_("Panel Type:")) 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_label, 4, 0)
grid0.addWidget(self.panel_type_radio, 4, 1) grid0.addWidget(self.panel_type_radio, 4, 1)
## Constrains # ## Constrains
self.pconstrain_cb = FCCheckBox(_("Constrain within:")) self.pconstrain_cb = FCCheckBox(_("Constrain within:"))
self.pconstrain_cb.setToolTip( self.pconstrain_cb.setToolTip(
_("Area define by DX and DY within to constrain the panel.\n" _("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"))) self.setTitle(str(_("Calculators Tool Options")))
## V-shape Calculator Tool # ## V-shape Calculator Tool
self.vshape_tool_label = QtWidgets.QLabel(_("<b>V-Shape Tool Calculator:</b>")) self.vshape_tool_label = QtWidgets.QLabel(_("<b>V-Shape Tool Calculator:</b>"))
self.vshape_tool_label.setToolTip( self.vshape_tool_label.setToolTip(
_("Calculate the tool diameter for a given V-shape tool,\n" _("Calculate the tool diameter for a given V-shape tool,\n"
@ -6134,7 +6134,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout() grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0) self.layout.addLayout(grid0)
## Tip Diameter # ## Tip Diameter
self.tip_dia_entry = FCEntry() self.tip_dia_entry = FCEntry()
self.tip_dia_label = QtWidgets.QLabel(_("Tip Diameter:")) self.tip_dia_label = QtWidgets.QLabel(_("Tip Diameter:"))
self.tip_dia_label.setToolTip( 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_label, 0, 0)
grid0.addWidget(self.tip_dia_entry, 0, 1) grid0.addWidget(self.tip_dia_entry, 0, 1)
## Tip angle # ## Tip angle
self.tip_angle_entry = FCEntry() self.tip_angle_entry = FCEntry()
self.tip_angle_label = QtWidgets.QLabel(_("Tip angle:")) self.tip_angle_label = QtWidgets.QLabel(_("Tip angle:"))
self.tip_angle_label.setToolTip( 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_label, 1, 0)
grid0.addWidget(self.tip_angle_entry, 1, 1) 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_entry = FCEntry()
self.cut_z_label = QtWidgets.QLabel(_("Cut Z:")) self.cut_z_label = QtWidgets.QLabel(_("Cut Z:"))
self.cut_z_label.setToolTip( 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_label, 2, 0)
grid0.addWidget(self.cut_z_entry, 2, 1) grid0.addWidget(self.cut_z_entry, 2, 1)
## Electroplating Calculator Tool # ## Electroplating Calculator Tool
self.plate_title_label = QtWidgets.QLabel(_("<b>ElectroPlating Calculator:</b>")) self.plate_title_label = QtWidgets.QLabel(_("<b>ElectroPlating Calculator:</b>"))
self.plate_title_label.setToolTip( self.plate_title_label.setToolTip(
_("This calculator is useful for those who plate the via/pad/drill holes,\n" _("This calculator is useful for those who plate the via/pad/drill holes,\n"
@ -6175,7 +6175,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1 = QtWidgets.QGridLayout() grid1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid1) self.layout.addLayout(grid1)
## PCB Length # ## PCB Length
self.pcblength_entry = FCEntry() self.pcblength_entry = FCEntry()
self.pcblengthlabel = QtWidgets.QLabel(_("Board Length:")) self.pcblengthlabel = QtWidgets.QLabel(_("Board Length:"))
@ -6183,7 +6183,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.pcblengthlabel, 0, 0) grid1.addWidget(self.pcblengthlabel, 0, 0)
grid1.addWidget(self.pcblength_entry, 0, 1) grid1.addWidget(self.pcblength_entry, 0, 1)
## PCB Width # ## PCB Width
self.pcbwidth_entry = FCEntry() self.pcbwidth_entry = FCEntry()
self.pcbwidthlabel = QtWidgets.QLabel(_("Board Width:")) self.pcbwidthlabel = QtWidgets.QLabel(_("Board Width:"))
@ -6191,7 +6191,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.pcbwidthlabel, 1, 0) grid1.addWidget(self.pcbwidthlabel, 1, 0)
grid1.addWidget(self.pcbwidth_entry, 1, 1) grid1.addWidget(self.pcbwidth_entry, 1, 1)
## Current Density # ## Current Density
self.cdensity_label = QtWidgets.QLabel(_("Current Density:")) self.cdensity_label = QtWidgets.QLabel(_("Current Density:"))
self.cdensity_entry = FCEntry() self.cdensity_entry = FCEntry()
@ -6200,7 +6200,7 @@ class ToolsCalculatorsPrefGroupUI(OptionsGroupUI):
grid1.addWidget(self.cdensity_label, 2, 0) grid1.addWidget(self.cdensity_label, 2, 0)
grid1.addWidget(self.cdensity_entry, 2, 1) grid1.addWidget(self.cdensity_entry, 2, 1)
## PCB Copper Growth # ## PCB Copper Growth
self.growth_label = QtWidgets.QLabel(_("Copper Growth:")) self.growth_label = QtWidgets.QLabel(_("Copper Growth:"))
self.growth_entry = FCEntry() self.growth_entry = FCEntry()
@ -6219,7 +6219,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("Transform Tool Options"))) self.setTitle(str(_("Transform Tool Options")))
## Transformations # ## Transformations
self.transform_label = QtWidgets.QLabel(_("<b>Parameters:</b>")) self.transform_label = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.transform_label.setToolTip( self.transform_label.setToolTip(
_("Various transformations that can be applied\n" _("Various transformations that can be applied\n"
@ -6230,7 +6230,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout() grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0) self.layout.addLayout(grid0)
## Rotate Angle # ## Rotate Angle
self.rotate_entry = FCEntry() self.rotate_entry = FCEntry()
self.rotate_label = QtWidgets.QLabel(_("Rotate Angle:")) self.rotate_label = QtWidgets.QLabel(_("Rotate Angle:"))
self.rotate_label.setToolTip( self.rotate_label.setToolTip(
@ -6239,7 +6239,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.rotate_label, 0, 0) grid0.addWidget(self.rotate_label, 0, 0)
grid0.addWidget(self.rotate_entry, 0, 1) 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_entry = FCEntry()
self.skewx_label = QtWidgets.QLabel(_("Skew_X angle:")) self.skewx_label = QtWidgets.QLabel(_("Skew_X angle:"))
self.skewx_label.setToolTip( self.skewx_label.setToolTip(
@ -6248,7 +6248,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.skewx_label, 1, 0) grid0.addWidget(self.skewx_label, 1, 0)
grid0.addWidget(self.skewx_entry, 1, 1) 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_entry = FCEntry()
self.skewy_label = QtWidgets.QLabel(_("Skew_Y angle:")) self.skewy_label = QtWidgets.QLabel(_("Skew_Y angle:"))
self.skewy_label.setToolTip( self.skewy_label.setToolTip(
@ -6257,7 +6257,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.skewy_label, 2, 0) grid0.addWidget(self.skewy_label, 2, 0)
grid0.addWidget(self.skewy_entry, 2, 1) grid0.addWidget(self.skewy_entry, 2, 1)
## Scale factor on X axis # ## Scale factor on X axis
self.scalex_entry = FCEntry() self.scalex_entry = FCEntry()
self.scalex_label = QtWidgets.QLabel(_("Scale_X factor:")) self.scalex_label = QtWidgets.QLabel(_("Scale_X factor:"))
self.scalex_label.setToolTip( self.scalex_label.setToolTip(
@ -6266,7 +6266,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.scalex_label, 3, 0) grid0.addWidget(self.scalex_label, 3, 0)
grid0.addWidget(self.scalex_entry, 3, 1) grid0.addWidget(self.scalex_entry, 3, 1)
## Scale factor on X axis # ## Scale factor on X axis
self.scaley_entry = FCEntry() self.scaley_entry = FCEntry()
self.scaley_label = QtWidgets.QLabel(_("Scale_Y factor:")) self.scaley_label = QtWidgets.QLabel(_("Scale_Y factor:"))
self.scaley_label.setToolTip( self.scaley_label.setToolTip(
@ -6275,7 +6275,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.scaley_label, 4, 0) grid0.addWidget(self.scaley_label, 4, 0)
grid0.addWidget(self.scaley_entry, 4, 1) grid0.addWidget(self.scaley_entry, 4, 1)
## Link Scale factors # ## Link Scale factors
self.link_cb = FCCheckBox(_("Link")) self.link_cb = FCCheckBox(_("Link"))
self.link_cb.setToolTip( self.link_cb.setToolTip(
_("Scale the selected object(s)\n" _("Scale the selected object(s)\n"
@ -6283,7 +6283,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
) )
grid0.addWidget(self.link_cb, 5, 0) grid0.addWidget(self.link_cb, 5, 0)
## Scale Reference # ## Scale Reference
self.reference_cb = FCCheckBox(_("Scale Reference")) self.reference_cb = FCCheckBox(_("Scale Reference"))
self.reference_cb.setToolTip( self.reference_cb.setToolTip(
_("Scale the selected object(s)\n" _("Scale the selected object(s)\n"
@ -6293,7 +6293,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
) )
grid0.addWidget(self.reference_cb, 5, 1) grid0.addWidget(self.reference_cb, 5, 1)
## Offset distance on X axis # ## Offset distance on X axis
self.offx_entry = FCEntry() self.offx_entry = FCEntry()
self.offx_label = QtWidgets.QLabel(_("Offset_X val:")) self.offx_label = QtWidgets.QLabel(_("Offset_X val:"))
self.offx_label.setToolTip( self.offx_label.setToolTip(
@ -6302,7 +6302,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.offx_label, 6, 0) grid0.addWidget(self.offx_label, 6, 0)
grid0.addWidget(self.offx_entry, 6, 1) grid0.addWidget(self.offx_entry, 6, 1)
## Offset distance on Y axis # ## Offset distance on Y axis
self.offy_entry = FCEntry() self.offy_entry = FCEntry()
self.offy_label = QtWidgets.QLabel(_("Offset_Y val:")) self.offy_label = QtWidgets.QLabel(_("Offset_Y val:"))
self.offy_label.setToolTip( self.offy_label.setToolTip(
@ -6311,7 +6311,7 @@ class ToolsTransformPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.offy_label, 7, 0) grid0.addWidget(self.offy_label, 7, 0)
grid0.addWidget(self.offy_entry, 7, 1) 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 = FCCheckBox(_("Mirror Reference"))
self.mirror_reference_cb.setToolTip( self.mirror_reference_cb.setToolTip(
_("Flip the selected object(s)\n" _("Flip the selected object(s)\n"
@ -6346,7 +6346,7 @@ class ToolsSolderpastePrefGroupUI(OptionsGroupUI):
self.setTitle(str(_("SolderPaste Tool Options"))) self.setTitle(str(_("SolderPaste Tool Options")))
## Solder Paste Dispensing # ## Solder Paste Dispensing
self.solderpastelabel = QtWidgets.QLabel(_("<b>Parameters:</b>")) self.solderpastelabel = QtWidgets.QLabel(_("<b>Parameters:</b>"))
self.solderpastelabel.setToolTip( self.solderpastelabel.setToolTip(
_("A tool to create GCode for dispensing\n" _("A tool to create GCode for dispensing\n"

View File

@ -1,15 +1,15 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
############################################################ # ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu # # File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 # # Date: 3/10/2019 #
############################################################ # ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot from PyQt5.QtCore import Qt, pyqtSignal, pyqtSlot

View File

@ -1,15 +1,15 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
############################################################ # ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu # # File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 # # Date: 3/10/2019 #
############################################################ # ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt
@ -36,22 +36,22 @@ class ObjectUI(QtWidgets.QWidget):
layout = QtWidgets.QVBoxLayout() layout = QtWidgets.QVBoxLayout()
self.setLayout(layout) self.setLayout(layout)
## Page Title box (spacing between children) # ## Page Title box (spacing between children)
self.title_box = QtWidgets.QHBoxLayout() self.title_box = QtWidgets.QHBoxLayout()
layout.addLayout(self.title_box) layout.addLayout(self.title_box)
## Page Title icon # ## Page Title icon
pixmap = QtGui.QPixmap(icon_file) pixmap = QtGui.QPixmap(icon_file)
self.icon = QtWidgets.QLabel() self.icon = QtWidgets.QLabel()
self.icon.setPixmap(pixmap) self.icon.setPixmap(pixmap)
self.title_box.addWidget(self.icon, stretch=0) self.title_box.addWidget(self.icon, stretch=0)
## Title label # ## Title label
self.title_label = QtWidgets.QLabel("<font size=5><b>%s</b></font>" % title) self.title_label = QtWidgets.QLabel("<font size=5><b>%s</b></font>" % title)
self.title_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter) self.title_label.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
self.title_box.addWidget(self.title_label, stretch=1) self.title_box.addWidget(self.title_label, stretch=1)
## App Level label # ## App Level label
self.level = QtWidgets.QLabel("") self.level = QtWidgets.QLabel("")
self.level.setToolTip( self.level.setToolTip(
_( _(
@ -66,16 +66,16 @@ class ObjectUI(QtWidgets.QWidget):
self.level.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.level.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter)
self.title_box.addWidget(self.level) self.title_box.addWidget(self.level)
## Box box for custom widgets # ## Box box for custom widgets
# This gets populated in offspring implementations. # This gets populated in offspring implementations.
self.custom_box = QtWidgets.QVBoxLayout() self.custom_box = QtWidgets.QVBoxLayout()
layout.addLayout(self.custom_box) layout.addLayout(self.custom_box)
########################### ######################### ##
## Common to all objects ## # ## Common to all objects # ##
########################### ######################### ##
#### Scale #### #### Scale ## ##
self.scale_label = QtWidgets.QLabel(_('<b>Scale:</b>')) self.scale_label = QtWidgets.QLabel(_('<b>Scale:</b>'))
self.scale_label.setToolTip( self.scale_label.setToolTip(
_("Change the size of the object.") _("Change the size of the object.")
@ -104,7 +104,7 @@ class ObjectUI(QtWidgets.QWidget):
self.scale_button.setFixedWidth(70) self.scale_button.setFixedWidth(70)
self.scale_grid.addWidget(self.scale_button, 0, 2) self.scale_grid.addWidget(self.scale_button, 0, 2)
#### Offset #### #### Offset ## ##
self.offset_label = QtWidgets.QLabel(_('<b>Offset:</b>')) self.offset_label = QtWidgets.QLabel(_('<b>Offset:</b>'))
self.offset_label.setToolTip( self.offset_label.setToolTip(
_("Change the position of this object.") _("Change the position of this object.")
@ -176,7 +176,7 @@ class GerberObjectUI(ObjectUI):
self.plot_cb.setFixedWidth(59) self.plot_cb.setFixedWidth(59)
grid0.addWidget(self.plot_cb, 0, 3) grid0.addWidget(self.plot_cb, 0, 3)
## Object name # ## Object name
self.name_hlay = QtWidgets.QHBoxLayout() self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay) self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("<b>Name:</b>")) name_label = QtWidgets.QLabel(_("<b>Name:</b>"))
@ -188,7 +188,7 @@ class GerberObjectUI(ObjectUI):
hlay_plot = QtWidgets.QHBoxLayout() hlay_plot = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(hlay_plot) self.custom_box.addLayout(hlay_plot)
#### Gerber Apertures #### #### Gerber Apertures ## ##
self.apertures_table_label = QtWidgets.QLabel(_('<b>Apertures:</b>')) self.apertures_table_label = QtWidgets.QLabel(_('<b>Apertures:</b>'))
self.apertures_table_label.setToolTip( self.apertures_table_label.setToolTip(
_("Apertures Table for the Gerber Object.") _("Apertures Table for the Gerber Object.")
@ -380,7 +380,7 @@ class GerberObjectUI(ObjectUI):
grid2 = QtWidgets.QGridLayout() grid2 = QtWidgets.QGridLayout()
self.custom_box.addLayout(grid2) self.custom_box.addLayout(grid2)
## Clear non-copper regions # ## Clear non-copper regions
self.clearcopper_label = QtWidgets.QLabel(_("<b>Clear N-copper:</b>")) self.clearcopper_label = QtWidgets.QLabel(_("<b>Clear N-copper:</b>"))
self.clearcopper_label.setToolTip( self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n" _("Create a Geometry object with\n"
@ -396,7 +396,7 @@ class GerberObjectUI(ObjectUI):
) )
grid2.addWidget(self.generate_ncc_button, 0, 1) grid2.addWidget(self.generate_ncc_button, 0, 1)
## Board cutout # ## Board cutout
self.board_cutout_label = QtWidgets.QLabel(_("<b>Board cutout:</b>")) self.board_cutout_label = QtWidgets.QLabel(_("<b>Board cutout:</b>"))
self.board_cutout_label.setToolTip( self.board_cutout_label.setToolTip(
_("Create toolpaths to cut around\n" _("Create toolpaths to cut around\n"
@ -412,7 +412,7 @@ class GerberObjectUI(ObjectUI):
) )
grid2.addWidget(self.generate_cutout_button, 1, 1) grid2.addWidget(self.generate_cutout_button, 1, 1)
## Non-copper regions # ## Non-copper regions
self.noncopper_label = QtWidgets.QLabel(_("<b>Non-copper regions:</b>")) self.noncopper_label = QtWidgets.QLabel(_("<b>Non-copper regions:</b>"))
self.noncopper_label.setToolTip( self.noncopper_label.setToolTip(
_("Create polygons covering the\n" _("Create polygons covering the\n"
@ -450,7 +450,7 @@ class GerberObjectUI(ObjectUI):
self.generate_noncopper_button = QtWidgets.QPushButton(_('Generate Geo')) self.generate_noncopper_button = QtWidgets.QPushButton(_('Generate Geo'))
grid4.addWidget(self.generate_noncopper_button, 1, 1) grid4.addWidget(self.generate_noncopper_button, 1, 1)
## Bounding box # ## Bounding box
self.boundingbox_label = QtWidgets.QLabel(_('<b>Bounding Box:</b>')) self.boundingbox_label = QtWidgets.QLabel(_('<b>Bounding Box:</b>'))
self.boundingbox_label.setToolTip( self.boundingbox_label.setToolTip(
_("Create a geometry surrounding the Gerber object.\n" _("Create a geometry surrounding the Gerber object.\n"
@ -498,7 +498,7 @@ class ExcellonObjectUI(ObjectUI):
icon_file='share/drill32.png', icon_file='share/drill32.png',
parent=parent) parent=parent)
#### Plot options #### #### Plot options ## ##
hlay_plot = QtWidgets.QHBoxLayout() hlay_plot = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(hlay_plot) self.custom_box.addLayout(hlay_plot)
@ -511,7 +511,7 @@ class ExcellonObjectUI(ObjectUI):
hlay_plot.addStretch() hlay_plot.addStretch()
hlay_plot.addWidget(self.solid_cb) hlay_plot.addWidget(self.solid_cb)
## Object name # ## Object name
self.name_hlay = QtWidgets.QHBoxLayout() self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay) self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("<b>Name:</b>")) name_label = QtWidgets.QLabel(_("<b>Name:</b>"))
@ -532,7 +532,7 @@ class ExcellonObjectUI(ObjectUI):
hlay_plot = QtWidgets.QHBoxLayout() hlay_plot = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(hlay_plot) self.tools_box.addLayout(hlay_plot)
#### Tools Drills #### #### Tools Drills ## ##
self.tools_table_label = QtWidgets.QLabel(_('<b>Tools Table</b>')) self.tools_table_label = QtWidgets.QLabel(_('<b>Tools Table</b>'))
self.tools_table_label.setToolTip( self.tools_table_label.setToolTip(
_("Tools in this Excellon object\n" _("Tools in this Excellon object\n"
@ -580,7 +580,7 @@ class ExcellonObjectUI(ObjectUI):
self.empty_label = QtWidgets.QLabel('') self.empty_label = QtWidgets.QLabel('')
self.tools_box.addWidget(self.empty_label) self.tools_box.addWidget(self.empty_label)
#### Create CNC Job #### #### Create CNC Job ## ##
self.cncjob_label = QtWidgets.QLabel(_('<b>Create CNC Job</b>')) self.cncjob_label = QtWidgets.QLabel(_('<b>Create CNC Job</b>'))
self.cncjob_label.setToolTip( self.cncjob_label.setToolTip(
_("Create a CNC Job object\n" _("Create a CNC Job object\n"
@ -768,7 +768,7 @@ class ExcellonObjectUI(ObjectUI):
) )
self.tools_box.addWidget(self.generate_cnc_button) self.tools_box.addWidget(self.generate_cnc_button)
#### Milling Holes Drills#### #### Milling Holes Drills## ##
self.mill_hole_label = QtWidgets.QLabel(_('<b>Mill Holes</b>')) self.mill_hole_label = QtWidgets.QLabel(_('<b>Mill Holes</b>'))
self.mill_hole_label.setToolTip( self.mill_hole_label.setToolTip(
_("Create Geometry for milling holes.") _("Create Geometry for milling holes.")
@ -833,7 +833,7 @@ class GeometryObjectUI(ObjectUI):
self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>")) self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>"))
self.custom_box.addWidget(self.plot_options_label) self.custom_box.addWidget(self.plot_options_label)
## Object name # ## Object name
self.name_hlay = QtWidgets.QHBoxLayout() self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay) self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("<b>Name:</b>")) name_label = QtWidgets.QLabel(_("<b>Name:</b>"))
@ -854,7 +854,7 @@ class GeometryObjectUI(ObjectUI):
hlay_plot = QtWidgets.QHBoxLayout() hlay_plot = QtWidgets.QHBoxLayout()
self.geo_tools_box.addLayout(hlay_plot) self.geo_tools_box.addLayout(hlay_plot)
#### Tools #### #### Tools ## ##
self.tools_table_label = QtWidgets.QLabel(_('<b>Tools Table</b>')) self.tools_table_label = QtWidgets.QLabel(_('<b>Tools Table</b>'))
self.tools_table_label.setToolTip( self.tools_table_label.setToolTip(
_("Tools in this Geometry object used for cutting.\n" _("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(self.tool_offset_entry, 0, 1)
self.grid1.addWidget(spacer_lbl, 0, 2) self.grid1.addWidget(spacer_lbl, 0, 2)
#### Add a new Tool #### #### Add a new Tool ## ##
hlay = QtWidgets.QHBoxLayout() hlay = QtWidgets.QHBoxLayout()
self.geo_tools_box.addLayout(hlay) self.geo_tools_box.addLayout(hlay)
@ -1022,7 +1022,7 @@ class GeometryObjectUI(ObjectUI):
#----------------------------------- #-----------------------------------
# Create CNC Job # Create CNC Job
#----------------------------------- #-----------------------------------
#### Tools Data #### #### Tools Data ## ##
self.tool_data_label = QtWidgets.QLabel(_('<b>Tool Data</b>')) self.tool_data_label = QtWidgets.QLabel(_('<b>Tool Data</b>'))
self.tool_data_label.setToolTip( self.tool_data_label.setToolTip(
_( _(
@ -1346,7 +1346,7 @@ class CNCObjectUI(ObjectUI):
self.offset_label.hide() self.offset_label.hide()
self.offset_button.hide() self.offset_button.hide()
## Plot options # ## Plot options
self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>")) self.plot_options_label = QtWidgets.QLabel(_("<b>Plot Options:</b>"))
self.custom_box.addWidget(self.plot_options_label) self.custom_box.addWidget(self.plot_options_label)
@ -1366,7 +1366,7 @@ class CNCObjectUI(ObjectUI):
{"label": "Cut", "value": "cut"} {"label": "Cut", "value": "cut"}
], stretch=False) ], stretch=False)
## Object name # ## Object name
self.name_hlay = QtWidgets.QHBoxLayout() self.name_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(self.name_hlay) self.custom_box.addLayout(self.name_hlay)
name_label = QtWidgets.QLabel(_("<b>Name:</b>")) name_label = QtWidgets.QLabel(_("<b>Name:</b>"))
@ -1462,9 +1462,9 @@ class CNCObjectUI(ObjectUI):
) )
self.custom_box.addWidget(self.updateplot_button) self.custom_box.addWidget(self.updateplot_button)
################## ################ ##
## Export G-Code # ## Export G-Code
################## ################ ##
self.export_gcode_label = QtWidgets.QLabel(_("<b>Export CNC Code:</b>")) self.export_gcode_label = QtWidgets.QLabel(_("<b>Export CNC Code:</b>"))
self.export_gcode_label.setToolTip( self.export_gcode_label.setToolTip(
_("Export and save G-Code to\n" _("Export and save G-Code to\n"

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://caram.cl/software/flatcam # # http://caram.cl/software/flatcam #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from PyQt5 import QtCore from PyQt5 import QtCore
@ -51,7 +51,7 @@ class PlotCanvas(QtCore.QObject):
self.vispy_canvas.native.setParent(self.app.ui) self.vispy_canvas.native.setParent(self.app.ui)
self.container.addWidget(self.vispy_canvas.native) 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, self.v_line = InfiniteLine(pos=0, color=(0.70, 0.3, 0.3, 1.0), vertical=True,
parent=self.vispy_canvas.view.scene) parent=self.vispy_canvas.view.scene)

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Dennis Hayrullin # # File Author: Dennis Hayrullin #
# Date: 2/5/2016 # # Date: 2/5/2016 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
import numpy as np import numpy as np
from PyQt5.QtGui import QPalette from PyQt5.QtGui import QPalette

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Dennis Hayrullin # # File Author: Dennis Hayrullin #
# Date: 2/5/2016 # # Date: 2/5/2016 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from vispy.visuals import markers, LineVisual, InfiniteLineVisual from vispy.visuals import markers, LineVisual, InfiniteLineVisual
from vispy.visuals.axis import Ticker, _get_ticks_talbot from vispy.visuals.axis import Ticker, _get_ticks_talbot

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Dennis Hayrullin # # File Author: Dennis Hayrullin #
# Date: 2/5/2016 # # Date: 2/5/2016 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from OpenGL import GLU from OpenGL import GLU

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Dennis Hayrullin # # File Author: Dennis Hayrullin #
# Date: 2/5/2016 # # Date: 2/5/2016 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from vispy.visuals import CompoundVisual, LineVisual, MeshVisual, TextVisual, MarkersVisual from vispy.visuals import CompoundVisual, LineVisual, MeshVisual, TextVisual, MarkersVisual
from vispy.scene.visuals import VisualNode, generate_docstring, visuals from vispy.scene.visuals import VisualNode, generate_docstring, visuals

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from shapely.geometry import LineString from shapely.geometry import LineString
import logging import logging

View File

@ -2,12 +2,12 @@
# Vasilis Vlachoudis # Vasilis Vlachoudis
# Date: 20-Oct-2015 # Date: 20-Oct-2015
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File modified: Marius Adrian Stanciu # # File modified: Marius Adrian Stanciu #
# Date: 3/10/2019 # # Date: 3/10/2019 #
############################################################ # ########################################################## ##
import math import math
import sys import sys

View File

@ -1,15 +1,15 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
######################################################################### # ####################################################################### ##
### Borrowed code from 'https://github.com/gddc/ttfquery/blob/master/ ### # ## Borrowed code from 'https://github.com/gddc/ttfquery/blob/master/ # ##
### and made it work with Python 3 ############# # ## and made it work with Python 3 ########### ##
######################################################################### # ####################################################################### ##
import re, os, sys, glob import re, os, sys, glob
import itertools import itertools

View File

@ -1,4 +1,4 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
@ -17,7 +17,7 @@
# * All transformations # # * All transformations #
# # # #
# Reference: www.w3.org/TR/SVG/Overview.html # # Reference: www.w3.org/TR/SVG/Overview.html #
############################################################ # ########################################################## ##
# import xml.etree.ElementTree as ET # import xml.etree.ElementTree as ET
from svg.path import Line, Arc, CubicBezier, QuadraticBezier, parse_path from svg.path import Line, Arc, CubicBezier, QuadraticBezier, parse_path

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
from FlatCAMObj import * from FlatCAMObj import *
@ -31,7 +31,7 @@ class ToolCalculator(FlatCAMTool):
self.app = app self.app = app
## Title # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet(""" title_label.setStyleSheet("""
QLabel QLabel
@ -42,14 +42,14 @@ class ToolCalculator(FlatCAMTool):
""") """)
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
###################### #################### ##
## Units Calculator ## # ## Units Calculator # ##
###################### #################### ##
self.unists_spacer_label = QtWidgets.QLabel(" ") self.unists_spacer_label = QtWidgets.QLabel(" ")
self.layout.addWidget(self.unists_spacer_label) self.layout.addWidget(self.unists_spacer_label)
## Title of the Units Calculator # ## Title of the Units Calculator
units_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.unitsName) units_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.unitsName)
self.layout.addWidget(units_label) self.layout.addWidget(units_label)
@ -76,18 +76,18 @@ class ToolCalculator(FlatCAMTool):
grid_units_layout.addWidget(self.inch_entry, 1, 1) 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.v_shape_spacer_label = QtWidgets.QLabel(" ")
self.layout.addWidget(self.v_shape_spacer_label) 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("<font size=3><b>%s</b></font>" % self.v_shapeName) v_shape_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.v_shapeName)
self.layout.addWidget(v_shape_title_label) self.layout.addWidget(v_shape_title_label)
## Form Layout # ## Form Layout
form_layout = QtWidgets.QFormLayout() form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout) 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.cutDepth_label, self.cutDepth_entry)
form_layout.addRow(self.effectiveToolDia_label, self.effectiveToolDia_entry) form_layout.addRow(self.effectiveToolDia_label, self.effectiveToolDia_entry)
## Buttons # ## Buttons
self.calculate_vshape_button = QtWidgets.QPushButton(_("Calculate")) self.calculate_vshape_button = QtWidgets.QPushButton(_("Calculate"))
# self.calculate_button.setFixedWidth(70) # self.calculate_button.setFixedWidth(70)
self.calculate_vshape_button.setToolTip( self.calculate_vshape_button.setToolTip(
@ -139,14 +139,14 @@ class ToolCalculator(FlatCAMTool):
form_layout.addRow(self.empty_label, self.calculate_vshape_button) form_layout.addRow(self.empty_label, self.calculate_vshape_button)
#################################### ################################## ##
## ElectroPlating Tool Calculator ## # ## ElectroPlating Tool Calculator # ##
#################################### ################################## ##
self.plate_spacer_label = QtWidgets.QLabel(" ") self.plate_spacer_label = QtWidgets.QLabel(" ")
self.layout.addWidget(self.plate_spacer_label) self.layout.addWidget(self.plate_spacer_label)
## Title of the ElectroPlating Tools Calculator # ## Title of the ElectroPlating Tools Calculator
plate_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.eplateName) plate_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.eplateName)
plate_title_label.setToolTip( plate_title_label.setToolTip(
_("This calculator is useful for those who plate the via/pad/drill holes,\n" _("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) self.layout.addWidget(plate_title_label)
## Plate Form Layout # ## Plate Form Layout
plate_form_layout = QtWidgets.QFormLayout() plate_form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(plate_form_layout) 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.cvaluelabel, self.cvalue_entry)
plate_form_layout.addRow(self.timelabel, self.time_entry) plate_form_layout.addRow(self.timelabel, self.time_entry)
## Buttons # ## Buttons
self.calculate_plate_button = QtWidgets.QPushButton(_("Calculate")) self.calculate_plate_button = QtWidgets.QPushButton(_("Calculate"))
# self.calculate_button.setFixedWidth(70) # self.calculate_button.setFixedWidth(70)
self.calculate_plate_button.setToolTip( self.calculate_plate_button.setToolTip(
@ -223,7 +223,7 @@ class ToolCalculator(FlatCAMTool):
self.layout.addStretch() self.layout.addStretch()
## Signals # ## Signals
self.cutDepth_entry.textChanged.connect(self.on_calculate_tool_dia) self.cutDepth_entry.textChanged.connect(self.on_calculate_tool_dia)
self.cutDepth_entry.editingFinished.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) self.tipDia_entry.editingFinished.connect(self.on_calculate_tool_dia)
@ -264,7 +264,7 @@ class ToolCalculator(FlatCAMTool):
def set_tool_ui(self): def set_tool_ui(self):
self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().upper() 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.mm_entry.set_value('0')
self.inch_entry.set_value('0') self.inch_entry.set_value('0')

View File

@ -20,7 +20,7 @@ class DblSidedTool(FlatCAMTool):
def __init__(self, app): def __init__(self, app):
FlatCAMTool.__init__(self, app) FlatCAMTool.__init__(self, app)
## Title # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet(""" title_label.setStyleSheet("""
QLabel QLabel
@ -34,11 +34,11 @@ class DblSidedTool(FlatCAMTool):
self.empty_lb = QtWidgets.QLabel("") self.empty_lb = QtWidgets.QLabel("")
self.layout.addWidget(self.empty_lb) self.layout.addWidget(self.empty_lb)
## Grid Layout # ## Grid Layout
grid_lay = QtWidgets.QGridLayout() grid_lay = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay) self.layout.addLayout(grid_lay)
## Gerber Object to mirror # ## Gerber Object to mirror
self.gerber_object_combo = QtWidgets.QComboBox() self.gerber_object_combo = QtWidgets.QComboBox()
self.gerber_object_combo.setModel(self.app.collection) self.gerber_object_combo.setModel(self.app.collection)
self.gerber_object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex())) 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.gerber_object_combo, 1, 0)
grid_lay.addWidget(self.mirror_gerber_button, 1, 1) 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 = QtWidgets.QComboBox()
self.exc_object_combo.setModel(self.app.collection) self.exc_object_combo.setModel(self.app.collection)
self.exc_object_combo.setRootModelIndex(self.app.collection.index(1, 0, QtCore.QModelIndex())) 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.exc_object_combo, 3, 0)
grid_lay.addWidget(self.mirror_exc_button, 3, 1) 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 = QtWidgets.QComboBox()
self.geo_object_combo.setModel(self.app.collection) self.geo_object_combo.setModel(self.app.collection)
self.geo_object_combo.setRootModelIndex(self.app.collection.index(2, 0, QtCore.QModelIndex())) 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.geo_object_combo, 5, 0)
grid_lay.addWidget(self.mirror_geo_button, 5, 1) grid_lay.addWidget(self.mirror_geo_button, 5, 1)
## Grid Layout # ## Grid Layout
grid_lay1 = QtWidgets.QGridLayout() grid_lay1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay1) self.layout.addLayout(grid_lay1)
## Axis # ## Axis
self.mirror_axis = RadioSet([{'label': 'X', 'value': 'X'}, self.mirror_axis = RadioSet([{'label': 'X', 'value': 'X'},
{'label': 'Y', 'value': 'Y'}]) {'label': 'Y', 'value': 'Y'}])
self.mirax_label = QtWidgets.QLabel(_("Mirror Axis:")) 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.mirax_label, 7, 0)
grid_lay1.addWidget(self.mirror_axis, 7, 1) grid_lay1.addWidget(self.mirror_axis, 7, 1)
## Axis Location # ## Axis Location
self.axis_location = RadioSet([{'label': 'Point', 'value': 'point'}, self.axis_location = RadioSet([{'label': 'Point', 'value': 'point'},
{'label': 'Box', 'value': 'box'}]) {'label': 'Box', 'value': 'box'}])
self.axloc_label = QtWidgets.QLabel(_("Axis Ref:")) self.axloc_label = QtWidgets.QLabel(_("Axis Ref:"))
@ -143,11 +143,11 @@ class DblSidedTool(FlatCAMTool):
self.empty_lb2 = QtWidgets.QLabel("") self.empty_lb2 = QtWidgets.QLabel("")
grid_lay1.addWidget(self.empty_lb2, 9, 0) grid_lay1.addWidget(self.empty_lb2, 9, 0)
## Grid Layout # ## Grid Layout
grid_lay2 = QtWidgets.QGridLayout() grid_lay2 = QtWidgets.QGridLayout()
self.layout.addLayout(grid_lay2) self.layout.addLayout(grid_lay2)
## Point/Box # ## Point/Box
self.point_box_container = QtWidgets.QVBoxLayout() self.point_box_container = QtWidgets.QVBoxLayout()
self.pb_label = QtWidgets.QLabel("<b>%s</b>" % _('Point/Box Reference:')) self.pb_label = QtWidgets.QLabel("<b>%s</b>" % _('Point/Box Reference:'))
self.pb_label.setToolTip( self.pb_label.setToolTip(
@ -189,7 +189,7 @@ class DblSidedTool(FlatCAMTool):
self.box_combo_type.hide() self.box_combo_type.hide()
## Alignment holes # ## Alignment holes
self.ah_label = QtWidgets.QLabel("<b>%s</b>" % _('Alignment Drill Coordinates:')) self.ah_label = QtWidgets.QLabel("<b>%s</b>" % _('Alignment Drill Coordinates:'))
self.ah_label.setToolTip( self.ah_label.setToolTip(
_( "Alignment holes (x1, y1), (x2, y2), ... " _( "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.alignment_holes, 0, 0)
grid_lay3.addWidget(self.add_drill_point_button, 0, 1) 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("<b>%s</b>:" % _('Alignment Drill Diameter')) self.dt_label = QtWidgets.QLabel("<b>%s</b>:" % _('Alignment Drill Diameter'))
self.dt_label.setToolTip( self.dt_label.setToolTip(
_("Diameter of the drill for the " _("Diameter of the drill for the "
@ -243,7 +243,7 @@ class DblSidedTool(FlatCAMTool):
hlay2 = QtWidgets.QHBoxLayout() hlay2 = QtWidgets.QHBoxLayout()
self.layout.addLayout(hlay2) self.layout.addLayout(hlay2)
## Buttons # ## Buttons
self.create_alignment_hole_button = QtWidgets.QPushButton(_("Create Excellon Object")) self.create_alignment_hole_button = QtWidgets.QPushButton(_("Create Excellon Object"))
self.create_alignment_hole_button.setToolTip( self.create_alignment_hole_button.setToolTip(
_("Creates an Excellon Object containing the\n" _("Creates an Excellon Object containing the\n"
@ -261,7 +261,7 @@ class DblSidedTool(FlatCAMTool):
self.layout.addStretch() self.layout.addStretch()
## Signals # ## Signals
self.create_alignment_hole_button.clicked.connect(self.on_create_alignment_holes) self.create_alignment_hole_button.clicked.connect(self.on_create_alignment_holes)
self.mirror_gerber_button.clicked.connect(self.on_mirror_gerber) self.mirror_gerber_button.clicked.connect(self.on_mirror_gerber)
self.mirror_exc_button.clicked.connect(self.on_mirror_exc) self.mirror_exc_button.clicked.connect(self.on_mirror_exc)

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
@ -165,7 +165,7 @@ class Film(FlatCAMTool):
self.layout.addStretch() self.layout.addStretch()
## Signals # ## Signals
self.film_object_button.clicked.connect(self.on_film_creation) 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_obj_combo.currentIndexChanged.connect(self.on_type_obj_index_changed)
self.tf_type_box_combo.currentIndexChanged.connect(self.on_type_box_index_changed) self.tf_type_box_combo.currentIndexChanged.connect(self.on_type_box_index_changed)

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
@ -144,7 +144,7 @@ class ToolImage(FlatCAMTool):
self.layout.addStretch() self.layout.addStretch()
## Signals # ## Signals
self.import_button.clicked.connect(self.on_file_importimage) self.import_button.clicked.connect(self.on_file_importimage)
def run(self, toggle=True): def run(self, toggle=True):
@ -173,7 +173,7 @@ class ToolImage(FlatCAMTool):
FlatCAMTool.install(self, icon, separator, **kwargs) FlatCAMTool.install(self, icon, separator, **kwargs)
def set_tool_ui(self): def set_tool_ui(self):
## Initialize form # ## Initialize form
self.dpi_entry.set_value(96) self.dpi_entry.set_value(96)
self.image_type.set_value('black') self.image_type.set_value('black')
self.mask_bw_entry.set_value(250) self.mask_bw_entry.set_value(250)

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
from FlatCAMObj import * from FlatCAMObj import *
@ -32,11 +32,11 @@ class Measurement(FlatCAMTool):
self.canvas = self.app.plotcanvas self.canvas = self.app.plotcanvas
self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().lower() self.units = self.app.ui.general_defaults_form.general_app_group.units_radio.get_value().lower()
## Title # ## Title
title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font><br>" % self.toolName) title_label = QtWidgets.QLabel("<font size=4><b>%s</b></font><br>" % self.toolName)
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
## Form Layout # ## Form Layout
form_layout = QtWidgets.QFormLayout() form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(form_layout) self.layout.addLayout(form_layout)

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
from FlatCAMObj import * from FlatCAMObj import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Modified by: Marius Adrian Stanciu (c) # # File Modified by: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
from copy import copy,deepcopy from copy import copy,deepcopy
@ -38,7 +38,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.tools_box.setContentsMargins(0, 0, 0, 0) self.tools_box.setContentsMargins(0, 0, 0, 0)
self.tools_frame.setLayout(self.tools_box) self.tools_frame.setLayout(self.tools_box)
## Title # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet(""" title_label.setStyleSheet("""
QLabel QLabel
@ -49,11 +49,11 @@ class NonCopperClear(FlatCAMTool, Gerber):
""") """)
self.tools_box.addWidget(title_label) self.tools_box.addWidget(title_label)
## Form Layout # ## Form Layout
form_layout = QtWidgets.QFormLayout() form_layout = QtWidgets.QFormLayout()
self.tools_box.addLayout(form_layout) self.tools_box.addLayout(form_layout)
## Object # ## Object
self.object_combo = QtWidgets.QComboBox() self.object_combo = QtWidgets.QComboBox()
self.object_combo.setModel(self.app.collection) self.object_combo.setModel(self.app.collection)
self.object_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex())) 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(self.object_label, self.object_combo)
form_layout.addRow(e_lab_0) form_layout.addRow(e_lab_0)
#### Tools #### #### Tools ## ##
self.tools_table_label = QtWidgets.QLabel('<b>%s</b>' % _('Tools Table')) self.tools_table_label = QtWidgets.QLabel('<b>%s</b>' % _('Tools Table'))
self.tools_table_label.setToolTip( self.tools_table_label.setToolTip(
_("Tools pool from which the algorithm\n" _("Tools pool from which the algorithm\n"
@ -113,7 +113,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
self.empty_label = QtWidgets.QLabel('') self.empty_label = QtWidgets.QLabel('')
self.tools_box.addWidget(self.empty_label) self.tools_box.addWidget(self.empty_label)
#### Add a new Tool #### #### Add a new Tool ## ##
hlay = QtWidgets.QHBoxLayout() hlay = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(hlay) 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.setItem(row_no, 1, dia) # Diameter
self.tools_table.setCellWidget(row_no, 2, tool_type_item) 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 self.tools_table.setItem(row_no, 3, tool_uid_item) # Tool unique ID
# make the diameter column editable # make the diameter column editable

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 4/23/2019 # # Date: 4/23/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
from shapely.geometry import Point, Polygon, LineString from shapely.geometry import Point, Polygon, LineString
@ -1242,9 +1242,9 @@ class ToolPDF(FlatCAMTool):
new_el['follow'] = pdf_geo.exterior new_el['follow'] = pdf_geo.exterior
apertures_dict[str(aperture)]['geometry'].append(deepcopy(new_el)) apertures_dict[str(aperture)]['geometry'].append(deepcopy(new_el))
# ############################################### # ############################################# ##
# store the found geometry for filling the path # # store the found geometry for filling the path #
# ############################################### # ############################################# ##
# in case that a color change to white (transparent) occurred # in case that a color change to white (transparent) occurred
if flag_clear_geo is True: if flag_clear_geo is True:

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Modified: Marius Adrian Stanciu (c) # # File Modified: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
from copy import copy,deepcopy from copy import copy,deepcopy
@ -29,7 +29,7 @@ class ToolPaint(FlatCAMTool, Gerber):
FlatCAMTool.__init__(self, app) FlatCAMTool.__init__(self, app)
Geometry.__init__(self, geo_steps_per_circle=self.app.defaults["geometry_circle_steps"]) Geometry.__init__(self, geo_steps_per_circle=self.app.defaults["geometry_circle_steps"])
## Title # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet(""" title_label.setStyleSheet("""
QLabel QLabel
@ -47,11 +47,11 @@ class ToolPaint(FlatCAMTool, Gerber):
self.tools_box.setContentsMargins(0, 0, 0, 0) self.tools_box.setContentsMargins(0, 0, 0, 0)
self.tools_frame.setLayout(self.tools_box) self.tools_frame.setLayout(self.tools_box)
## Form Layout # ## Form Layout
form_layout = QtWidgets.QFormLayout() form_layout = QtWidgets.QFormLayout()
self.tools_box.addLayout(form_layout) self.tools_box.addLayout(form_layout)
## Object # ## Object
self.object_combo = QtWidgets.QComboBox() self.object_combo = QtWidgets.QComboBox()
self.object_combo.setModel(self.app.collection) self.object_combo.setModel(self.app.collection)
self.object_combo.setRootModelIndex(self.app.collection.index(2, 0, QtCore.QModelIndex())) 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(self.object_label, self.object_combo)
form_layout.addRow(e_lab_0) form_layout.addRow(e_lab_0)
#### Tools #### #### Tools ## ##
self.tools_table_label = QtWidgets.QLabel('<b>%s</b>' % _('Tools Table')) self.tools_table_label = QtWidgets.QLabel('<b>%s</b>' % _('Tools Table'))
self.tools_table_label.setToolTip( self.tools_table_label.setToolTip(
_("Tools pool from which the algorithm\n" _("Tools pool from which the algorithm\n"
@ -110,7 +110,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.empty_label = QtWidgets.QLabel('') self.empty_label = QtWidgets.QLabel('')
self.tools_box.addWidget(self.empty_label) self.tools_box.addWidget(self.empty_label)
#### Add a new Tool #### #### Add a new Tool ## ##
hlay = QtWidgets.QHBoxLayout() hlay = QtWidgets.QHBoxLayout()
self.tools_box.addLayout(hlay) self.tools_box.addLayout(hlay)
@ -305,7 +305,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.tool_type_item_options = ["C1", "C2", "C3", "C4", "B", "V"] self.tool_type_item_options = ["C1", "C2", "C3", "C4", "B", "V"]
## Signals # ## Signals
self.addtool_btn.clicked.connect(self.on_tool_add) self.addtool_btn.clicked.connect(self.on_tool_add)
self.addtool_entry.returnPressed.connect(self.on_tool_add) self.addtool_entry.returnPressed.connect(self.on_tool_add)
# self.copytool_btn.clicked.connect(lambda: self.on_tool_copy()) # self.copytool_btn.clicked.connect(lambda: self.on_tool_copy())
@ -365,7 +365,7 @@ class ToolPaint(FlatCAMTool, Gerber):
self.tools_frame.show() self.tools_frame.show()
self.reset_fields() self.reset_fields()
## Init the GUI interface # ## Init the GUI interface
self.paintmargin_entry.set_value(self.default_data["paintmargin"]) self.paintmargin_entry.set_value(self.default_data["paintmargin"])
self.paintmethod_combo.set_value(self.default_data["paintmethod"]) self.paintmethod_combo.set_value(self.default_data["paintmethod"])
self.selectmethod_combo.set_value(self.default_data["selectmethod"]) 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.setItem(row_no, 1, dia) # Diameter
self.tools_table.setCellWidget(row_no, 2, tool_type_item) 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 self.tools_table.setItem(row_no, 3, tool_uid_item) # Tool unique ID
# make the diameter column editable # make the diameter column editable
@ -1035,13 +1035,13 @@ class ToolPaint(FlatCAMTool, Gerber):
if reset: if reset:
self.flat_geometry = [] self.flat_geometry = []
## If iterable, expand recursively. # ## If iterable, expand recursively.
try: try:
for geo in geometry: for geo in geometry:
if geo is not None: if geo is not None:
recurse(geometry=geo, reset=False) recurse(geometry=geo, reset=False)
## Not iterable, do the actual indexing and add. # ## Not iterable, do the actual indexing and add.
except TypeError: except TypeError:
self.flat_geometry.append(geometry) self.flat_geometry.append(geometry)

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
from copy import copy, deepcopy from copy import copy, deepcopy
@ -28,7 +28,7 @@ class Panelize(FlatCAMTool):
super(Panelize, self).__init__(self) super(Panelize, self).__init__(self)
self.app = app self.app = app
## Title # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet(""" title_label.setStyleSheet("""
QLabel QLabel

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 4/15/2019 # # Date: 4/15/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
@ -152,7 +152,7 @@ class PcbWizard(FlatCAMTool):
self.modified_excellon_file = '' self.modified_excellon_file = ''
## Signals # ## Signals
self.excellon_brn.clicked.connect(self.on_load_excellon_click) self.excellon_brn.clicked.connect(self.on_load_excellon_click)
self.inf_btn.clicked.connect(self.on_load_inf_click) self.inf_btn.clicked.connect(self.on_load_inf_click)
self.import_button.clicked.connect(lambda: self.on_import_excellon( self.import_button.clicked.connect(lambda: self.on_import_excellon(
@ -207,7 +207,7 @@ class PcbWizard(FlatCAMTool):
self.exc_file_content = None self.exc_file_content = None
self.tools_from_inf = {} self.tools_from_inf = {}
## Initialize form # ## Initialize form
self.int_entry.set_value(self.integral) self.int_entry.set_value(self.integral)
self.frac_entry.set_value(self.fractional) self.frac_entry.set_value(self.fractional)
self.zeros_radio.set_value(self.zeros) self.zeros_radio.set_value(self.zeros)

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt
@ -37,7 +37,7 @@ class Properties(FlatCAMTool):
self.properties_box.setContentsMargins(0, 0, 0, 0) self.properties_box.setContentsMargins(0, 0, 0, 0)
self.properties_frame.setLayout(self.properties_box) self.properties_frame.setLayout(self.properties_box)
## Title # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet(""" title_label.setStyleSheet("""
QLabel QLabel

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
# Date: 2/5/2014 # # Date: 2/5/2014 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
# from PyQt5.QtCore import pyqtSignal # from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import Qt from PyQt5.QtCore import Qt

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
from FlatCAMCommon import LoudDict from FlatCAMCommon import LoudDict
@ -39,7 +39,7 @@ class SolderPaste(FlatCAMTool):
def __init__(self, app): def __init__(self, app):
FlatCAMTool.__init__(self, app) FlatCAMTool.__init__(self, app)
## Title # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet(""" title_label.setStyleSheet("""
QLabel QLabel
@ -50,11 +50,11 @@ class SolderPaste(FlatCAMTool):
""") """)
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
## Form Layout # ## Form Layout
obj_form_layout = QtWidgets.QFormLayout() obj_form_layout = QtWidgets.QFormLayout()
self.layout.addLayout(obj_form_layout) 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 = FCComboBox(callback=self.on_rmb_combo)
self.obj_combo.setModel(self.app.collection) self.obj_combo.setModel(self.app.collection)
self.obj_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex())) 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) obj_form_layout.addRow(self.object_label, self.obj_combo)
#### Tools #### #### Tools ## ##
self.tools_table_label = QtWidgets.QLabel('<b>%s</b>' % _('Tools Table')) self.tools_table_label = QtWidgets.QLabel('<b>%s</b>' % _('Tools Table'))
self.tools_table_label.setToolTip( self.tools_table_label.setToolTip(
_("Tools pool from which the algorithm\n" _("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" _( "Nozzle tool Diameter. It's value (in current FlatCAM units)\n"
"is the width of the solder paste dispensed.")) "is the width of the solder paste dispensed."))
#### Add a new Tool #### #### Add a new Tool ## ##
hlay_tools = QtWidgets.QHBoxLayout() hlay_tools = QtWidgets.QHBoxLayout()
self.layout.addLayout(hlay_tools) self.layout.addLayout(hlay_tools)
@ -135,7 +135,7 @@ class SolderPaste(FlatCAMTool):
self.layout.addSpacing(10) self.layout.addSpacing(10)
## Buttons # ## Buttons
grid0_1 = QtWidgets.QGridLayout() grid0_1 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0_1) self.layout.addLayout(grid0_1)
@ -157,7 +157,7 @@ class SolderPaste(FlatCAMTool):
self.gcode_box.setContentsMargins(0, 0, 0, 0) self.gcode_box.setContentsMargins(0, 0, 0, 0)
self.gcode_frame.setLayout(self.gcode_box) self.gcode_frame.setLayout(self.gcode_box)
## Form Layout # ## Form Layout
self.gcode_form_layout = QtWidgets.QFormLayout() self.gcode_form_layout = QtWidgets.QFormLayout()
self.gcode_box.addLayout(self.gcode_form_layout) 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.pp_combo.setStyleSheet('background-color: rgb(255,255,255)')
self.gcode_form_layout.addRow(pp_label, self.pp_combo) self.gcode_form_layout.addRow(pp_label, self.pp_combo)
## Buttons # ## Buttons
grid1 = QtWidgets.QGridLayout() grid1 = QtWidgets.QGridLayout()
self.gcode_box.addLayout(grid1) self.gcode_box.addLayout(grid1)
@ -301,7 +301,7 @@ class SolderPaste(FlatCAMTool):
self.generation_frame.setLayout(self.generation_box) self.generation_frame.setLayout(self.generation_box)
## Buttons # ## Buttons
grid2 = QtWidgets.QGridLayout() grid2 = QtWidgets.QGridLayout()
self.generation_box.addLayout(grid2) self.generation_box.addLayout(grid2)
@ -313,11 +313,11 @@ class SolderPaste(FlatCAMTool):
grid2.addWidget(step2_lbl, 0, 0) grid2.addWidget(step2_lbl, 0, 0)
grid2.addWidget(self.soldergeo_btn, 0, 2) grid2.addWidget(self.soldergeo_btn, 0, 2)
## Form Layout # ## Form Layout
geo_form_layout = QtWidgets.QFormLayout() geo_form_layout = QtWidgets.QFormLayout()
self.generation_box.addLayout(geo_form_layout) 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 = FCComboBox(callback=self.on_rmb_combo)
self.geo_obj_combo.setModel(self.app.collection) self.geo_obj_combo.setModel(self.app.collection)
self.geo_obj_combo.setRootModelIndex(self.app.collection.index(2, 0, QtCore.QModelIndex())) 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(step3_lbl, 0, 0)
grid3.addWidget(self.solder_gcode_btn, 0, 2) grid3.addWidget(self.solder_gcode_btn, 0, 2)
## Form Layout # ## Form Layout
cnc_form_layout = QtWidgets.QFormLayout() cnc_form_layout = QtWidgets.QFormLayout()
self.generation_box.addLayout(cnc_form_layout) 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 = FCComboBox(callback=self.on_rmb_combo)
self.cnc_obj_combo.setModel(self.app.collection) self.cnc_obj_combo.setModel(self.app.collection)
self.cnc_obj_combo.setRootModelIndex(self.app.collection.index(3, 0, QtCore.QModelIndex())) 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 # action to be added in the combobox context menu
self.combo_context_del_action = QtWidgets.QAction(QtGui.QIcon('share/trash16.png'), _("Delete Object")) 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.combo_context_del_action.triggered.connect(self.on_delete_object)
self.addtool_btn.clicked.connect(self.on_tool_add) self.addtool_btn.clicked.connect(self.on_tool_add)
self.addtool_entry.returnPressed.connect(self.on_tool_add) self.addtool_entry.returnPressed.connect(self.on_tool_add)
@ -995,7 +995,7 @@ class SolderPaste(FlatCAMTool):
if reset: if reset:
self.flat_geometry = [] self.flat_geometry = []
## If iterable, expand recursively. # ## If iterable, expand recursively.
try: try:
for geo in geometry: for geo in geometry:
if geo is not None: if geo is not None:
@ -1003,7 +1003,7 @@ class SolderPaste(FlatCAMTool):
reset=False, reset=False,
pathonly=pathonly) pathonly=pathonly)
## Not iterable, do the actual indexing and add. # ## Not iterable, do the actual indexing and add.
except TypeError: except TypeError:
if pathonly and type(geometry) == Polygon: if pathonly and type(geometry) == Polygon:
self.flat_geometry.append(geometry.exterior) self.flat_geometry.append(geometry.exterior)
@ -1226,7 +1226,7 @@ class SolderPaste(FlatCAMTool):
job_obj.options["tooldia"] = tool_dia job_obj.options["tooldia"] = tool_dia
job_obj.options['tool_dia'] = tool_dia job_obj.options['tool_dia'] = tool_dia
### CREATE GCODE ### # ## CREATE GCODE # ##
res = job_obj.generate_gcode_from_solderpaste_geo(**tooluid_value) res = job_obj.generate_gcode_from_solderpaste_geo(**tooluid_value)
if res == 'fail': if res == 'fail':
@ -1235,7 +1235,7 @@ class SolderPaste(FlatCAMTool):
else: else:
tool_cnc_dict['gcode'] = res tool_cnc_dict['gcode'] = res
### PARSE GCODE ### # ## PARSE GCODE # ##
tool_cnc_dict['gcode_parsed'] = job_obj.gcode_parse() tool_cnc_dict['gcode_parsed'] = job_obj.gcode_parse()
# TODO this serve for bounding box creation only; should be optimized # TODO this serve for bounding box creation only; should be optimized
@ -1380,7 +1380,7 @@ class SolderPaste(FlatCAMTool):
gcode += obj.cnc_tools[tool]['gcode'] gcode += obj.cnc_tools[tool]['gcode']
lines = StringIO(gcode) lines = StringIO(gcode)
## Write # ## Write
if filename is not None: if filename is not None:
try: try:
with open(filename, 'w') as f: with open(filename, 'w') as f:

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 4/24/2019 # # Date: 4/24/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMTool import FlatCAMTool from FlatCAMTool import FlatCAMTool
from FlatCAMObj import * from FlatCAMObj import *
@ -32,7 +32,7 @@ class ToolTransform(FlatCAMTool):
self.transform_lay = QtWidgets.QVBoxLayout() self.transform_lay = QtWidgets.QVBoxLayout()
self.layout.addLayout(self.transform_lay) self.layout.addLayout(self.transform_lay)
## Title # ## Title
title_label = QtWidgets.QLabel("%s" % self.toolName) title_label = QtWidgets.QLabel("%s" % self.toolName)
title_label.setStyleSheet(""" title_label.setStyleSheet("""
QLabel QLabel
@ -56,11 +56,11 @@ class ToolTransform(FlatCAMTool):
self.empty_label4.setFixedWidth(70) self.empty_label4.setFixedWidth(70)
self.transform_lay.addWidget(self.empty_label) self.transform_lay.addWidget(self.empty_label)
## Rotate Title # ## Rotate Title
rotate_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.rotateName) rotate_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.rotateName)
self.transform_lay.addWidget(rotate_title_label) self.transform_lay.addWidget(rotate_title_label)
## Layout # ## Layout
form_layout = QtWidgets.QFormLayout() form_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form_layout) self.transform_lay.addLayout(form_layout)
form_child = QtWidgets.QHBoxLayout() form_child = QtWidgets.QHBoxLayout()
@ -94,11 +94,11 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addWidget(self.empty_label1) self.transform_lay.addWidget(self.empty_label1)
## Skew Title # ## Skew Title
skew_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.skewName) skew_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.skewName)
self.transform_lay.addWidget(skew_title_label) self.transform_lay.addWidget(skew_title_label)
## Form Layout # ## Form Layout
form1_layout = QtWidgets.QFormLayout() form1_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form1_layout) self.transform_lay.addLayout(form1_layout)
form1_child_1 = QtWidgets.QHBoxLayout() form1_child_1 = QtWidgets.QHBoxLayout()
@ -151,11 +151,11 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addWidget(self.empty_label2) self.transform_lay.addWidget(self.empty_label2)
## Scale Title # ## Scale Title
scale_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.scaleName) scale_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.scaleName)
self.transform_lay.addWidget(scale_title_label) self.transform_lay.addWidget(scale_title_label)
## Form Layout # ## Form Layout
form2_layout = QtWidgets.QFormLayout() form2_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form2_layout) self.transform_lay.addLayout(form2_layout)
form2_child_1 = QtWidgets.QHBoxLayout() form2_child_1 = QtWidgets.QHBoxLayout()
@ -225,11 +225,11 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addWidget(self.empty_label3) self.transform_lay.addWidget(self.empty_label3)
## Offset Title # ## Offset Title
offset_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.offsetName) offset_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.offsetName)
self.transform_lay.addWidget(offset_title_label) self.transform_lay.addWidget(offset_title_label)
## Form Layout # ## Form Layout
form3_layout = QtWidgets.QFormLayout() form3_layout = QtWidgets.QFormLayout()
self.transform_lay.addLayout(form3_layout) self.transform_lay.addLayout(form3_layout)
form3_child_1 = QtWidgets.QHBoxLayout() form3_child_1 = QtWidgets.QHBoxLayout()
@ -280,11 +280,11 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addWidget(self.empty_label4) self.transform_lay.addWidget(self.empty_label4)
## Flip Title # ## Flip Title
flip_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.flipName) flip_title_label = QtWidgets.QLabel("<font size=3><b>%s</b></font>" % self.flipName)
self.transform_lay.addWidget(flip_title_label) self.transform_lay.addWidget(flip_title_label)
## Form Layout # ## Form Layout
form4_layout = QtWidgets.QFormLayout() form4_layout = QtWidgets.QFormLayout()
form4_child_hlay = QtWidgets.QHBoxLayout() form4_child_hlay = QtWidgets.QHBoxLayout()
self.transform_lay.addLayout(form4_child_hlay) self.transform_lay.addLayout(form4_child_hlay)
@ -355,7 +355,7 @@ class ToolTransform(FlatCAMTool):
self.transform_lay.addStretch() self.transform_lay.addStretch()
## Signals # ## Signals
self.rotate_button.clicked.connect(self.on_rotate) self.rotate_button.clicked.connect(self.on_rotate)
self.skewx_button.clicked.connect(self.on_skewx) self.skewx_button.clicked.connect(self.on_skewx)
self.skewy_button.clicked.connect(self.on_skewy) self.skewy_button.clicked.connect(self.on_skewy)
@ -401,7 +401,7 @@ class ToolTransform(FlatCAMTool):
FlatCAMTool.install(self, icon, separator, shortcut='ALT+R', **kwargs) FlatCAMTool.install(self, icon, separator, shortcut='ALT+R', **kwargs)
def set_tool_ui(self): def set_tool_ui(self):
## Initialize form # ## Initialize form
if self.app.defaults["tools_transform_rotate"]: if self.app.defaults["tools_transform_rotate"]:
self.rotate_entry.set_value(self.app.defaults["tools_transform_rotate"]) self.rotate_entry.set_value(self.app.defaults["tools_transform_rotate"])
else: else:

View File

@ -1,4 +1,4 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# Author: Juan Pablo Caram (c) # # Author: Juan Pablo Caram (c) #
@ -11,12 +11,12 @@
# This is not an aid to install FlatCAM from source on # # This is not an aid to install FlatCAM from source on #
# Windows platforms. It is only useful when FlatCAM is up # # Windows platforms. It is only useful when FlatCAM is up #
# and running and ready to be packaged. # # and running and ready to be packaged. #
############################################################ # ########################################################## ##
############################################################ # ########################################################## ##
# File Modified (major mod): Marius Adrian Stanciu # # File Modified (major mod): Marius Adrian Stanciu #
# Date: 3/10/2019 # # Date: 3/10/2019 #
############################################################ # ########################################################## ##
# Files not needed: Qt, tk.dll, tcl.dll, tk/, tcl/, vtk/, # Files not needed: Qt, tk.dll, tcl.dll, tk/, tcl/, vtk/,

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Matthieu Berthomé # # File Author: Matthieu Berthomé #
# Date: 5/26/2017 # # Date: 5/26/2017 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Matthieu Berthomé # # File Author: Matthieu Berthomé #
# Date: 5/26/2017 # # Date: 5/26/2017 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Matthieu Berthomé # # File Author: Matthieu Berthomé #
# Date: 5/26/2017 # # Date: 5/26/2017 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *

View File

@ -1,10 +1,10 @@
############################################################ # ########################################################## ##
# FlatCAM: 2D Post-processing for Manufacturing # # FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org # # http://flatcam.org #
# File Author: Marius Adrian Stanciu (c) # # File Author: Marius Adrian Stanciu (c) #
# Date: 3/10/2019 # # Date: 3/10/2019 #
# MIT Licence # # MIT Licence #
############################################################ # ########################################################## ##
from FlatCAMPostProc import * from FlatCAMPostProc import *