Grouped the preferences UI files by tab (except for tools1/2 which I put together)
This commit is contained in:
171
flatcamGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py
Normal file
171
flatcamGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py
Normal file
@@ -0,0 +1,171 @@
|
||||
from PyQt5 import QtWidgets
|
||||
|
||||
from flatcamGUI.GUIElements import FCCheckBox, RadioSet, FCDoubleSpinner, FCSpinner, OptionalInputSection
|
||||
from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
|
||||
class GerberAdvOptPrefGroupUI(OptionsGroupUI):
|
||||
def __init__(self, decimals=4, parent=None):
|
||||
# OptionsGroupUI.__init__(self, "Gerber Adv. Options Preferences", parent=parent)
|
||||
super(GerberAdvOptPrefGroupUI, self).__init__(self)
|
||||
|
||||
self.setTitle(str(_("Gerber Adv. Options")))
|
||||
self.decimals = decimals
|
||||
|
||||
# ## Advanced Gerber Parameters
|
||||
self.adv_param_label = QtWidgets.QLabel('<b>%s:</b>' % _('Advanced Options'))
|
||||
self.adv_param_label.setToolTip(
|
||||
_("A list of Gerber advanced parameters.\n"
|
||||
"Those parameters are available only for\n"
|
||||
"Advanced App. Level.")
|
||||
)
|
||||
self.layout.addWidget(self.adv_param_label)
|
||||
|
||||
grid0 = QtWidgets.QGridLayout()
|
||||
self.layout.addLayout(grid0)
|
||||
|
||||
# Follow Attribute
|
||||
self.follow_cb = FCCheckBox(label=_('"Follow"'))
|
||||
self.follow_cb.setToolTip(
|
||||
_("Generate a 'Follow' geometry.\n"
|
||||
"This means that it will cut through\n"
|
||||
"the middle of the trace.")
|
||||
)
|
||||
grid0.addWidget(self.follow_cb, 0, 0, 1, 2)
|
||||
|
||||
# Aperture Table Visibility CB
|
||||
self.aperture_table_visibility_cb = FCCheckBox(label=_('Table Show/Hide'))
|
||||
self.aperture_table_visibility_cb.setToolTip(
|
||||
_("Toggle the display of the Gerber Apertures Table.\n"
|
||||
"Also, on hide, it will delete all mark shapes\n"
|
||||
"that are drawn on canvas.")
|
||||
|
||||
)
|
||||
grid0.addWidget(self.aperture_table_visibility_cb, 1, 0, 1, 2)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
grid0.addWidget(separator_line, 2, 0, 1, 2)
|
||||
|
||||
# Tool Type
|
||||
self.tool_type_label = QtWidgets.QLabel('<b>%s</b>' % _('Tool Type'))
|
||||
self.tool_type_label.setToolTip(
|
||||
_("Choose which tool to use for Gerber isolation:\n"
|
||||
"'Circular' or 'V-shape'.\n"
|
||||
"When the 'V-shape' is selected then the tool\n"
|
||||
"diameter will depend on the chosen cut depth.")
|
||||
)
|
||||
self.tool_type_radio = RadioSet([{'label': 'Circular', 'value': 'circular'},
|
||||
{'label': 'V-Shape', 'value': 'v'}])
|
||||
|
||||
grid0.addWidget(self.tool_type_label, 3, 0)
|
||||
grid0.addWidget(self.tool_type_radio, 3, 1, 1, 2)
|
||||
|
||||
# Tip Dia
|
||||
self.tipdialabel = QtWidgets.QLabel('%s:' % _('V-Tip Dia'))
|
||||
self.tipdialabel.setToolTip(
|
||||
_("The tip diameter for V-Shape Tool")
|
||||
)
|
||||
self.tipdia_spinner = FCDoubleSpinner()
|
||||
self.tipdia_spinner.set_precision(self.decimals)
|
||||
self.tipdia_spinner.set_range(-99.9999, 99.9999)
|
||||
self.tipdia_spinner.setSingleStep(0.1)
|
||||
self.tipdia_spinner.setWrapping(True)
|
||||
grid0.addWidget(self.tipdialabel, 4, 0)
|
||||
grid0.addWidget(self.tipdia_spinner, 4, 1, 1, 2)
|
||||
|
||||
# Tip Angle
|
||||
self.tipanglelabel = QtWidgets.QLabel('%s:' % _('V-Tip Angle'))
|
||||
self.tipanglelabel.setToolTip(
|
||||
_("The tip angle for V-Shape Tool.\n"
|
||||
"In degree.")
|
||||
)
|
||||
self.tipangle_spinner = FCSpinner()
|
||||
self.tipangle_spinner.set_range(1, 180)
|
||||
self.tipangle_spinner.set_step(5)
|
||||
self.tipangle_spinner.setWrapping(True)
|
||||
grid0.addWidget(self.tipanglelabel, 5, 0)
|
||||
grid0.addWidget(self.tipangle_spinner, 5, 1, 1, 2)
|
||||
|
||||
# Cut Z
|
||||
self.cutzlabel = QtWidgets.QLabel('%s:' % _('Cut Z'))
|
||||
self.cutzlabel.setToolTip(
|
||||
_("Cutting depth (negative)\n"
|
||||
"below the copper surface.")
|
||||
)
|
||||
self.cutz_spinner = FCDoubleSpinner()
|
||||
self.cutz_spinner.set_precision(self.decimals)
|
||||
self.cutz_spinner.set_range(-99.9999, 0.0000)
|
||||
self.cutz_spinner.setSingleStep(0.1)
|
||||
self.cutz_spinner.setWrapping(True)
|
||||
|
||||
grid0.addWidget(self.cutzlabel, 6, 0)
|
||||
grid0.addWidget(self.cutz_spinner, 6, 1, 1, 2)
|
||||
|
||||
# Isolation Type
|
||||
self.iso_type_label = QtWidgets.QLabel('%s:' % _('Isolation Type'))
|
||||
self.iso_type_label.setToolTip(
|
||||
_("Choose how the isolation will be executed:\n"
|
||||
"- 'Full' -> complete isolation of polygons\n"
|
||||
"- 'Ext' -> will isolate only on the outside\n"
|
||||
"- 'Int' -> will isolate only on the inside\n"
|
||||
"'Exterior' isolation is almost always possible\n"
|
||||
"(with the right tool) but 'Interior'\n"
|
||||
"isolation can be done only when there is an opening\n"
|
||||
"inside of the polygon (e.g polygon is a 'doughnut' shape).")
|
||||
)
|
||||
self.iso_type_radio = RadioSet([{'label': _('Full'), 'value': 'full'},
|
||||
{'label': _('Exterior'), 'value': 'ext'},
|
||||
{'label': _('Interior'), 'value': 'int'}])
|
||||
|
||||
grid0.addWidget(self.iso_type_label, 7, 0,)
|
||||
grid0.addWidget(self.iso_type_radio, 7, 1, 1, 2)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
grid0.addWidget(separator_line, 8, 0, 1, 2)
|
||||
|
||||
# Buffering Type
|
||||
buffering_label = QtWidgets.QLabel('%s:' % _('Buffering'))
|
||||
buffering_label.setToolTip(
|
||||
_("Buffering type:\n"
|
||||
"- None --> best performance, fast file loading but no so good display\n"
|
||||
"- Full --> slow file loading but good visuals. This is the default.\n"
|
||||
"<<WARNING>>: Don't change this unless you know what you are doing !!!")
|
||||
)
|
||||
self.buffering_radio = RadioSet([{'label': _('None'), 'value': 'no'},
|
||||
{'label': _('Full'), 'value': 'full'}])
|
||||
grid0.addWidget(buffering_label, 9, 0)
|
||||
grid0.addWidget(self.buffering_radio, 9, 1)
|
||||
|
||||
# Simplification
|
||||
self.simplify_cb = FCCheckBox(label=_('Simplify'))
|
||||
self.simplify_cb.setToolTip(
|
||||
_("When checked all the Gerber polygons will be\n"
|
||||
"loaded with simplification having a set tolerance.\n"
|
||||
"<<WARNING>>: Don't change this unless you know what you are doing !!!")
|
||||
)
|
||||
grid0.addWidget(self.simplify_cb, 10, 0, 1, 2)
|
||||
|
||||
# Simplification tolerance
|
||||
self.simplification_tol_label = QtWidgets.QLabel(_('Tolerance'))
|
||||
self.simplification_tol_label.setToolTip(_("Tolerance for polygon simplification."))
|
||||
|
||||
self.simplification_tol_spinner = FCDoubleSpinner()
|
||||
self.simplification_tol_spinner.set_precision(self.decimals + 1)
|
||||
self.simplification_tol_spinner.setWrapping(True)
|
||||
self.simplification_tol_spinner.setRange(0.00000, 0.01000)
|
||||
self.simplification_tol_spinner.setSingleStep(0.0001)
|
||||
|
||||
grid0.addWidget(self.simplification_tol_label, 11, 0)
|
||||
grid0.addWidget(self.simplification_tol_spinner, 11, 1)
|
||||
self.ois_simplif = OptionalInputSection(
|
||||
self.simplify_cb,
|
||||
[
|
||||
self.simplification_tol_label, self.simplification_tol_spinner
|
||||
],
|
||||
logic=True)
|
||||
|
||||
self.layout.addStretch()
|
||||
232
flatcamGUI/preferences/gerber/GerberEditorPrefGroupUI.py
Normal file
232
flatcamGUI/preferences/gerber/GerberEditorPrefGroupUI.py
Normal file
@@ -0,0 +1,232 @@
|
||||
from PyQt5 import QtWidgets
|
||||
|
||||
from flatcamGUI.GUIElements import FCSpinner, FCDoubleSpinner, FCComboBox, FCEntry, RadioSet
|
||||
from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
|
||||
class GerberEditorPrefGroupUI(OptionsGroupUI):
|
||||
def __init__(self, decimals=4, parent=None):
|
||||
# OptionsGroupUI.__init__(self, "Gerber Adv. Options Preferences", parent=parent)
|
||||
super(GerberEditorPrefGroupUI, self).__init__(self)
|
||||
|
||||
self.setTitle(str(_("Gerber Editor")))
|
||||
self.decimals = decimals
|
||||
|
||||
# Advanced Gerber Parameters
|
||||
self.param_label = QtWidgets.QLabel("<b>%s:</b>" % _("Parameters"))
|
||||
self.param_label.setToolTip(
|
||||
_("A list of Gerber Editor parameters.")
|
||||
)
|
||||
self.layout.addWidget(self.param_label)
|
||||
|
||||
grid0 = QtWidgets.QGridLayout()
|
||||
self.layout.addLayout(grid0)
|
||||
|
||||
# Selection Limit
|
||||
self.sel_limit_label = QtWidgets.QLabel('%s:' % _("Selection limit"))
|
||||
self.sel_limit_label.setToolTip(
|
||||
_("Set the number of selected Gerber geometry\n"
|
||||
"items above which the utility geometry\n"
|
||||
"becomes just a selection rectangle.\n"
|
||||
"Increases the performance when moving a\n"
|
||||
"large number of geometric elements.")
|
||||
)
|
||||
self.sel_limit_entry = FCSpinner()
|
||||
self.sel_limit_entry.set_range(0, 9999)
|
||||
|
||||
grid0.addWidget(self.sel_limit_label, 0, 0)
|
||||
grid0.addWidget(self.sel_limit_entry, 0, 1)
|
||||
|
||||
# New aperture code
|
||||
self.addcode_entry_lbl = QtWidgets.QLabel('%s:' % _('New Aperture code'))
|
||||
self.addcode_entry_lbl.setToolTip(
|
||||
_("Code for the new aperture")
|
||||
)
|
||||
|
||||
self.addcode_entry = FCSpinner()
|
||||
self.addcode_entry.set_range(10, 99)
|
||||
self.addcode_entry.setWrapping(True)
|
||||
|
||||
grid0.addWidget(self.addcode_entry_lbl, 1, 0)
|
||||
grid0.addWidget(self.addcode_entry, 1, 1)
|
||||
|
||||
# New aperture size
|
||||
self.addsize_entry_lbl = QtWidgets.QLabel('%s:' % _('New Aperture size'))
|
||||
self.addsize_entry_lbl.setToolTip(
|
||||
_("Size for the new aperture")
|
||||
)
|
||||
|
||||
self.addsize_entry = FCDoubleSpinner()
|
||||
self.addsize_entry.set_range(0, 100)
|
||||
self.addsize_entry.set_precision(self.decimals)
|
||||
|
||||
grid0.addWidget(self.addsize_entry_lbl, 2, 0)
|
||||
grid0.addWidget(self.addsize_entry, 2, 1)
|
||||
|
||||
# New aperture type
|
||||
self.addtype_combo_lbl = QtWidgets.QLabel('%s:' % _('New Aperture type'))
|
||||
self.addtype_combo_lbl.setToolTip(
|
||||
_("Type for the new aperture.\n"
|
||||
"Can be 'C', 'R' or 'O'.")
|
||||
)
|
||||
|
||||
self.addtype_combo = FCComboBox()
|
||||
self.addtype_combo.addItems(['C', 'R', 'O'])
|
||||
|
||||
grid0.addWidget(self.addtype_combo_lbl, 3, 0)
|
||||
grid0.addWidget(self.addtype_combo, 3, 1)
|
||||
|
||||
# Number of pads in a pad array
|
||||
self.grb_array_size_label = QtWidgets.QLabel('%s:' % _('Nr of pads'))
|
||||
self.grb_array_size_label.setToolTip(
|
||||
_("Specify how many pads to be in the array.")
|
||||
)
|
||||
|
||||
self.grb_array_size_entry = FCSpinner()
|
||||
self.grb_array_size_entry.set_range(0, 9999)
|
||||
|
||||
grid0.addWidget(self.grb_array_size_label, 4, 0)
|
||||
grid0.addWidget(self.grb_array_size_entry, 4, 1)
|
||||
|
||||
self.adddim_label = QtWidgets.QLabel('%s:' % _('Aperture Dimensions'))
|
||||
self.adddim_label.setToolTip(
|
||||
_("Diameters of the tools, separated by comma.\n"
|
||||
"The value of the diameter has to use the dot decimals separator.\n"
|
||||
"Valid values: 0.3, 1.0")
|
||||
)
|
||||
grid0.addWidget(self.adddim_label, 5, 0)
|
||||
self.adddim_entry = FCEntry()
|
||||
grid0.addWidget(self.adddim_entry, 5, 1)
|
||||
|
||||
self.grb_array_linear_label = QtWidgets.QLabel('<b>%s:</b>' % _('Linear Pad Array'))
|
||||
grid0.addWidget(self.grb_array_linear_label, 6, 0, 1, 2)
|
||||
|
||||
# Linear Pad Array direction
|
||||
self.grb_axis_label = QtWidgets.QLabel('%s:' % _('Linear Direction'))
|
||||
self.grb_axis_label.setToolTip(
|
||||
_("Direction on which the linear array is oriented:\n"
|
||||
"- 'X' - horizontal axis \n"
|
||||
"- 'Y' - vertical axis or \n"
|
||||
"- 'Angle' - a custom angle for the array inclination")
|
||||
)
|
||||
|
||||
self.grb_axis_radio = RadioSet([{'label': _('X'), 'value': 'X'},
|
||||
{'label': _('Y'), 'value': 'Y'},
|
||||
{'label': _('Angle'), 'value': 'A'}])
|
||||
|
||||
grid0.addWidget(self.grb_axis_label, 7, 0)
|
||||
grid0.addWidget(self.grb_axis_radio, 7, 1)
|
||||
|
||||
# Linear Pad Array pitch distance
|
||||
self.grb_pitch_label = QtWidgets.QLabel('%s:' % _('Pitch'))
|
||||
self.grb_pitch_label.setToolTip(
|
||||
_("Pitch = Distance between elements of the array.")
|
||||
)
|
||||
# self.drill_pitch_label.setMinimumWidth(100)
|
||||
self.grb_pitch_entry = FCDoubleSpinner()
|
||||
self.grb_pitch_entry.set_precision(self.decimals)
|
||||
|
||||
grid0.addWidget(self.grb_pitch_label, 8, 0)
|
||||
grid0.addWidget(self.grb_pitch_entry, 8, 1)
|
||||
|
||||
# Linear Pad Array custom angle
|
||||
self.grb_angle_label = QtWidgets.QLabel('%s:' % _('Angle'))
|
||||
self.grb_angle_label.setToolTip(
|
||||
_("Angle at which each element in circular array is placed.")
|
||||
)
|
||||
self.grb_angle_entry = FCDoubleSpinner()
|
||||
self.grb_angle_entry.set_precision(self.decimals)
|
||||
self.grb_angle_entry.set_range(-360, 360)
|
||||
self.grb_angle_entry.setSingleStep(5)
|
||||
|
||||
grid0.addWidget(self.grb_angle_label, 9, 0)
|
||||
grid0.addWidget(self.grb_angle_entry, 9, 1)
|
||||
|
||||
self.grb_array_circ_label = QtWidgets.QLabel('<b>%s:</b>' % _('Circular Pad Array'))
|
||||
grid0.addWidget(self.grb_array_circ_label, 10, 0, 1, 2)
|
||||
|
||||
# Circular Pad Array direction
|
||||
self.grb_circular_direction_label = QtWidgets.QLabel('%s:' % _('Circular Direction'))
|
||||
self.grb_circular_direction_label.setToolTip(
|
||||
_("Direction for circular array.\n"
|
||||
"Can be CW = clockwise or CCW = counter clockwise.")
|
||||
)
|
||||
|
||||
self.grb_circular_dir_radio = RadioSet([{'label': _('CW'), 'value': 'CW'},
|
||||
{'label': _('CCW'), 'value': 'CCW'}])
|
||||
|
||||
grid0.addWidget(self.grb_circular_direction_label, 11, 0)
|
||||
grid0.addWidget(self.grb_circular_dir_radio, 11, 1)
|
||||
|
||||
# Circular Pad Array Angle
|
||||
self.grb_circular_angle_label = QtWidgets.QLabel('%s:' % _('Circular Angle'))
|
||||
self.grb_circular_angle_label.setToolTip(
|
||||
_("Angle at which each element in circular array is placed.")
|
||||
)
|
||||
self.grb_circular_angle_entry = FCDoubleSpinner()
|
||||
self.grb_circular_angle_entry.set_precision(self.decimals)
|
||||
self.grb_circular_angle_entry.set_range(-360, 360)
|
||||
|
||||
self.grb_circular_angle_entry.setSingleStep(5)
|
||||
|
||||
grid0.addWidget(self.grb_circular_angle_label, 12, 0)
|
||||
grid0.addWidget(self.grb_circular_angle_entry, 12, 1)
|
||||
|
||||
self.grb_array_tools_b_label = QtWidgets.QLabel('<b>%s:</b>' % _('Buffer Tool'))
|
||||
grid0.addWidget(self.grb_array_tools_b_label, 13, 0, 1, 2)
|
||||
|
||||
# Buffer Distance
|
||||
self.grb_buff_label = QtWidgets.QLabel('%s:' % _('Buffer distance'))
|
||||
self.grb_buff_label.setToolTip(
|
||||
_("Distance at which to buffer the Gerber element.")
|
||||
)
|
||||
self.grb_buff_entry = FCDoubleSpinner()
|
||||
self.grb_buff_entry.set_precision(self.decimals)
|
||||
self.grb_buff_entry.set_range(-9999, 9999)
|
||||
|
||||
grid0.addWidget(self.grb_buff_label, 14, 0)
|
||||
grid0.addWidget(self.grb_buff_entry, 14, 1)
|
||||
|
||||
self.grb_array_tools_s_label = QtWidgets.QLabel('<b>%s:</b>' % _('Scale Tool'))
|
||||
grid0.addWidget(self.grb_array_tools_s_label, 15, 0, 1, 2)
|
||||
|
||||
# Scale Factor
|
||||
self.grb_scale_label = QtWidgets.QLabel('%s:' % _('Scale factor'))
|
||||
self.grb_scale_label.setToolTip(
|
||||
_("Factor to scale the Gerber element.")
|
||||
)
|
||||
self.grb_scale_entry = FCDoubleSpinner()
|
||||
self.grb_scale_entry.set_precision(self.decimals)
|
||||
self.grb_scale_entry.set_range(0, 9999)
|
||||
|
||||
grid0.addWidget(self.grb_scale_label, 16, 0)
|
||||
grid0.addWidget(self.grb_scale_entry, 16, 1)
|
||||
|
||||
self.grb_array_tools_ma_label = QtWidgets.QLabel('<b>%s:</b>' % _('Mark Area Tool'))
|
||||
grid0.addWidget(self.grb_array_tools_ma_label, 17, 0, 1, 2)
|
||||
|
||||
# Mark area Tool low threshold
|
||||
self.grb_ma_low_label = QtWidgets.QLabel('%s:' % _('Threshold low'))
|
||||
self.grb_ma_low_label.setToolTip(
|
||||
_("Threshold value under which the apertures are not marked.")
|
||||
)
|
||||
self.grb_ma_low_entry = FCDoubleSpinner()
|
||||
self.grb_ma_low_entry.set_precision(self.decimals)
|
||||
self.grb_ma_low_entry.set_range(0, 9999)
|
||||
|
||||
grid0.addWidget(self.grb_ma_low_label, 18, 0)
|
||||
grid0.addWidget(self.grb_ma_low_entry, 18, 1)
|
||||
|
||||
# Mark area Tool high threshold
|
||||
self.grb_ma_high_label = QtWidgets.QLabel('%s:' % _('Threshold high'))
|
||||
self.grb_ma_high_label.setToolTip(
|
||||
_("Threshold value over which the apertures are not marked.")
|
||||
)
|
||||
self.grb_ma_high_entry = FCDoubleSpinner()
|
||||
self.grb_ma_high_entry.set_precision(self.decimals)
|
||||
self.grb_ma_high_entry.set_range(0, 9999)
|
||||
|
||||
grid0.addWidget(self.grb_ma_high_label, 19, 0)
|
||||
grid0.addWidget(self.grb_ma_high_entry, 19, 1)
|
||||
|
||||
self.layout.addStretch()
|
||||
103
flatcamGUI/preferences/gerber/GerberExpPrefGroupUI.py
Normal file
103
flatcamGUI/preferences/gerber/GerberExpPrefGroupUI.py
Normal file
@@ -0,0 +1,103 @@
|
||||
from PyQt5 import QtWidgets, QtCore
|
||||
|
||||
from flatcamGUI.GUIElements import RadioSet, FCSpinner
|
||||
from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
|
||||
class GerberExpPrefGroupUI(OptionsGroupUI):
|
||||
|
||||
def __init__(self, decimals=4, parent=None):
|
||||
super(GerberExpPrefGroupUI, self).__init__(self)
|
||||
|
||||
self.setTitle(str(_("Gerber Export")))
|
||||
self.decimals = decimals
|
||||
|
||||
# Plot options
|
||||
self.export_options_label = QtWidgets.QLabel("<b>%s:</b>" % _("Export Options"))
|
||||
self.export_options_label.setToolTip(
|
||||
_("The parameters set here are used in the file exported\n"
|
||||
"when using the File -> Export -> Export Gerber menu entry.")
|
||||
)
|
||||
self.layout.addWidget(self.export_options_label)
|
||||
|
||||
form = QtWidgets.QFormLayout()
|
||||
self.layout.addLayout(form)
|
||||
|
||||
# Gerber Units
|
||||
self.gerber_units_label = QtWidgets.QLabel('%s:' % _('Units'))
|
||||
self.gerber_units_label.setToolTip(
|
||||
_("The units used in the Gerber file.")
|
||||
)
|
||||
|
||||
self.gerber_units_radio = RadioSet([{'label': _('INCH'), 'value': 'IN'},
|
||||
{'label': _('MM'), 'value': 'MM'}])
|
||||
self.gerber_units_radio.setToolTip(
|
||||
_("The units used in the Gerber file.")
|
||||
)
|
||||
|
||||
form.addRow(self.gerber_units_label, self.gerber_units_radio)
|
||||
|
||||
# Gerber format
|
||||
self.digits_label = QtWidgets.QLabel("%s:" % _("Int/Decimals"))
|
||||
self.digits_label.setToolTip(
|
||||
_("The number of digits in the whole part of the number\n"
|
||||
"and in the fractional part of the number.")
|
||||
)
|
||||
|
||||
hlay1 = QtWidgets.QHBoxLayout()
|
||||
|
||||
self.format_whole_entry = FCSpinner()
|
||||
self.format_whole_entry.set_range(0, 9)
|
||||
self.format_whole_entry.set_step(1)
|
||||
self.format_whole_entry.setWrapping(True)
|
||||
|
||||
self.format_whole_entry.setMinimumWidth(30)
|
||||
self.format_whole_entry.setToolTip(
|
||||
_("This numbers signify the number of digits in\n"
|
||||
"the whole part of Gerber coordinates.")
|
||||
)
|
||||
hlay1.addWidget(self.format_whole_entry, QtCore.Qt.AlignLeft)
|
||||
|
||||
gerber_separator_label = QtWidgets.QLabel(':')
|
||||
gerber_separator_label.setFixedWidth(5)
|
||||
hlay1.addWidget(gerber_separator_label, QtCore.Qt.AlignLeft)
|
||||
|
||||
self.format_dec_entry = FCSpinner()
|
||||
self.format_dec_entry.set_range(0, 9)
|
||||
self.format_dec_entry.set_step(1)
|
||||
self.format_dec_entry.setWrapping(True)
|
||||
|
||||
self.format_dec_entry.setMinimumWidth(30)
|
||||
self.format_dec_entry.setToolTip(
|
||||
_("This numbers signify the number of digits in\n"
|
||||
"the decimal part of Gerber coordinates.")
|
||||
)
|
||||
hlay1.addWidget(self.format_dec_entry, QtCore.Qt.AlignLeft)
|
||||
hlay1.addStretch()
|
||||
|
||||
form.addRow(self.digits_label, hlay1)
|
||||
|
||||
# Gerber Zeros
|
||||
self.zeros_label = QtWidgets.QLabel('%s:' % _('Zeros'))
|
||||
self.zeros_label.setAlignment(QtCore.Qt.AlignLeft)
|
||||
self.zeros_label.setToolTip(
|
||||
_("This sets the type of Gerber zeros.\n"
|
||||
"If LZ then Leading Zeros are removed and\n"
|
||||
"Trailing Zeros are kept.\n"
|
||||
"If TZ is checked then Trailing Zeros are removed\n"
|
||||
"and Leading Zeros are kept.")
|
||||
)
|
||||
|
||||
self.zeros_radio = RadioSet([{'label': _('LZ'), 'value': 'L'},
|
||||
{'label': _('TZ'), 'value': 'T'}])
|
||||
self.zeros_radio.setToolTip(
|
||||
_("This sets the type of Gerber zeros.\n"
|
||||
"If LZ then Leading Zeros are removed and\n"
|
||||
"Trailing Zeros are kept.\n"
|
||||
"If TZ is checked then Trailing Zeros are removed\n"
|
||||
"and Leading Zeros are kept.")
|
||||
)
|
||||
|
||||
form.addRow(self.zeros_label, self.zeros_radio)
|
||||
|
||||
self.layout.addStretch()
|
||||
259
flatcamGUI/preferences/gerber/GerberGenPrefGroupUI.py
Normal file
259
flatcamGUI/preferences/gerber/GerberGenPrefGroupUI.py
Normal file
@@ -0,0 +1,259 @@
|
||||
from PyQt5 import QtWidgets, QtCore, QtGui
|
||||
|
||||
from flatcamGUI.GUIElements import FCCheckBox, FCSpinner, RadioSet, FCEntry
|
||||
from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
|
||||
class GerberGenPrefGroupUI(OptionsGroupUI):
|
||||
def __init__(self, decimals=4, parent=None):
|
||||
# OptionsGroupUI.__init__(self, "Gerber General Preferences", parent=parent)
|
||||
super(GerberGenPrefGroupUI, self).__init__(self)
|
||||
|
||||
self.parent = parent
|
||||
self.setTitle(str(_("Gerber General")))
|
||||
self.decimals = decimals
|
||||
|
||||
# ## Plot options
|
||||
self.plot_options_label = QtWidgets.QLabel("<b>%s:</b>" % _("Plot Options"))
|
||||
self.layout.addWidget(self.plot_options_label)
|
||||
|
||||
grid0 = QtWidgets.QGridLayout()
|
||||
self.layout.addLayout(grid0)
|
||||
|
||||
# Solid CB
|
||||
self.solid_cb = FCCheckBox(label='%s' % _('Solid'))
|
||||
self.solid_cb.setToolTip(
|
||||
_("Solid color polygons.")
|
||||
)
|
||||
grid0.addWidget(self.solid_cb, 0, 0)
|
||||
|
||||
# Multicolored CB
|
||||
self.multicolored_cb = FCCheckBox(label='%s' % _('M-Color'))
|
||||
self.multicolored_cb.setToolTip(
|
||||
_("Draw polygons in different colors.")
|
||||
)
|
||||
grid0.addWidget(self.multicolored_cb, 0, 1)
|
||||
|
||||
# Plot CB
|
||||
self.plot_cb = FCCheckBox(label='%s' % _('Plot'))
|
||||
self.plot_options_label.setToolTip(
|
||||
_("Plot (show) this object.")
|
||||
)
|
||||
grid0.addWidget(self.plot_cb, 0, 2)
|
||||
|
||||
# Number of circle steps for circular aperture linear approximation
|
||||
self.circle_steps_label = QtWidgets.QLabel('%s:' % _("Circle Steps"))
|
||||
self.circle_steps_label.setToolTip(
|
||||
_("The number of circle steps for Gerber \n"
|
||||
"circular aperture linear approximation.")
|
||||
)
|
||||
self.circle_steps_entry = FCSpinner()
|
||||
self.circle_steps_entry.set_range(0, 9999)
|
||||
|
||||
grid0.addWidget(self.circle_steps_label, 1, 0)
|
||||
grid0.addWidget(self.circle_steps_entry, 1, 1, 1, 2)
|
||||
|
||||
grid0.addWidget(QtWidgets.QLabel(''), 2, 0, 1, 3)
|
||||
|
||||
# Default format for Gerber
|
||||
self.gerber_default_label = QtWidgets.QLabel('<b>%s:</b>' % _('Default Values'))
|
||||
self.gerber_default_label.setToolTip(
|
||||
_("Those values will be used as fallback values\n"
|
||||
"in case that they are not found in the Gerber file.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.gerber_default_label, 3, 0, 1, 3)
|
||||
|
||||
# Gerber Units
|
||||
self.gerber_units_label = QtWidgets.QLabel('%s:' % _('Units'))
|
||||
self.gerber_units_label.setToolTip(
|
||||
_("The units used in the Gerber file.")
|
||||
)
|
||||
|
||||
self.gerber_units_radio = RadioSet([{'label': _('INCH'), 'value': 'IN'},
|
||||
{'label': _('MM'), 'value': 'MM'}])
|
||||
self.gerber_units_radio.setToolTip(
|
||||
_("The units used in the Gerber file.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.gerber_units_label, 4, 0)
|
||||
grid0.addWidget(self.gerber_units_radio, 4, 1, 1, 2)
|
||||
|
||||
# Gerber Zeros
|
||||
self.gerber_zeros_label = QtWidgets.QLabel('%s:' % _('Zeros'))
|
||||
self.gerber_zeros_label.setAlignment(QtCore.Qt.AlignLeft)
|
||||
self.gerber_zeros_label.setToolTip(
|
||||
_("This sets the type of Gerber zeros.\n"
|
||||
"If LZ then Leading Zeros are removed and\n"
|
||||
"Trailing Zeros are kept.\n"
|
||||
"If TZ is checked then Trailing Zeros are removed\n"
|
||||
"and Leading Zeros are kept.")
|
||||
)
|
||||
|
||||
self.gerber_zeros_radio = RadioSet([{'label': _('LZ'), 'value': 'L'},
|
||||
{'label': _('TZ'), 'value': 'T'}])
|
||||
self.gerber_zeros_radio.setToolTip(
|
||||
_("This sets the type of Gerber zeros.\n"
|
||||
"If LZ then Leading Zeros are removed and\n"
|
||||
"Trailing Zeros are kept.\n"
|
||||
"If TZ is checked then Trailing Zeros are removed\n"
|
||||
"and Leading Zeros are kept.")
|
||||
)
|
||||
|
||||
grid0.addWidget(self.gerber_zeros_label, 5, 0)
|
||||
grid0.addWidget(self.gerber_zeros_radio, 5, 1, 1, 2)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
grid0.addWidget(separator_line, 6, 0, 1, 3)
|
||||
|
||||
# Apertures Cleaning
|
||||
self.gerber_clean_cb = FCCheckBox(label='%s' % _('Clean Apertures'))
|
||||
self.gerber_clean_cb.setToolTip(
|
||||
_("Will remove apertures that do not have geometry\n"
|
||||
"thus lowering the number of apertures in the Gerber object.")
|
||||
)
|
||||
grid0.addWidget(self.gerber_clean_cb, 7, 0, 1, 3)
|
||||
|
||||
# Apply Extra Buffering
|
||||
self.gerber_extra_buffering = FCCheckBox(label='%s' % _('Polarity change buffer'))
|
||||
self.gerber_extra_buffering.setToolTip(
|
||||
_("Will apply extra buffering for the\n"
|
||||
"solid geometry when we have polarity changes.\n"
|
||||
"May help loading Gerber files that otherwise\n"
|
||||
"do not load correctly.")
|
||||
)
|
||||
grid0.addWidget(self.gerber_extra_buffering, 8, 0, 1, 3)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
grid0.addWidget(separator_line, 9, 0, 1, 3)
|
||||
|
||||
# Gerber Object Color
|
||||
self.gerber_color_label = QtWidgets.QLabel('<b>%s</b>' % _('Gerber Object Color'))
|
||||
grid0.addWidget(self.gerber_color_label, 10, 0, 1, 3)
|
||||
|
||||
# Plot Line Color
|
||||
self.pl_color_label = QtWidgets.QLabel('%s:' % _('Outline'))
|
||||
self.pl_color_label.setToolTip(
|
||||
_("Set the line color for plotted objects.")
|
||||
)
|
||||
self.pl_color_entry = FCEntry()
|
||||
self.pl_color_button = QtWidgets.QPushButton()
|
||||
self.pl_color_button.setFixedSize(15, 15)
|
||||
|
||||
self.form_box_child_2 = QtWidgets.QHBoxLayout()
|
||||
self.form_box_child_2.addWidget(self.pl_color_entry)
|
||||
self.form_box_child_2.addWidget(self.pl_color_button)
|
||||
self.form_box_child_2.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
||||
|
||||
grid0.addWidget(self.pl_color_label, 11, 0)
|
||||
grid0.addLayout(self.form_box_child_2, 11, 1, 1, 2)
|
||||
|
||||
# Plot Fill Color
|
||||
self.pf_color_label = QtWidgets.QLabel('%s:' % _('Fill'))
|
||||
self.pf_color_label.setToolTip(
|
||||
_("Set the fill color for plotted objects.\n"
|
||||
"First 6 digits are the color and the last 2\n"
|
||||
"digits are for alpha (transparency) level.")
|
||||
)
|
||||
self.pf_color_entry = FCEntry()
|
||||
self.pf_color_button = QtWidgets.QPushButton()
|
||||
self.pf_color_button.setFixedSize(15, 15)
|
||||
|
||||
self.form_box_child_1 = QtWidgets.QHBoxLayout()
|
||||
self.form_box_child_1.addWidget(self.pf_color_entry)
|
||||
self.form_box_child_1.addWidget(self.pf_color_button)
|
||||
self.form_box_child_1.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
||||
|
||||
grid0.addWidget(self.pf_color_label, 12, 0)
|
||||
grid0.addLayout(self.form_box_child_1, 12, 1, 1, 2)
|
||||
|
||||
# Plot Fill Transparency Level
|
||||
self.pf_alpha_label = QtWidgets.QLabel('%s:' % _('Alpha'))
|
||||
self.pf_alpha_label.setToolTip(
|
||||
_("Set the fill transparency for plotted objects.")
|
||||
)
|
||||
self.pf_color_alpha_slider = QtWidgets.QSlider(QtCore.Qt.Horizontal)
|
||||
self.pf_color_alpha_slider.setMinimum(0)
|
||||
self.pf_color_alpha_slider.setMaximum(255)
|
||||
self.pf_color_alpha_slider.setSingleStep(1)
|
||||
|
||||
self.pf_color_alpha_spinner = FCSpinner()
|
||||
self.pf_color_alpha_spinner.setMinimumWidth(70)
|
||||
self.pf_color_alpha_spinner.set_range(0, 255)
|
||||
|
||||
self.form_box_child_3 = QtWidgets.QHBoxLayout()
|
||||
self.form_box_child_3.addWidget(self.pf_color_alpha_slider)
|
||||
self.form_box_child_3.addWidget(self.pf_color_alpha_spinner)
|
||||
|
||||
grid0.addWidget(self.pf_alpha_label, 13, 0)
|
||||
grid0.addLayout(self.form_box_child_3, 13, 1, 1, 2)
|
||||
|
||||
self.layout.addStretch()
|
||||
|
||||
# Setting plot colors signals
|
||||
self.pl_color_entry.editingFinished.connect(self.on_pl_color_entry)
|
||||
self.pl_color_button.clicked.connect(self.on_pl_color_button)
|
||||
self.pf_color_entry.editingFinished.connect(self.on_pf_color_entry)
|
||||
self.pf_color_button.clicked.connect(self.on_pf_color_button)
|
||||
self.pf_color_alpha_spinner.valueChanged.connect(self.on_pf_color_spinner)
|
||||
self.pf_color_alpha_slider.valueChanged.connect(self.on_pf_color_slider)
|
||||
|
||||
# Setting plot colors handlers
|
||||
def on_pf_color_entry(self):
|
||||
self.app.defaults['gerber_plot_fill'] = self.pf_color_entry.get_value()[:7] + \
|
||||
self.app.defaults['gerber_plot_fill'][7:9]
|
||||
self.pf_color_button.setStyleSheet("background-color:%s" % str(self.app.defaults['gerber_plot_fill'])[:7])
|
||||
|
||||
def on_pf_color_button(self):
|
||||
current_color = QtGui.QColor(self.app.defaults['gerber_plot_fill'][:7])
|
||||
|
||||
c_dialog = QtWidgets.QColorDialog()
|
||||
plot_fill_color = c_dialog.getColor(initial=current_color)
|
||||
|
||||
if plot_fill_color.isValid() is False:
|
||||
return
|
||||
|
||||
self.pf_color_button.setStyleSheet("background-color:%s" % str(plot_fill_color.name()))
|
||||
|
||||
new_val = str(plot_fill_color.name()) + str(self.app.defaults['gerber_plot_fill'][7:9])
|
||||
self.pf_color_entry.set_value(new_val)
|
||||
self.app.defaults['gerber_plot_fill'] = new_val
|
||||
|
||||
def on_pf_color_spinner(self):
|
||||
spinner_value = self.pf_color_alpha_spinner.value()
|
||||
self.pf_color_alpha_slider.setValue(spinner_value)
|
||||
self.app.defaults['gerber_plot_fill'] = \
|
||||
self.app.defaults['gerber_plot_fill'][:7] + \
|
||||
(hex(spinner_value)[2:] if int(hex(spinner_value)[2:], 16) > 0 else '00')
|
||||
self.app.defaults['gerber_plot_line'] = \
|
||||
self.app.defaults['gerber_plot_line'][:7] + \
|
||||
(hex(spinner_value)[2:] if int(hex(spinner_value)[2:], 16) > 0 else '00')
|
||||
|
||||
def on_pf_color_slider(self):
|
||||
slider_value = self.pf_color_alpha_slider.value()
|
||||
self.pf_color_alpha_spinner.setValue(slider_value)
|
||||
|
||||
def on_pl_color_entry(self):
|
||||
self.app.defaults['gerber_plot_line'] = self.pl_color_entry.get_value()[:7] + \
|
||||
self.app.defaults['gerber_plot_line'][7:9]
|
||||
self.pl_color_button.setStyleSheet("background-color:%s" % str(self.app.defaults['gerber_plot_line'])[:7])
|
||||
|
||||
def on_pl_color_button(self):
|
||||
current_color = QtGui.QColor(self.app.defaults['gerber_plot_line'][:7])
|
||||
# print(current_color)
|
||||
|
||||
c_dialog = QtWidgets.QColorDialog()
|
||||
plot_line_color = c_dialog.getColor(initial=current_color)
|
||||
|
||||
if plot_line_color.isValid() is False:
|
||||
return
|
||||
|
||||
self.pl_color_button.setStyleSheet("background-color:%s" % str(plot_line_color.name()))
|
||||
|
||||
new_val_line = str(plot_line_color.name()) + str(self.app.defaults['gerber_plot_line'][7:9])
|
||||
self.pl_color_entry.set_value(new_val_line)
|
||||
self.app.defaults['gerber_plot_line'] = new_val_line
|
||||
171
flatcamGUI/preferences/gerber/GerberOptPrefGroupUI.py
Normal file
171
flatcamGUI/preferences/gerber/GerberOptPrefGroupUI.py
Normal file
@@ -0,0 +1,171 @@
|
||||
from PyQt5 import QtWidgets
|
||||
|
||||
from flatcamGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox
|
||||
from flatcamGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
||||
|
||||
|
||||
class GerberOptPrefGroupUI(OptionsGroupUI):
|
||||
def __init__(self, decimals=4, parent=None):
|
||||
# OptionsGroupUI.__init__(self, "Gerber Options Preferences", parent=parent)
|
||||
super(GerberOptPrefGroupUI, self).__init__(self)
|
||||
self.decimals = decimals
|
||||
|
||||
self.setTitle(str(_("Gerber Options")))
|
||||
|
||||
# ## Isolation Routing
|
||||
self.isolation_routing_label = QtWidgets.QLabel("<b>%s:</b>" % _("Isolation Routing"))
|
||||
self.isolation_routing_label.setToolTip(
|
||||
_("Create a Geometry object with\n"
|
||||
"toolpaths to cut outside polygons.")
|
||||
)
|
||||
self.layout.addWidget(self.isolation_routing_label)
|
||||
|
||||
# Cutting Tool Diameter
|
||||
grid0 = QtWidgets.QGridLayout()
|
||||
self.layout.addLayout(grid0)
|
||||
|
||||
tdlabel = QtWidgets.QLabel('%s:' % _('Tool dia'))
|
||||
tdlabel.setToolTip(
|
||||
_("Diameter of the cutting tool.")
|
||||
)
|
||||
grid0.addWidget(tdlabel, 0, 0)
|
||||
self.iso_tool_dia_entry = FCDoubleSpinner()
|
||||
self.iso_tool_dia_entry.set_precision(self.decimals)
|
||||
self.iso_tool_dia_entry.setSingleStep(0.1)
|
||||
self.iso_tool_dia_entry.set_range(-9999, 9999)
|
||||
|
||||
grid0.addWidget(self.iso_tool_dia_entry, 0, 1)
|
||||
|
||||
# Nr of passes
|
||||
passlabel = QtWidgets.QLabel('%s:' % _('# Passes'))
|
||||
passlabel.setToolTip(
|
||||
_("Width of the isolation gap in\n"
|
||||
"number (integer) of tool widths.")
|
||||
)
|
||||
self.iso_width_entry = FCSpinner()
|
||||
self.iso_width_entry.set_range(1, 999)
|
||||
|
||||
grid0.addWidget(passlabel, 1, 0)
|
||||
grid0.addWidget(self.iso_width_entry, 1, 1)
|
||||
|
||||
# Pass overlap
|
||||
overlabel = QtWidgets.QLabel('%s:' % _('Pass overlap'))
|
||||
overlabel.setToolTip(
|
||||
_("How much (percentage) of the tool width to overlap each tool pass.")
|
||||
)
|
||||
self.iso_overlap_entry = FCDoubleSpinner(suffix='%')
|
||||
self.iso_overlap_entry.set_precision(self.decimals)
|
||||
self.iso_overlap_entry.setWrapping(True)
|
||||
self.iso_overlap_entry.setRange(0.0000, 99.9999)
|
||||
self.iso_overlap_entry.setSingleStep(0.1)
|
||||
|
||||
grid0.addWidget(overlabel, 2, 0)
|
||||
grid0.addWidget(self.iso_overlap_entry, 2, 1)
|
||||
|
||||
# Isolation Scope
|
||||
self.iso_scope_label = QtWidgets.QLabel('%s:' % _('Scope'))
|
||||
self.iso_scope_label.setToolTip(
|
||||
_("Isolation scope. Choose what to isolate:\n"
|
||||
"- 'All' -> Isolate all the polygons in the object\n"
|
||||
"- 'Selection' -> Isolate a selection of polygons.")
|
||||
)
|
||||
self.iso_scope_radio = RadioSet([{'label': _('All'), 'value': 'all'},
|
||||
{'label': _('Selection'), 'value': 'single'}])
|
||||
|
||||
grid0.addWidget(self.iso_scope_label, 3, 0)
|
||||
grid0.addWidget(self.iso_scope_radio, 3, 1, 1, 2)
|
||||
|
||||
# Milling Type
|
||||
milling_type_label = QtWidgets.QLabel('%s:' % _('Milling Type'))
|
||||
milling_type_label.setToolTip(
|
||||
_("Milling type:\n"
|
||||
"- climb / best for precision milling and to reduce tool usage\n"
|
||||
"- conventional / useful when there is no backlash compensation")
|
||||
)
|
||||
grid0.addWidget(milling_type_label, 4, 0)
|
||||
self.milling_type_radio = RadioSet([{'label': _('Climb'), 'value': 'cl'},
|
||||
{'label': _('Conventional'), 'value': 'cv'}])
|
||||
grid0.addWidget(self.milling_type_radio, 4, 1)
|
||||
|
||||
# Combine passes
|
||||
self.combine_passes_cb = FCCheckBox(label=_('Combine Passes'))
|
||||
self.combine_passes_cb.setToolTip(
|
||||
_("Combine all passes into one object")
|
||||
)
|
||||
grid0.addWidget(self.combine_passes_cb, 5, 0, 1, 2)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
grid0.addWidget(separator_line, 6, 0, 1, 2)
|
||||
|
||||
# ## Clear non-copper regions
|
||||
self.clearcopper_label = QtWidgets.QLabel("<b>%s:</b>" % _("Non-copper regions"))
|
||||
self.clearcopper_label.setToolTip(
|
||||
_("Create polygons covering the\n"
|
||||
"areas without copper on the PCB.\n"
|
||||
"Equivalent to the inverse of this\n"
|
||||
"object. Can be used to remove all\n"
|
||||
"copper from a specified region.")
|
||||
)
|
||||
self.layout.addWidget(self.clearcopper_label)
|
||||
|
||||
grid1 = QtWidgets.QGridLayout()
|
||||
self.layout.addLayout(grid1)
|
||||
|
||||
# Margin
|
||||
bmlabel = QtWidgets.QLabel('%s:' % _('Boundary Margin'))
|
||||
bmlabel.setToolTip(
|
||||
_("Specify the edge of the PCB\n"
|
||||
"by drawing a box around all\n"
|
||||
"objects with this minimum\n"
|
||||
"distance.")
|
||||
)
|
||||
grid1.addWidget(bmlabel, 0, 0)
|
||||
self.noncopper_margin_entry = FCDoubleSpinner()
|
||||
self.noncopper_margin_entry.set_precision(self.decimals)
|
||||
self.noncopper_margin_entry.setSingleStep(0.1)
|
||||
self.noncopper_margin_entry.set_range(-9999, 9999)
|
||||
grid1.addWidget(self.noncopper_margin_entry, 0, 1)
|
||||
|
||||
# Rounded corners
|
||||
self.noncopper_rounded_cb = FCCheckBox(label=_("Rounded Geo"))
|
||||
self.noncopper_rounded_cb.setToolTip(
|
||||
_("Resulting geometry will have rounded corners.")
|
||||
)
|
||||
grid1.addWidget(self.noncopper_rounded_cb, 1, 0, 1, 2)
|
||||
|
||||
separator_line = QtWidgets.QFrame()
|
||||
separator_line.setFrameShape(QtWidgets.QFrame.HLine)
|
||||
separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
|
||||
grid1.addWidget(separator_line, 2, 0, 1, 2)
|
||||
|
||||
# ## Bounding box
|
||||
self.boundingbox_label = QtWidgets.QLabel('<b>%s:</b>' % _('Bounding Box'))
|
||||
self.layout.addWidget(self.boundingbox_label)
|
||||
|
||||
grid2 = QtWidgets.QGridLayout()
|
||||
self.layout.addLayout(grid2)
|
||||
|
||||
bbmargin = QtWidgets.QLabel('%s:' % _('Boundary Margin'))
|
||||
bbmargin.setToolTip(
|
||||
_("Distance of the edges of the box\n"
|
||||
"to the nearest polygon.")
|
||||
)
|
||||
self.bbmargin_entry = FCDoubleSpinner()
|
||||
self.bbmargin_entry.set_precision(self.decimals)
|
||||
self.bbmargin_entry.setSingleStep(0.1)
|
||||
self.bbmargin_entry.set_range(-9999, 9999)
|
||||
|
||||
grid2.addWidget(bbmargin, 0, 0)
|
||||
grid2.addWidget(self.bbmargin_entry, 0, 1)
|
||||
|
||||
self.bbrounded_cb = FCCheckBox(label='%s' % _("Rounded Geo"))
|
||||
self.bbrounded_cb.setToolTip(
|
||||
_("If the bounding box is \n"
|
||||
"to have rounded corners\n"
|
||||
"their radius is equal to\n"
|
||||
"the margin.")
|
||||
)
|
||||
grid2.addWidget(self.bbrounded_cb, 1, 0, 1, 2)
|
||||
self.layout.addStretch()
|
||||
38
flatcamGUI/preferences/gerber/GerberPreferencesUI.py
Normal file
38
flatcamGUI/preferences/gerber/GerberPreferencesUI.py
Normal file
@@ -0,0 +1,38 @@
|
||||
from PyQt5 import QtWidgets
|
||||
|
||||
from flatcamGUI.preferences.gerber.GerberEditorPrefGroupUI import GerberEditorPrefGroupUI
|
||||
from flatcamGUI.preferences.gerber.GerberExpPrefGroupUI import GerberExpPrefGroupUI
|
||||
from flatcamGUI.preferences.gerber.GerberAdvOptPrefGroupUI import GerberAdvOptPrefGroupUI
|
||||
from flatcamGUI.preferences.gerber.GerberOptPrefGroupUI import GerberOptPrefGroupUI
|
||||
from flatcamGUI.preferences.gerber.GerberGenPrefGroupUI import GerberGenPrefGroupUI
|
||||
|
||||
|
||||
class GerberPreferencesUI(QtWidgets.QWidget):
|
||||
|
||||
def __init__(self, decimals, parent=None):
|
||||
QtWidgets.QWidget.__init__(self, parent=parent)
|
||||
self.layout = QtWidgets.QHBoxLayout()
|
||||
self.setLayout(self.layout)
|
||||
self.decimals = decimals
|
||||
|
||||
self.gerber_gen_group = GerberGenPrefGroupUI(decimals=self.decimals)
|
||||
self.gerber_gen_group.setMinimumWidth(250)
|
||||
self.gerber_opt_group = GerberOptPrefGroupUI(decimals=self.decimals)
|
||||
self.gerber_opt_group.setMinimumWidth(250)
|
||||
self.gerber_exp_group = GerberExpPrefGroupUI(decimals=self.decimals)
|
||||
self.gerber_exp_group.setMinimumWidth(230)
|
||||
self.gerber_adv_opt_group = GerberAdvOptPrefGroupUI(decimals=self.decimals)
|
||||
self.gerber_adv_opt_group.setMinimumWidth(200)
|
||||
self.gerber_editor_group = GerberEditorPrefGroupUI(decimals=self.decimals)
|
||||
self.gerber_editor_group.setMinimumWidth(200)
|
||||
|
||||
self.vlay = QtWidgets.QVBoxLayout()
|
||||
self.vlay.addWidget(self.gerber_opt_group)
|
||||
self.vlay.addWidget(self.gerber_exp_group)
|
||||
|
||||
self.layout.addWidget(self.gerber_gen_group)
|
||||
self.layout.addLayout(self.vlay)
|
||||
self.layout.addWidget(self.gerber_adv_opt_group)
|
||||
self.layout.addWidget(self.gerber_editor_group)
|
||||
|
||||
self.layout.addStretch()
|
||||
0
flatcamGUI/preferences/gerber/__init__.py
Normal file
0
flatcamGUI/preferences/gerber/__init__.py
Normal file
Reference in New Issue
Block a user