- created menu links and shortcut keys for adding a new empty Gerber objects; on update of the edited Gerber, if the source object was an empty one (new blank one) this source obj will be deleted

- removed the old apertures editing from Gerber Obj selected tab
This commit is contained in:
Marius Stanciu
2019-04-10 20:31:37 +03:00
parent 28dac56051
commit 7c0cfac8de
6 changed files with 47 additions and 278 deletions

View File

@@ -66,6 +66,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
self.menufilenewgeo.setToolTip(
_("Will create a new, empty Geometry Object.")
)
self.menufilenewgrb = self.menufilenew.addAction(QtGui.QIcon('share/flatcam_icon32.png'), _('Gerber\tB'))
self.menufilenewgrb.setToolTip(
_("Will create a new, empty Gerber Object.")
)
self.menufilenewexc = self.menufilenew.addAction(QtGui.QIcon('share/drill16.png'), _('Excellon\tL'))
self.menufilenewexc.setToolTip(
_("Will create a new, empty Excellon Object.")
@@ -590,6 +594,7 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
### Edit Toolbar ###
self.newgeo_btn = self.toolbargeo.addAction(QtGui.QIcon('share/new_geo32_bis.png'), _("New Blank Geometry"))
self.newgrb_btn = self.toolbargeo.addAction(QtGui.QIcon('share/new_geo32.png'), _("New Blank Gerber"))
self.newexc_btn = self.toolbargeo.addAction(QtGui.QIcon('share/new_exc32.png'), _("New Blank Excellon"))
self.toolbargeo.addSeparator()
self.editgeo_btn = self.toolbargeo.addAction(QtGui.QIcon('share/edit32.png'), _("Editor"))
@@ -2070,6 +2075,10 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
select.ui.plot_cb.toggle()
self.app.delete_selection_shape()
# New Geometry
if key == QtCore.Qt.Key_B:
self.app.new_gerber_object()
# Copy Object Name
if key == QtCore.Qt.Key_E:
self.app.object2editor()
@@ -2575,7 +2584,6 @@ class FlatCAMGUI(QtWidgets.QMainWindow):
if key == QtCore.Qt.Key_T or key == 'T':
self.app.grb_editor.launched_from_shortcuts = True
## Current application units in Upper Case
self.units = self.general_defaults_group.general_app_group.units_radio.get_value().upper()
self.app.grb_editor.select_tool('track')
return

View File

@@ -244,94 +244,8 @@ class GerberObjectUI(ObjectUI):
_("Mark the aperture instances on canvas."))
# self.apertures_table.setColumnHidden(5, True)
#### Aperture EDIT ####
self.transform_aperture_grid = QtWidgets.QGridLayout()
self.custom_box.addLayout(self.transform_aperture_grid)
# Delete Aperture
self.delete_aperture_label = QtWidgets.QLabel(_('Delete aperture:'))
self.delete_aperture_label.setToolTip(
_("Delete selected apertures.")
)
self.delete_aperture_label.setFixedWidth(90)
self.transform_aperture_grid.addWidget(self.delete_aperture_label, 0, 0)
self.delete_aperture_button = QtWidgets.QPushButton(_('Delete'))
self.delete_aperture_button.setToolTip(
_("Delete selected apertures.")
)
self.delete_aperture_button.setFixedWidth(70)
self.transform_aperture_grid.addWidget(self.delete_aperture_button, 0, 2)
# Scale Aperture Factor
self.scale_aperture_label = QtWidgets.QLabel(_('Scale Factor:'))
self.scale_aperture_label.setToolTip(
_("Change the size of the selected apertures.\n"
"Factor by which to multiply\n"
"geometric features of this object.")
)
self.scale_aperture_label.setFixedWidth(90)
self.transform_aperture_grid.addWidget(self.scale_aperture_label, 1, 0)
self.scale_aperture_entry = FloatEntry2()
self.transform_aperture_grid.addWidget(self.scale_aperture_entry, 1, 1)
# Scale Button
self.scale_aperture_button = QtWidgets.QPushButton(_('Scale'))
self.scale_aperture_button.setToolTip(
_("Perform scaling operation on the selected apertures.")
)
self.scale_aperture_button.setFixedWidth(70)
self.transform_aperture_grid.addWidget(self.scale_aperture_button, 1, 2)
# Buffer Aperture Factor
self.buffer_aperture_label = QtWidgets.QLabel(_('Buffer Factor:'))
self.buffer_aperture_label.setToolTip(
_("Change the size of the selected apertures.\n"
"Factor by which to expand/shrink\n"
"geometric features of this object.")
)
self.buffer_aperture_label.setFixedWidth(90)
self.transform_aperture_grid.addWidget(self.buffer_aperture_label, 2, 0)
self.buffer_aperture_entry = FloatEntry2()
self.transform_aperture_grid.addWidget(self.buffer_aperture_entry, 2, 1)
# Buffer Button
self.buffer_aperture_button = QtWidgets.QPushButton(_('Buffer'))
self.buffer_aperture_button.setToolTip(
_("Perform buffer operation on the selected apertures.")
)
self.buffer_aperture_button.setFixedWidth(70)
self.transform_aperture_grid.addWidget(self.buffer_aperture_button, 2, 2)
new_hlay = QtWidgets.QHBoxLayout()
self.custom_box.addLayout(new_hlay)
self.new_grb_label = QtWidgets.QLabel(_("<b>Generate new Gerber Object:</b>"))
self.new_grb_label.setToolTip(
_("Will generate a new Gerber object from the changed apertures.")
)
new_hlay.addWidget(self.new_grb_label)
new_hlay.addStretch()
self.new_grb_button = FCButton(_('Go'))
self.new_grb_button.setToolTip(
_("Will generate a new Gerber object from the changed apertures.\n"
"This new object can then be isolated etc."))
self.new_grb_button.setFixedWidth(70)
new_hlay.addWidget(self.new_grb_button)
# start with apertures table hidden
self.apertures_table.setVisible(False)
self.scale_aperture_label.setVisible(False)
self.scale_aperture_entry.setVisible(False)
self.scale_aperture_button.setVisible(False)
self.buffer_aperture_label.setVisible(False)
self.buffer_aperture_entry.setVisible(False)
self.buffer_aperture_button.setVisible(False)
# Isolation Routing
self.isolation_routing_label = QtWidgets.QLabel(_("<b>Isolation Routing:</b>"))