- added a button in Excellon UI that will hide/show the milling section

- optimized a bit the UI for Gerber/Excellon/Geometry objects
This commit is contained in:
Marius Stanciu
2020-10-21 21:42:31 +03:00
committed by Marius
parent 52b7967b35
commit 14240e9af7
3 changed files with 59 additions and 37 deletions

View File

@@ -24,6 +24,8 @@ CHANGELOG for FlatCAM beta
- merged in the Autolevelling branch and made some PEP8 changes to the bilinearInterpolator.py file - merged in the Autolevelling branch and made some PEP8 changes to the bilinearInterpolator.py file
- added a button in Gerber UI that will hide/show the bounding box generation and the non-copper region section - added a button in Gerber UI that will hide/show the bounding box generation and the non-copper region section
- compacted the UI for the 2Sided Tool - compacted the UI for the 2Sided Tool
- added a button in Excellon UI that will hide/show the milling section
- optimized a bit the UI for Gerber/Excellon/Geometry objects
20.10.2020 20.10.2020

View File

@@ -375,12 +375,12 @@ class GerberObjectUI(ObjectUI):
_("Create the Geometry Object\n" _("Create the Geometry Object\n"
"for non-copper routing.") "for non-copper routing.")
) )
self.generate_ncc_button.setStyleSheet(""" # self.generate_ncc_button.setStyleSheet("""
QPushButton # QPushButton
{ # {
font-weight: bold; # font-weight: bold;
} # }
""") # """)
grid0.addWidget(self.generate_ncc_button, 18, 0, 1, 3) grid0.addWidget(self.generate_ncc_button, 18, 0, 1, 3)
# ## Board cutout # ## Board cutout
@@ -390,12 +390,12 @@ class GerberObjectUI(ObjectUI):
_("Generate the geometry for\n" _("Generate the geometry for\n"
"the board cutout.") "the board cutout.")
) )
self.generate_cutout_button.setStyleSheet(""" # self.generate_cutout_button.setStyleSheet("""
QPushButton # QPushButton
{ # {
font-weight: bold; # font-weight: bold;
} # }
""") # """)
grid0.addWidget(self.generate_cutout_button, 20, 0, 1, 3) grid0.addWidget(self.generate_cutout_button, 20, 0, 1, 3)
separator_line = QtWidgets.QFrame() separator_line = QtWidgets.QFrame()
@@ -737,12 +737,12 @@ class ExcellonObjectUI(ObjectUI):
self.milling_button.setToolTip( self.milling_button.setToolTip(
_("Generate a Geometry for milling drills or slots in an Excellon object.") _("Generate a Geometry for milling drills or slots in an Excellon object.")
) )
self.milling_button.setStyleSheet(""" # self.milling_button.setStyleSheet("""
QPushButton # QPushButton
{ # {
font-weight: bold; # font-weight: bold;
} # }
""") # """)
grid2.addWidget(self.milling_button, 6, 0, 1, 2) grid2.addWidget(self.milling_button, 6, 0, 1, 2)
# TODO until the Milling Tool is finished this stays disabled # TODO until the Milling Tool is finished this stays disabled
self.milling_button.setDisabled(True) self.milling_button.setDisabled(True)
@@ -752,13 +752,31 @@ class ExcellonObjectUI(ObjectUI):
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken) separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
grid2.addWidget(separator_line, 8, 0, 1, 2) grid2.addWidget(separator_line, 8, 0, 1, 2)
# ################################################################# # UTILITIES BUTTON
# ################# GRID LAYOUT 6 ############################### self.util_button = FCButton('%s' % _("UTILTIES"), checkable=True)
# ################################################################# self.util_button.setIcon(QtGui.QIcon(self.app.resource_location + '/settings18.png'))
self.grid6 = QtWidgets.QGridLayout() self.util_button.setToolTip(_("Show the Utilties."))
self.grid6.setColumnStretch(0, 0) self.util_button.setStyleSheet("""
self.grid6.setColumnStretch(1, 1) QPushButton
self.tools_box.addLayout(self.grid6) {
font-weight: bold;
}
""")
grid2.addWidget(self.util_button, 10, 0, 1, 2)
# UTILITIES Frame
self.util_frame = QtWidgets.QFrame()
self.util_frame.setContentsMargins(0, 0, 0, 0)
grid2.addWidget(self.util_frame, 12, 0, 1, 2)
self.util_box = QtWidgets.QVBoxLayout()
self.util_box.setContentsMargins(0, 0, 0, 0)
self.util_frame.setLayout(self.util_box)
self.util_frame.hide()
util_grid = QtWidgets.QGridLayout()
util_grid.setColumnStretch(0, 0)
util_grid.setColumnStretch(1, 1)
self.util_box.addLayout(util_grid)
# ### Milling Holes Drills #### # ### Milling Holes Drills ####
self.mill_hole_label = QtWidgets.QLabel('<b>%s</b>' % _('Milling Geometry')) self.mill_hole_label = QtWidgets.QLabel('<b>%s</b>' % _('Milling Geometry'))
@@ -767,14 +785,14 @@ class ExcellonObjectUI(ObjectUI):
"Select from the Tools Table above the hole dias to be\n" "Select from the Tools Table above the hole dias to be\n"
"milled. Use the # column to make the selection.") "milled. Use the # column to make the selection.")
) )
self.grid6.addWidget(self.mill_hole_label, 5, 0, 1, 3) util_grid.addWidget(self.mill_hole_label, 0, 0, 1, 3)
self.tdlabel = QtWidgets.QLabel('%s:' % _('Milling Diameter')) self.tdlabel = QtWidgets.QLabel('%s:' % _('Milling Diameter'))
self.tdlabel.setToolTip( self.tdlabel.setToolTip(
_("Diameter of the cutting tool.") _("Diameter of the cutting tool.")
) )
self.grid6.addWidget(self.tdlabel, 6, 0, 1, 3) util_grid.addWidget(self.tdlabel, 2, 0, 1, 3)
self.tooldia_entry = FCDoubleSpinner(callback=self.confirmation_message) self.tooldia_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.tooldia_entry.set_precision(self.decimals) self.tooldia_entry.set_precision(self.decimals)
@@ -793,8 +811,8 @@ class ExcellonObjectUI(ObjectUI):
} }
""") """)
self.grid6.addWidget(self.tooldia_entry, 7, 0, 1, 2) util_grid.addWidget(self.tooldia_entry, 4, 0, 1, 2)
self.grid6.addWidget(self.generate_milling_button, 7, 2) util_grid.addWidget(self.generate_milling_button, 4, 2)
self.slot_tooldia_entry = FCDoubleSpinner(callback=self.confirmation_message) self.slot_tooldia_entry = FCDoubleSpinner(callback=self.confirmation_message)
self.slot_tooldia_entry.set_precision(self.decimals) self.slot_tooldia_entry.set_precision(self.decimals)
@@ -813,8 +831,8 @@ class ExcellonObjectUI(ObjectUI):
} }
""") """)
self.grid6.addWidget(self.slot_tooldia_entry, 8, 0, 1, 2) util_grid.addWidget(self.slot_tooldia_entry, 6, 0, 1, 2)
self.grid6.addWidget(self.generate_milling_slots_button, 8, 2) util_grid.addWidget(self.generate_milling_slots_button, 6, 2)
def hide_drills(self, state=True): def hide_drills(self, state=True):
if state is True: if state is True:
@@ -1771,12 +1789,12 @@ class GeometryObjectUI(ObjectUI):
_("Create the Geometry Object\n" _("Create the Geometry Object\n"
"for non-copper routing.") "for non-copper routing.")
) )
self.generate_ncc_button.setStyleSheet(""" # self.generate_ncc_button.setStyleSheet("""
QPushButton # QPushButton
{ # {
font-weight: bold; # font-weight: bold;
} # }
""") # """)
self.grid4.addWidget(self.generate_ncc_button, 32, 0, 1, 2) self.grid4.addWidget(self.generate_ncc_button, 32, 0, 1, 2)

View File

@@ -184,6 +184,8 @@ class ExcellonObject(FlatCAMObj, Excellon):
self.ui.drill_button.clicked.connect(lambda: self.app.drilling_tool.run(toggle=True)) self.ui.drill_button.clicked.connect(lambda: self.app.drilling_tool.run(toggle=True))
# self.ui.milling_button.clicked.connect(lambda: self.app.milling_tool.run(toggle=True)) # self.ui.milling_button.clicked.connect(lambda: self.app.milling_tool.run(toggle=True))
# UTILITIES
self.ui.util_button.clicked.connect(lambda st: self.ui.util_frame.show() if st else self.ui.util_frame.hide())
self.ui.generate_milling_button.clicked.connect(self.on_generate_milling_button_click) self.ui.generate_milling_button.clicked.connect(self.on_generate_milling_button_click)
self.ui.generate_milling_slots_button.clicked.connect(self.on_generate_milling_slots_button_click) self.ui.generate_milling_slots_button.clicked.connect(self.on_generate_milling_slots_button_click)