- in Basic mode, the tool type column is no longer hidden as it may create issues when using an painted geometry
- some PEP8 clean-up in FlatCAMGui.py
This commit is contained in:
parent
338f12707d
commit
c6e3176ac3
@ -6141,11 +6141,12 @@ class App(QtCore.QObject):
|
||||
self.report_usage("on_fileopengerber")
|
||||
App.log.debug("on_fileopengerber()")
|
||||
|
||||
_filter_ = "Gerber Files (*.gbr *.ger *.gtl *.gbl *.gts *.gbs *.gtp *.gbp *.gto *.gbo *.gm1 *.gml *.gm3 *.gko " \
|
||||
"*.cmp *.sol *.stc *.sts *.plc *.pls *.crc *.crs *.tsm *.bsm *.ly2 *.ly15 *.dim *.mil *.grb" \
|
||||
_filter_ = "Gerber Files (*.gbr *.ger *.gtl *.gbl *.gts *.gbs *.gtp *.gbp *.gto *.gbo *.gm1 *.gml *.gm3 *" \
|
||||
".gko *.cmp *.sol *.stc *.sts *.plc *.pls *.crc *.crs *.tsm *.bsm *.ly2 *.ly15 *.dim *.mil *.grb" \
|
||||
"*.top *.bot *.smt *.smb *.sst *.ssb *.spt *.spb *.pho *.gdo *.art *.gbd *.gb*);;" \
|
||||
"Protel Files (*.gtl *.gbl *.gts *.gbs *.gto *.gbo *.gtp *.gbp *.gml *.gm1 *.gm3 *.gko);;" \
|
||||
"Eagle Files (*.cmp *.sol *.stc *.sts *.plc *.pls *.crc *.crs *.tsm *.bsm *.ly2 *.ly15 *.dim *.mil);;" \
|
||||
"Eagle Files (*.cmp *.sol *.stc *.sts *.plc *.pls *.crc *.crs *.tsm *.bsm *.ly2 *.ly15 *.dim " \
|
||||
"*.mil);;" \
|
||||
"OrCAD Files (*.top *.bot *.smt *.smb *.sst *.ssb *.spt *.spb);;" \
|
||||
"Allegro Files (*.art);;" \
|
||||
"Mentor Files (*.pho *.gdo);;" \
|
||||
@ -7680,9 +7681,9 @@ class App(QtCore.QObject):
|
||||
app_obj.progress.emit(0)
|
||||
self.log.error(str(err))
|
||||
return "fail"
|
||||
|
||||
except:
|
||||
msg = _("[ERROR] An internal error has ocurred. See shell.\n")
|
||||
except Exception as e:
|
||||
log.debug("App.open_gerber() --> %s" % str(e))
|
||||
msg = _("[ERROR] An internal error has occurred. See shell.\n")
|
||||
msg += traceback.format_exc()
|
||||
app_obj.inform.emit(msg)
|
||||
return "fail"
|
||||
|
@ -3318,7 +3318,7 @@ class FlatCAMGeometry(FlatCAMObj, Geometry):
|
||||
|
||||
self.ui.geo_tools_table.setColumnHidden(2, True)
|
||||
self.ui.geo_tools_table.setColumnHidden(3, True)
|
||||
self.ui.geo_tools_table.setColumnHidden(4, True)
|
||||
# self.ui.geo_tools_table.setColumnHidden(4, True)
|
||||
self.ui.addtool_entry_lbl.hide()
|
||||
self.ui.addtool_entry.hide()
|
||||
self.ui.addtool_btn.hide()
|
||||
|
@ -13,6 +13,8 @@ CAD program, and create G-Code for Isolation routing.
|
||||
|
||||
- fixed issue with not using the current units in the tool tables after unit conversion
|
||||
- after unit conversion from Preferences, the default values are automatically saved by the app
|
||||
- in Basic mode, the tool type column is no longer hidden as it may create issues when using an painted geometry
|
||||
- some PEP8 clean-up in FlatCAMGui.py
|
||||
|
||||
20.07.2019
|
||||
|
||||
|
11
camlib.py
11
camlib.py
@ -2158,7 +2158,8 @@ class Gerber (Geometry):
|
||||
yield line
|
||||
break
|
||||
|
||||
self.parse_lines(line_generator())
|
||||
processed_lines = list(line_generator())
|
||||
self.parse_lines(processed_lines)
|
||||
|
||||
# @profile
|
||||
def parse_lines(self, glines):
|
||||
@ -2241,10 +2242,10 @@ class Gerber (Geometry):
|
||||
gline = gline.strip(' \r\n')
|
||||
# log.debug("Line=%3s %s" % (line_num, gline))
|
||||
|
||||
# ############################################################# ##
|
||||
# Ignored lines #
|
||||
# Comments #### ##
|
||||
# ############################################################# ##
|
||||
# ###################
|
||||
# Ignored lines #####
|
||||
# Comments #####
|
||||
# ###################
|
||||
match = self.comm_re.search(gline)
|
||||
if match:
|
||||
continue
|
||||
|
@ -20,12 +20,13 @@ from flatcamEditors.FlatCAMGeoEditor import FCShapeTool
|
||||
|
||||
import gettext
|
||||
import FlatCAMTranslation as fcTranslate
|
||||
import builtins
|
||||
|
||||
fcTranslate.apply_language('strings')
|
||||
import builtins
|
||||
if '_' not in builtins.__dict__:
|
||||
_ = gettext.gettext
|
||||
|
||||
|
||||
class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
# Emitted when persistent window geometry needs to be retained
|
||||
geom_update = QtCore.pyqtSignal(int, int, int, int, int, name='geomUpdate')
|
||||
@ -87,8 +88,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
|
||||
# Open Excellon ...
|
||||
self.menufileopenexcellon = QtWidgets.QAction(QtGui.QIcon('share/open_excellon32.png'),
|
||||
_('Open &Excellon ...\tCTRL+E'),
|
||||
self)
|
||||
_('Open &Excellon ...\tCTRL+E'), self)
|
||||
self.menufile_open.addAction(self.menufileopenexcellon)
|
||||
|
||||
# Open G-Code ...
|
||||
@ -115,12 +115,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
self.menufile_scripting = self.menufile.addMenu(QtGui.QIcon('share/script16.png'), _('Scripting'))
|
||||
self.menufile_scripting.setToolTipsVisible(True)
|
||||
|
||||
self.menufilenewscript = QtWidgets.QAction(QtGui.QIcon('share/script_new16.png'), _('New Script ...'),
|
||||
self)
|
||||
self.menufileopenscript = QtWidgets.QAction(QtGui.QIcon('share/script_open16.png'), _('Open Script ...'),
|
||||
self)
|
||||
self.menufilerunscript = QtWidgets.QAction(QtGui.QIcon('share/script16.png'), _('Run Script ...\tSHIFT+S'),
|
||||
self)
|
||||
self.menufilenewscript = QtWidgets.QAction(QtGui.QIcon('share/script_new16.png'), _('New Script ...'), self)
|
||||
self.menufileopenscript = QtWidgets.QAction(QtGui.QIcon('share/script_open16.png'), _('Open Script ...'), self)
|
||||
self.menufilerunscript = QtWidgets.QAction(QtGui.QIcon('share/script16.png'),
|
||||
_('Run Script ...\tSHIFT+S'), self)
|
||||
self.menufilerunscript.setToolTip(
|
||||
_("Will run the opened Tcl Script thus\n"
|
||||
"enabling the automation of certain\n"
|
||||
@ -174,8 +172,8 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
|
||||
self.menufileexport.addSeparator()
|
||||
|
||||
self.menufileexportexcellon = QtWidgets.QAction(QtGui.QIcon('share/drill32.png'), _('Export &Excellon ...'),
|
||||
self)
|
||||
self.menufileexportexcellon = QtWidgets.QAction(QtGui.QIcon('share/drill32.png'),
|
||||
_('Export &Excellon ...'), self)
|
||||
self.menufileexportexcellon.setToolTip(
|
||||
_("Will export an Excellon Object as Excellon file,\n"
|
||||
"the coordinates format, the file units and zeros\n"
|
||||
@ -183,8 +181,8 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
)
|
||||
self.menufileexport.addAction(self.menufileexportexcellon)
|
||||
|
||||
self.menufileexportgerber = QtWidgets.QAction(QtGui.QIcon('share/flatcam_icon32.png'), _('Export &Gerber ...'),
|
||||
self)
|
||||
self.menufileexportgerber = QtWidgets.QAction(QtGui.QIcon('share/flatcam_icon32.png'),
|
||||
_('Export &Gerber ...'), self)
|
||||
self.menufileexportgerber.setToolTip(
|
||||
_("Will export an Gerber Object as Gerber file,\n"
|
||||
"the coordinates format, the file units and zeros\n"
|
||||
@ -214,8 +212,8 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
self.menufile_save.addAction(self.menufilesaveprojectas)
|
||||
|
||||
# Save Project Copy ...
|
||||
self.menufilesaveprojectcopy = QtWidgets.QAction(QtGui.QIcon('share/floppy16.png'), _('Save Project C&opy ...'),
|
||||
self)
|
||||
self.menufilesaveprojectcopy = QtWidgets.QAction(QtGui.QIcon('share/floppy16.png'),
|
||||
_('Save Project C&opy ...'), self)
|
||||
self.menufile_save.addAction(self.menufilesaveprojectcopy)
|
||||
|
||||
# Separator
|
||||
@ -299,8 +297,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
self.menuedit.addSeparator()
|
||||
self.menuedittoggleunits = self.menuedit.addAction(QtGui.QIcon('share/toggle_units16.png'),
|
||||
_('Toggle Units\tQ'))
|
||||
self.menueditselectall = self.menuedit.addAction(QtGui.QIcon('share/select_all.png'),
|
||||
_('&Select All\tCTRL+A'))
|
||||
self.menueditselectall = self.menuedit.addAction(QtGui.QIcon('share/select_all.png'), _('&Select All\tCTRL+A'))
|
||||
|
||||
# Separator
|
||||
self.menuedit.addSeparator()
|
||||
@ -461,19 +458,19 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
)
|
||||
self.exc_editor_menu.addSeparator()
|
||||
|
||||
self.exc_move_drill_menuitem = self.exc_editor_menu.addAction(
|
||||
QtGui.QIcon('share/move32.png'),_( 'Move Drill(s)\tM'))
|
||||
self.exc_move_drill_menuitem = self.exc_editor_menu.addAction(QtGui.QIcon('share/move32.png'),
|
||||
_('Move Drill(s)\tM'))
|
||||
|
||||
# ## APPLICATION GERBER EDITOR MENU ###
|
||||
self.grb_editor_menu = QtWidgets.QMenu(_(">Gerber Editor<"))
|
||||
self.menu.addMenu(self.grb_editor_menu)
|
||||
|
||||
self.grb_add_pad_menuitem = self.grb_editor_menu.addAction(
|
||||
QtGui.QIcon('share/aperture16.png'), _('Add Pad\tP'))
|
||||
self.grb_add_pad_array_menuitem = self.grb_editor_menu.addAction(
|
||||
QtGui.QIcon('share/padarray32.png'), _('Add Pad Array\tA'))
|
||||
self.grb_add_track_menuitem = self.grb_editor_menu.addAction(
|
||||
QtGui.QIcon('share/track32.png'), _('Add Track\tT'))
|
||||
self.grb_add_pad_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/aperture16.png'),
|
||||
_('Add Pad\tP'))
|
||||
self.grb_add_pad_array_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/padarray32.png'),
|
||||
_('Add Pad Array\tA'))
|
||||
self.grb_add_track_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/track32.png'),
|
||||
_('Add Track\tT'))
|
||||
self.grb_add_region_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/rectangle32.png'),
|
||||
_('Add Region\tN'))
|
||||
self.grb_editor_menu.addSeparator()
|
||||
@ -482,29 +479,24 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
_("Poligonize\tALT+N"))
|
||||
self.grb_add_semidisc_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/semidisc32.png'),
|
||||
_("Add SemiDisc\tE"))
|
||||
self.grb_add_disc_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/disc32.png'),
|
||||
_("Add Disc\tD"))
|
||||
self.grb_add_disc_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/disc32.png'), _("Add Disc\tD"))
|
||||
self.grb_add_buffer_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/buffer16-2.png'),
|
||||
_('Buffer\tB'))
|
||||
self.grb_add_scale_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/scale32.png'),
|
||||
_('Scale\tS'))
|
||||
self.grb_add_scale_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/scale32.png'), _('Scale\tS'))
|
||||
self.grb_add_markarea_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/markarea32.png'),
|
||||
_('Mark Area\tALT+A'))
|
||||
self.grb_add_eraser_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/eraser26.png'),
|
||||
_('Eraser\tCTRL+E'))
|
||||
self.grb_transform_menuitem = self.grb_editor_menu.addAction(
|
||||
QtGui.QIcon('share/transform.png'),_( "Transform\tALT+R")
|
||||
)
|
||||
self.grb_transform_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/transform.png'),
|
||||
_("Transform\tALT+R"))
|
||||
self.grb_editor_menu.addSeparator()
|
||||
|
||||
self.grb_copy_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/copy32.png'), _('Copy\tC'))
|
||||
self.grb_delete_menuitem = self.grb_editor_menu.addAction(
|
||||
QtGui.QIcon('share/deleteshape32.png'), _('Delete\tDEL')
|
||||
)
|
||||
self.grb_delete_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/deleteshape32.png'),
|
||||
_('Delete\tDEL'))
|
||||
self.grb_editor_menu.addSeparator()
|
||||
|
||||
self.grb_move_menuitem = self.grb_editor_menu.addAction(
|
||||
QtGui.QIcon('share/move32.png'),_( 'Move\tM'))
|
||||
self.grb_move_menuitem = self.grb_editor_menu.addAction(QtGui.QIcon('share/move32.png'), _('Move\tM'))
|
||||
|
||||
self.grb_editor_menu.menuAction().setVisible(False)
|
||||
self.grb_editor_menu.setDisabled(True)
|
||||
@ -1641,7 +1633,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
self.popmenu_move = self.popMenu.addAction(QtGui.QIcon('share/move32.png'), _("Move"))
|
||||
self.popmenu_properties = self.popMenu.addAction(QtGui.QIcon('share/properties32.png'), _("Properties"))
|
||||
|
||||
|
||||
# ###################################
|
||||
# ## Here we build the CNCJob Tab ###
|
||||
# ###################################
|
||||
@ -1925,12 +1916,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
_('Add Polygon'))
|
||||
self.geo_edit_toolbar.addSeparator()
|
||||
self.geo_add_text_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/text32.png'), _('Add Text'))
|
||||
self.geo_add_buffer_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/buffer16-2.png'),
|
||||
_('Add Buffer'))
|
||||
self.geo_add_buffer_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/buffer16-2.png'), _('Add Buffer'))
|
||||
self.geo_add_paint_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/paint20_1.png'), _('Paint Shape'))
|
||||
self.geo_eraser_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/eraser26.png'), _('Eraser'))
|
||||
|
||||
|
||||
self.geo_edit_toolbar.addSeparator()
|
||||
self.geo_union_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/union32.png'), _('Polygon Union'))
|
||||
self.geo_intersection_btn = self.geo_edit_toolbar.addAction(QtGui.QIcon('share/intersection32.png'),
|
||||
@ -2378,9 +2367,9 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
if self.app.geo_editor.get_selected() is not None:
|
||||
self.app.geo_editor.cutpath()
|
||||
else:
|
||||
msg = _('Please first select a geometry item to be cutted\n' \
|
||||
'then select the geometry item that will be cutted\n' \
|
||||
'out of the first item. In the end press ~X~ key or\n' \
|
||||
msg = _('Please first select a geometry item to be cutted\n'
|
||||
'then select the geometry item that will be cutted\n'
|
||||
'out of the first item. In the end press ~X~ key or\n'
|
||||
'the toolbar button.')
|
||||
|
||||
messagebox = QtWidgets.QMessageBox()
|
||||
@ -2517,7 +2506,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
|
||||
if self.app.geo_editor.get_selected() is not None:
|
||||
self.app.geo_editor.intersection()
|
||||
else:
|
||||
msg = _("Please select geometry items \n" \
|
||||
msg = _("Please select geometry items \n"
|
||||
"on which to perform Intersection Tool.")
|
||||
|
||||
messagebox = QtWidgets.QMessageBox()
|
||||
|
Loading…
Reference in New Issue
Block a user