- modified the Tools Database and Preferences with the new parameters from CutOut Tool

- changes in Tool Cutout: now on Cutout Tool start the app will look into Tools Database and search for a tool with same diameter (or within the set tolerance) as the one from Preferences and load it if found or load a default tool if not
- Tool Cutout - this Tool can now load tools from Tools Database through buttons in the Cutout Tool
This commit is contained in:
Marius Stanciu
2020-08-28 18:52:05 +03:00
committed by Marius
parent fc539fa55b
commit 6c9c367540
10 changed files with 714 additions and 260 deletions

View File

@@ -1,7 +1,7 @@
from PyQt5 import QtWidgets
from PyQt5.QtCore import QSettings
from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox
from appGUI.GUIElements import FCDoubleSpinner, FCCheckBox, RadioSet, FCComboBox, FCLabel
from appGUI.preferences import machinist_setting
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
@@ -29,7 +29,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
self.decimals = decimals
# ## Board cutout
self.board_cutout_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
self.board_cutout_label = FCLabel("<b>%s:</b>" % _("Parameters"))
self.board_cutout_label.setToolTip(
_("Create toolpaths to cut around\n"
"the PCB and separate it from\n"
@@ -40,7 +40,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
grid0 = QtWidgets.QGridLayout()
self.layout.addLayout(grid0)
tdclabel = QtWidgets.QLabel('%s:' % _('Tool Diameter'))
tdclabel = FCLabel('%s:' % _('Tool Diameter'))
tdclabel.setToolTip(
_("Diameter of the tool used to cutout\n"
"the PCB shape out of the surrounding material.")
@@ -55,7 +55,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.cutout_tooldia_entry, 0, 1)
# Cut Z
cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
cutzlabel = FCLabel('%s:' % _('Cut Z'))
cutzlabel.setToolTip(
_(
"Cutting depth (negative)\n"
@@ -97,7 +97,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
grid0.addWidget(self.maxdepth_entry, 2, 1)
# Object kind
kindlabel = QtWidgets.QLabel('%s:' % _('Object kind'))
kindlabel = FCLabel('%s:' % _('Object kind'))
kindlabel.setToolTip(
_("Choice of what kind the object we want to cutout is.<BR>"
"- <B>Single</B>: contain a single PCB Gerber outline object.<BR>"
@@ -112,7 +112,7 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
grid0.addWidget(kindlabel, 3, 0)
grid0.addWidget(self.obj_kind_combo, 3, 1)
marginlabel = QtWidgets.QLabel('%s:' % _('Margin'))
marginlabel = FCLabel('%s:' % _('Margin'))
marginlabel.setToolTip(
_("Margin over bounds. A positive value here\n"
"will make the cutout of the PCB further from\n"
@@ -126,8 +126,9 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
grid0.addWidget(marginlabel, 4, 0)
grid0.addWidget(self.cutout_margin_entry, 4, 1)
gaplabel = QtWidgets.QLabel('%s:' % _('Gap size'))
# Gap Size
gaplabel = FCLabel('%s:' % _('Gap size'))
gaplabel.setToolTip(
_("The size of the bridge gaps in the cutout\n"
"used to keep the board connected to\n"
@@ -142,8 +143,70 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
grid0.addWidget(gaplabel, 5, 0)
grid0.addWidget(self.cutout_gap_entry, 5, 1)
# Gap Type
self.gaptype_label = FCLabel('%s:' % _("Gap type"))
self.gaptype_label.setToolTip(
_("The type of gap:\n"
"- Bridge -> the cutout will be interrupted by bridges\n"
"- Thin -> same as 'bridge' but it will be thinner by partially milling the gap\n"
"- M-Bites -> 'Mouse Bites' - same as 'bridge' but covered with drill holes")
)
gaps_label = QtWidgets.QLabel('%s:' % _('Gaps'))
self.gaptype_radio = RadioSet(
[
{'label': _('Bridge'), 'value': 'b'},
{'label': _('Thin'), 'value': 'bt'},
{'label': "M-Bites", 'value': 'mb'}
],
stretch=True
)
grid0.addWidget(self.gaptype_label, 7, 0)
grid0.addWidget(self.gaptype_radio, 7, 1)
# Thin gaps Depth
self.thin_depth_label = FCLabel('%s:' % _("Depth"))
self.thin_depth_label.setToolTip(
_("The depth until the milling is done\n"
"in order to thin the gaps.")
)
self.thin_depth_entry = FCDoubleSpinner()
self.thin_depth_entry.set_precision(self.decimals)
if machinist_setting == 0:
self.thin_depth_entry.setRange(-9999.9999, -0.00001)
else:
self.thin_depth_entry.setRange(-9999.9999, 9999.9999)
self.thin_depth_entry.setSingleStep(0.1)
grid0.addWidget(self.thin_depth_label, 9, 0)
grid0.addWidget(self.thin_depth_entry, 9, 1)
# Mouse Bites Tool Diameter
self.mb_dia_label = FCLabel('%s:' % _("Tool Diameter"))
self.mb_dia_label.setToolTip(
_("The drill hole diameter when doing mpuse bites.")
)
self.mb_dia_entry = FCDoubleSpinner()
self.mb_dia_entry.set_precision(self.decimals)
self.mb_dia_entry.setRange(0, 100.0000)
grid0.addWidget(self.mb_dia_label, 11, 0)
grid0.addWidget(self.mb_dia_entry, 11, 1)
# Mouse Bites Holes Spacing
self.mb_spacing_label = FCLabel('%s:' % _("Spacing"))
self.mb_spacing_label.setToolTip(
_("The spacing between drill holes when doing mouse bites.")
)
self.mb_spacing_entry = FCDoubleSpinner()
self.mb_spacing_entry.set_precision(self.decimals)
self.mb_spacing_entry.setRange(0, 100.0000)
grid0.addWidget(self.mb_spacing_label, 13, 0)
grid0.addWidget(self.mb_spacing_entry, 13, 1)
gaps_label = FCLabel('%s:' % _('Gaps'))
gaps_label.setToolTip(
_("Number of gaps used for the cutout.\n"
"There can be maximum 8 bridges/gaps.\n"
@@ -158,8 +221,8 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
)
self.gaps_combo = FCComboBox()
grid0.addWidget(gaps_label, 6, 0)
grid0.addWidget(self.gaps_combo, 6, 1)
grid0.addWidget(gaps_label, 15, 0)
grid0.addWidget(self.gaps_combo, 15, 1)
gaps_items = ['None', 'LR', 'TB', '4', '2LR', '2TB', '8']
for it in gaps_items:
@@ -172,11 +235,11 @@ class ToolsCutoutPrefGroupUI(OptionsGroupUI):
_("Create a convex shape surrounding the entire PCB.\n"
"Used only if the source object type is Gerber.")
)
grid0.addWidget(self.convex_box, 7, 0, 1, 2)
grid0.addWidget(self.convex_box, 17, 0, 1, 2)
self.big_cursor_cb = FCCheckBox('%s' % _("Big cursor"))
self.big_cursor_cb.setToolTip(
_("Use a big cursor when adding manual gaps."))
grid0.addWidget(self.big_cursor_cb, 8, 0, 1, 2)
grid0.addWidget(self.big_cursor_cb, 19, 0, 1, 2)
self.layout.addStretch()