- solved more Shapely 2.0 deprecation warnings

- in Isolation Plugin and NCC Plugin changed the UI and the Preferences for those Plugins
This commit is contained in:
Marius Stanciu
2021-09-25 03:36:57 +03:00
committed by Marius
parent 9ca397407c
commit e73d49e2cd
11 changed files with 456 additions and 359 deletions

View File

@@ -1356,6 +1356,7 @@ class FCDoubleSpinner(QtWidgets.QDoubleSpinBox):
:param alignment: the value is aligned to left or right
:param parent:
:param callback: called when the entered value is outside limits; the min and max value will be passed to it
:param policy: by default the widget will not stretch as much as possible on horizontal
"""
super(FCDoubleSpinner, self).__init__(parent)
self.readyToEdit = True

View File

@@ -280,7 +280,7 @@ class PreferencesUIManager:
# Isolation Routing Tool
"tools_iso_tooldia": self.ui.plugin_eng_pref_form.tools_iso_group.tool_dia_entry,
"tools_iso_order": self.ui.plugin_eng_pref_form.tools_iso_group.order_radio,
"tools_iso_order": self.ui.plugin_eng_pref_form.tools_iso_group.iso_order_combo,
"tools_iso_tool_cutz": self.ui.plugin_eng_pref_form.tools_iso_group.cutz_entry,
"tools_iso_newdia": self.ui.plugin_eng_pref_form.tools_iso_group.newdia_entry,
@@ -408,7 +408,7 @@ class PreferencesUIManager:
# NCC Tool
"tools_ncc_tools": self.ui.plugin_eng_pref_form.tools_ncc_group.ncc_tool_dia_entry,
"tools_ncc_order": self.ui.plugin_eng_pref_form.tools_ncc_group.ncc_order_radio,
"tools_ncc_order": self.ui.plugin_eng_pref_form.tools_ncc_group.ncc_order_combo,
"tools_ncc_overlap": self.ui.plugin_eng_pref_form.tools_ncc_group.ncc_overlap_entry,
"tools_ncc_margin": self.ui.plugin_eng_pref_form.tools_ncc_group.ncc_margin_entry,
"tools_ncc_method": self.ui.plugin_eng_pref_form.tools_ncc_group.ncc_method_combo,

View File

@@ -1,7 +1,7 @@
from PyQt6 import QtWidgets
from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox2, FCCheckBox, FCSpinner, NumericalEvalTupleEntry, \
FCLabel, FCGridLayout
FCLabel, FCGridLayout, FCFrame
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
@@ -22,15 +22,21 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
self.defaults = defaults
# ## Clear non-copper regions
self.iso_label = FCLabel("<b>%s:</b>" % _("Parameters"))
self.iso_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
self.iso_label.setToolTip(
_("Create a Geometry object with\n"
"toolpaths to cut around polygons.")
)
self.layout.addWidget(self.iso_label)
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
self.layout.addLayout(grid0)
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
par_frame = FCFrame()
self.layout.addWidget(par_frame)
par_grid = FCGridLayout(v_spacing=5, h_spacing=3)
par_frame.setLayout(par_grid)
# Tool Dias
isotdlabel = FCLabel('<b><font color="green">%s:</font></b>' % _('Tools Dia'))
@@ -42,24 +48,49 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
self.tool_dia_entry = NumericalEvalTupleEntry(border_color='#0069A9')
self.tool_dia_entry.setPlaceholderText(_("Comma separated values"))
grid0.addWidget(isotdlabel, 0, 0)
grid0.addWidget(self.tool_dia_entry, 0, 1, 1, 2)
par_grid.addWidget(isotdlabel, 0, 0)
par_grid.addWidget(self.tool_dia_entry, 0, 1, 1, 2)
# Tool order Radio Button
self.order_label = FCLabel('%s:' % _('Tool order'))
self.order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control."))
# Tool order
self.iso_order_label = FCLabel('%s:' % _('Tool order'))
self.iso_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control."))
self.order_radio = RadioSet([{'label': _('No'), 'value': 'no'},
{'label': _('Forward'), 'value': 'fwd'},
{'label': _('Reverse'), 'value': 'rev'}])
self.iso_order_combo = FCComboBox2()
self.iso_order_combo.addItems([_('Default'), _('Forward'), _('Reverse')])
grid0.addWidget(self.order_label, 2, 0)
grid0.addWidget(self.order_radio, 2, 1, 1, 2)
par_grid.addWidget(self.iso_order_label, 2, 0)
par_grid.addWidget(self.iso_order_combo, 2, 1, 1, 2)
# Tip Dia
self.tipdialabel = FCLabel('%s:' % _('V-Tip Dia'))
self.tipdialabel.setToolTip(
_("The tip diameter for V-Shape Tool"))
self.tipdia_entry = FCDoubleSpinner()
self.tipdia_entry.set_precision(self.decimals)
self.tipdia_entry.set_range(0, 1000)
self.tipdia_entry.setSingleStep(0.1)
par_grid.addWidget(self.tipdialabel, 4, 0)
par_grid.addWidget(self.tipdia_entry, 4, 1, 1, 2)
# Tip Angle
self.tipanglelabel = FCLabel('%s:' % _('V-Tip Angle'))
self.tipanglelabel.setToolTip(
_("The tip angle for V-Shape Tool.\n"
"In degree."))
self.tipangle_entry = FCDoubleSpinner()
self.tipangle_entry.set_precision(self.decimals)
self.tipangle_entry.set_range(1, 180)
self.tipangle_entry.setSingleStep(5)
self.tipangle_entry.setWrapping(True)
par_grid.addWidget(self.tipanglelabel, 6, 0)
par_grid.addWidget(self.tipangle_entry, 6, 1, 1, 2)
# Cut Z entry
cutzlabel = FCLabel('%s:' % _('Cut Z'))
@@ -77,8 +108,8 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
"In application units.")
)
grid0.addWidget(cutzlabel, 6, 0)
grid0.addWidget(self.cutz_entry, 6, 1, 1, 2)
par_grid.addWidget(cutzlabel, 8, 0)
par_grid.addWidget(self.cutz_entry, 8, 1, 1, 2)
# New Diameter
self.newdialabel = FCLabel('%s:' % _('New Dia'))
@@ -92,13 +123,26 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
self.newdia_entry.set_range(0.0001, 10000.0000)
self.newdia_entry.setSingleStep(0.1)
grid0.addWidget(self.newdialabel, 8, 0)
grid0.addWidget(self.newdia_entry, 8, 1, 1, 2)
par_grid.addWidget(self.newdialabel, 10, 0)
par_grid.addWidget(self.newdia_entry, 10, 1, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 10, 0, 1, 3)
# separator_line = QtWidgets.QFrame()
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
# par_grid.addWidget(separator_line, 10, 0, 1, 3)
# #############################################################################################################
# Tool Frame
# #############################################################################################################
# ### Tools ## ##
self.tools_table_label = FCLabel('<span style="color:green;"><b>%s</b></span>' % _("Tool Parameters"))
self.layout.addWidget(self.tools_table_label)
tt_frame = FCFrame()
self.layout.addWidget(tt_frame)
tool_grid = FCGridLayout(v_spacing=5, h_spacing=3)
tt_frame.setLayout(tool_grid)
# Shape
tool_shape_label = FCLabel('%s:' % _('Shape'))
@@ -113,8 +157,8 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
self.tool_shape_combo = FCComboBox2(policy=False)
self.tool_shape_combo.addItems(["C1", "C2", "C3", "C4", "B", "V"])
grid0.addWidget(tool_shape_label, 12, 0)
grid0.addWidget(self.tool_shape_combo, 12, 1, 1, 2)
tool_grid.addWidget(tool_shape_label, 0, 0)
tool_grid.addWidget(self.tool_shape_combo, 0, 1, 1, 2)
# Passes
passlabel = FCLabel('%s:' % _('Passes'))
@@ -125,8 +169,8 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
self.passes_entry = FCSpinner()
self.passes_entry.set_range(1, 999)
grid0.addWidget(passlabel, 14, 0)
grid0.addWidget(self.passes_entry, 14, 1, 1, 2)
tool_grid.addWidget(passlabel, 2, 0)
tool_grid.addWidget(self.passes_entry, 2, 1, 1, 2)
# Pad Passes
padpasslabel = FCLabel('%s:' % _('Pad Passes'))
@@ -137,8 +181,8 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
self.pad_passes_entry = FCSpinner()
self.pad_passes_entry.set_range(0, 999)
grid0.addWidget(padpasslabel, 16, 0)
grid0.addWidget(self.pad_passes_entry, 16, 1, 1, 2)
tool_grid.addWidget(padpasslabel, 4, 0)
tool_grid.addWidget(self.pad_passes_entry, 4, 1, 1, 2)
# Overlap Entry
overlabel = FCLabel('%s:' % _('Overlap'))
@@ -151,8 +195,8 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
self.overlap_entry.set_range(0.0000, 99.9999)
self.overlap_entry.setSingleStep(0.1)
grid0.addWidget(overlabel, 20, 0)
grid0.addWidget(self.overlap_entry, 20, 1, 1, 2)
tool_grid.addWidget(overlabel, 6, 0)
tool_grid.addWidget(self.overlap_entry, 6, 1, 1, 2)
# Milling Type Radio Button
self.milling_type_label = FCLabel('%s:' % _('Milling Type'))
@@ -170,8 +214,8 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
"- conventional / useful when there is no backlash compensation")
)
grid0.addWidget(self.milling_type_label, 22, 0)
grid0.addWidget(self.milling_type_radio, 22, 1, 1, 2)
tool_grid.addWidget(self.milling_type_label, 8, 0)
tool_grid.addWidget(self.milling_type_radio, 8, 1, 1, 2)
# Isolation Type
self.iso_type_label = FCLabel('%s:' % _('Isolation Type'))
@@ -189,13 +233,28 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
{'label': _('Ext'), 'value': 'ext'},
{'label': _('Int'), 'value': 'int'}])
grid0.addWidget(self.iso_type_label, 24, 0)
grid0.addWidget(self.iso_type_radio, 24, 1, 1, 2)
tool_grid.addWidget(self.iso_type_label, 10, 0)
tool_grid.addWidget(self.iso_type_radio, 10, 1, 1, 2)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 26, 0, 1, 3)
tool_grid.addWidget(separator_line, 12, 0, 1, 3)
# #############################################################################################################
# General Parameters Frame
# #############################################################################################################
self.gen_param_label = FCLabel('<span style="color:indigo;"><b>%s</b></span>' % _("Common Parameters"))
self.gen_param_label.setToolTip(
_("Parameters that are common for all tools.")
)
self.layout.addWidget(self.gen_param_label)
gp_frame = FCFrame()
self.layout.addWidget(gp_frame)
gen_grid = FCGridLayout(v_spacing=5, h_spacing=3)
gp_frame.setLayout(gen_grid)
# Rest machining CheckBox
self.rest_cb = FCCheckBox('%s' % _("Rest"))
@@ -209,7 +268,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
"If not checked, use the standard algorithm.")
)
grid0.addWidget(self.rest_cb, 28, 0)
gen_grid.addWidget(self.rest_cb, 0, 0)
# Combine All Passes
self.combine_passes_cb = FCCheckBox(label=_('Combine'))
@@ -217,14 +276,14 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
_("Combine all passes into one object")
)
grid0.addWidget(self.combine_passes_cb, 28, 1)
gen_grid.addWidget(self.combine_passes_cb, 0, 1)
# Exception Areas
self.except_cb = FCCheckBox(label=_('Except'))
self.except_cb.setToolTip(_("When the isolation geometry is generated,\n"
"by checking this, the area of the object below\n"
"will be subtracted from the isolation geometry."))
grid0.addWidget(self.except_cb, 28, 2)
gen_grid.addWidget(self.except_cb, 0, 2)
# Check Tool validity
self.valid_cb = FCCheckBox(label=_('Check validity'))
@@ -233,7 +292,7 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
"if they will provide a complete isolation.")
)
grid0.addWidget(self.valid_cb, 30, 0, 1, 3)
gen_grid.addWidget(self.valid_cb, 2, 0, 1, 3)
# Isolation Scope
self.select_label = FCLabel('%s:' % _("Selection"))
@@ -249,8 +308,8 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
[_("All"), _("Area Selection"), _("Polygon Selection"), _("Reference Object")]
)
grid0.addWidget(self.select_label, 32, 0)
grid0.addWidget(self.select_combo, 32, 1, 1, 2)
gen_grid.addWidget(self.select_label, 4, 0)
gen_grid.addWidget(self.select_combo, 4, 1, 1, 2)
# Area Shape
self.area_shape_label = FCLabel('%s:' % _("Shape"))
@@ -261,8 +320,8 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
{'label': _("Polygon"), 'value': 'polygon'}])
grid0.addWidget(self.area_shape_label, 34, 0)
grid0.addWidget(self.area_shape_radio, 34, 1, 1, 2)
gen_grid.addWidget(self.area_shape_label, 6, 0)
gen_grid.addWidget(self.area_shape_radio, 6, 1, 1, 2)
# Polygon interiors selection
self.poly_int_cb = FCCheckBox(_("Interiors"))
@@ -278,13 +337,13 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
"interiors of a polygon (holes in the polygon) could not be isolated.\n"
"Works when 'rest machining' is used.")
)
grid0.addWidget(self.poly_int_cb, 36, 0)
grid0.addWidget(self.force_iso_cb, 36, 1)
gen_grid.addWidget(self.poly_int_cb, 8, 0)
gen_grid.addWidget(self.force_iso_cb, 8, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 38, 0, 1, 3)
gen_grid.addWidget(separator_line, 10, 0, 1, 3)
# ## Plotting type
self.plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'},
@@ -294,7 +353,9 @@ class ToolsISOPrefGroupUI(OptionsGroupUI):
_("- 'Normal' - normal plotting, done at the end of the job\n"
"- 'Progressive' - each shape is plotted after it is generated")
)
grid0.addWidget(plotting_label, 40, 0)
grid0.addWidget(self.plotting_radio, 40, 1, 1, 2)
gen_grid.addWidget(plotting_label, 12, 0)
gen_grid.addWidget(self.plotting_radio, 12, 1, 1, 2)
self.layout.addStretch()
FCGridLayout.set_common_column_size([par_grid, tool_grid, gen_grid], 0)
# self.layout.addStretch()

View File

@@ -1,7 +1,7 @@
from PyQt6 import QtWidgets
from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCCheckBox, NumericalEvalTupleEntry, FCComboBox2, FCLabel, \
FCGridLayout
FCGridLayout, FCFrame
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext
@@ -23,34 +23,49 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.defaults = defaults
# ## Clear non-copper regions
self.clearcopper_label = FCLabel("<b>%s:</b>" % _("Parameters"))
self.clearcopper_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
self.clearcopper_label.setToolTip(
_("Create a Geometry object with\n"
"toolpaths to cut all non-copper regions.")
)
self.layout.addWidget(self.clearcopper_label)
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
self.layout.addLayout(grid0)
# #############################################################################################################
# Parameters Frame
# #############################################################################################################
par_frame = FCFrame()
self.layout.addWidget(par_frame)
par_grid = FCGridLayout(v_spacing=5, h_spacing=3)
par_frame.setLayout(par_grid)
# Tools Diameters
ncctdlabel = FCLabel('<b><font color="green">%s:</font></b>' % _('Tools Dia'))
ncctdlabel.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(ncctdlabel, 0, 0)
self.ncc_tool_dia_entry = NumericalEvalTupleEntry(border_color='#0069A9')
self.ncc_tool_dia_entry.setPlaceholderText(_("Comma separated values"))
grid0.addWidget(self.ncc_tool_dia_entry, 0, 1)
# Tool Type Radio Button
self.tool_type_label = FCLabel('%s:' % _('Tool Type'))
self.tool_type_label.setToolTip(
_("Default tool type:\n"
"- 'V-shape'\n"
"- Circular")
)
par_grid.addWidget(ncctdlabel, 0, 0)
par_grid.addWidget(self.ncc_tool_dia_entry, 0, 1)
# Tool order
self.ncc_order_label = FCLabel('%s:' % _('Tool order'))
self.ncc_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control."))
self.ncc_order_combo = FCComboBox2()
self.ncc_order_combo.addItems([_('Default'), _('Forward'), _('Reverse')])
par_grid.addWidget(self.ncc_order_label, 2, 0)
par_grid.addWidget(self.ncc_order_combo, 2, 1)
# Tip Dia
self.tipdialabel = FCLabel('%s:' % _('V-Tip Dia'))
@@ -61,8 +76,8 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.tipdia_entry.set_range(0, 1000)
self.tipdia_entry.setSingleStep(0.1)
grid0.addWidget(self.tipdialabel, 2, 0)
grid0.addWidget(self.tipdia_entry, 2, 1)
par_grid.addWidget(self.tipdialabel, 4, 0)
par_grid.addWidget(self.tipdia_entry, 4, 1)
# Tip Angle
self.tipanglelabel = FCLabel('%s:' % _('V-Tip Angle'))
@@ -75,8 +90,8 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.tipangle_entry.setSingleStep(5)
self.tipangle_entry.setWrapping(True)
grid0.addWidget(self.tipanglelabel, 3, 0)
grid0.addWidget(self.tipangle_entry, 3, 1)
par_grid.addWidget(self.tipanglelabel, 6, 0)
par_grid.addWidget(self.tipangle_entry, 6, 1)
# Cut Z entry
cutzlabel = FCLabel('%s:' % _('Cut Z'))
@@ -94,8 +109,8 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
"In application units.")
)
grid0.addWidget(cutzlabel, 4, 0)
grid0.addWidget(self.cutz_entry, 4, 1)
par_grid.addWidget(cutzlabel, 8, 0)
par_grid.addWidget(self.cutz_entry, 8, 1)
# New Diameter
self.newdialabel = FCLabel('%s:' % _('New Dia'))
@@ -109,13 +124,13 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.newdia_entry.set_range(0.0001, 10000.0000)
self.newdia_entry.setSingleStep(0.1)
grid0.addWidget(self.newdialabel, 5, 0)
grid0.addWidget(self.newdia_entry, 5, 1)
par_grid.addWidget(self.newdialabel, 10, 0)
par_grid.addWidget(self.newdia_entry, 10, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 6, 0, 1, 2)
par_grid.addWidget(separator_line, 12, 0, 1, 2)
# Milling Type Radio Button
self.milling_type_label = FCLabel('%s:' % _('Milling Type'))
@@ -133,34 +148,21 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
"- conventional / useful when there is no backlash compensation")
)
grid0.addWidget(self.milling_type_label, 7, 0)
grid0.addWidget(self.milling_type_radio, 7, 1)
par_grid.addWidget(self.milling_type_label, 14, 0)
par_grid.addWidget(self.milling_type_radio, 14, 1)
# Tool order Radio Button
self.ncc_order_label = FCLabel('%s:' % _('Tool order'))
self.ncc_order_label.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control."))
# #############################################################################################################
# Tool Frame
# #############################################################################################################
# ### Tools ## ##
self.tools_table_label = FCLabel('<span style="color:green;"><b>%s</b></span>' % _("Tool Parameters"))
self.layout.addWidget(self.tools_table_label)
self.ncc_order_radio = RadioSet([{'label': _('No'), 'value': 'no'},
{'label': _('Forward'), 'value': 'fwd'},
{'label': _('Reverse'), 'value': 'rev'}])
self.ncc_order_radio.setToolTip(_("This set the way that the tools in the tools table are used.\n"
"'No' --> means that the used order is the one in the tool table\n"
"'Forward' --> means that the tools will be ordered from small to big\n"
"'Reverse' --> means that the tools will ordered from big to small\n\n"
"WARNING: using rest machining will automatically set the order\n"
"in reverse and disable this control."))
grid0.addWidget(self.ncc_order_label, 8, 0)
grid0.addWidget(self.ncc_order_radio, 8, 1)
tt_frame = FCFrame()
self.layout.addWidget(tt_frame)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 9, 0, 1, 2)
tool_grid = FCGridLayout(v_spacing=5, h_spacing=3)
tt_frame.setLayout(tool_grid)
# Overlap Entry
nccoverlabel = FCLabel('%s:' % _('Overlap'))
@@ -179,8 +181,8 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.ncc_overlap_entry.setRange(0.0000, 99.9999)
self.ncc_overlap_entry.setSingleStep(0.1)
grid0.addWidget(nccoverlabel, 10, 0)
grid0.addWidget(self.ncc_overlap_entry, 10, 1)
tool_grid.addWidget(nccoverlabel, 0, 0)
tool_grid.addWidget(self.ncc_overlap_entry, 0, 1)
# Margin entry
nccmarginlabel = FCLabel('%s:' % _('Margin'))
@@ -192,8 +194,8 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.ncc_margin_entry.set_range(-10000, 10000)
self.ncc_margin_entry.setSingleStep(0.1)
grid0.addWidget(nccmarginlabel, 11, 0)
grid0.addWidget(self.ncc_margin_entry, 11, 1)
tool_grid.addWidget(nccmarginlabel, 2, 0)
tool_grid.addWidget(self.ncc_margin_entry, 2, 1)
# Method
methodlabel = FCLabel('%s:' % _('Method'))
@@ -214,8 +216,8 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
[_("Standard"), _("Seed"), _("Lines"), _("Combo")]
)
grid0.addWidget(methodlabel, 12, 0)
grid0.addWidget(self.ncc_method_combo, 12, 1)
tool_grid.addWidget(methodlabel, 4, 0)
tool_grid.addWidget(self.ncc_method_combo, 4, 1)
# Connect lines
self.ncc_connect_cb = FCCheckBox('%s' % _("Connect"))
@@ -224,7 +226,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
"segments to minimize tool lifts.")
)
grid0.addWidget(self.ncc_connect_cb, 13, 0)
tool_grid.addWidget(self.ncc_connect_cb, 6, 0)
# Contour Checkbox
self.ncc_contour_cb = FCCheckBox('%s' % _("Contour"))
@@ -233,7 +235,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
"to trim rough edges.")
)
grid0.addWidget(self.ncc_contour_cb, 13, 1)
tool_grid.addWidget(self.ncc_contour_cb, 6, 1)
# ## NCC Offset choice
self.ncc_choice_offset_cb = FCCheckBox('%s' % _("Offset"))
@@ -243,7 +245,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
"from the copper features.")
)
grid0.addWidget(self.ncc_choice_offset_cb, 14, 0, 1, 2)
tool_grid.addWidget(self.ncc_choice_offset_cb, 8, 0, 1, 2)
# ## NCC Offset value
self.ncc_offset_label = FCLabel('%s:' % _("Offset value"))
@@ -258,13 +260,28 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.ncc_offset_spinner.setWrapping(True)
self.ncc_offset_spinner.setSingleStep(0.1)
grid0.addWidget(self.ncc_offset_label, 15, 0)
grid0.addWidget(self.ncc_offset_spinner, 15, 1)
tool_grid.addWidget(self.ncc_offset_label, 10, 0)
tool_grid.addWidget(self.ncc_offset_spinner, 10, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 16, 0, 1, 2)
# separator_line = QtWidgets.QFrame()
# separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
# par_grid.addWidget(separator_line, 16, 0, 1, 2)
# #############################################################################################################
# General Parameters Frame
# #############################################################################################################
self.gen_param_label = FCLabel('<span style="color:indigo;"><b>%s</b></span>' % _("Common Parameters"))
self.gen_param_label.setToolTip(
_("Parameters that are common for all tools.")
)
self.layout.addWidget(self.gen_param_label)
gp_frame = FCFrame()
self.layout.addWidget(gp_frame)
gen_grid = FCGridLayout(v_spacing=5, h_spacing=3)
gp_frame.setLayout(gen_grid)
# Rest machining CheckBox
self.ncc_rest_cb = FCCheckBox('%s' % _("Rest"))
@@ -278,7 +295,7 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
"If not checked, use the standard algorithm.")
)
grid0.addWidget(self.ncc_rest_cb, 17, 0, 1, 2)
gen_grid.addWidget(self.ncc_rest_cb, 0, 0, 1, 2)
# ## Reference
# self.reference_radio = RadioSet([{'label': _('Itself'), 'value': 'itself'},
@@ -298,8 +315,8 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
"- 'Reference Object' - will process the area specified by another object.")
)
grid0.addWidget(select_label, 18, 0)
grid0.addWidget(self.select_combo, 18, 1)
gen_grid.addWidget(select_label, 2, 0)
gen_grid.addWidget(self.select_combo, 2, 1)
self.area_shape_label = FCLabel('%s:' % _("Shape"))
self.area_shape_label.setToolTip(
@@ -309,13 +326,13 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
{'label': _("Polygon"), 'value': 'polygon'}])
grid0.addWidget(self.area_shape_label, 19, 0)
grid0.addWidget(self.area_shape_radio, 19, 1)
gen_grid.addWidget(self.area_shape_label, 4, 0)
gen_grid.addWidget(self.area_shape_radio, 4, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 20, 0, 1, 2)
gen_grid.addWidget(separator_line, 6, 0, 1, 2)
# ## Plotting type
self.plotting_radio = RadioSet([{'label': _('Normal'), 'value': 'normal'},
@@ -325,8 +342,8 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
_("- 'Normal' - normal plotting, done at the end of the job\n"
"- 'Progressive' - each shape is plotted after it is generated")
)
grid0.addWidget(plotting_label, 21, 0)
grid0.addWidget(self.plotting_radio, 21, 1)
gen_grid.addWidget(plotting_label, 8, 0)
gen_grid.addWidget(self.plotting_radio, 8, 1)
# Check Tool validity
self.valid_cb = FCCheckBox(label=_('Check validity'))
@@ -336,6 +353,8 @@ class ToolsNCCPrefGroupUI(OptionsGroupUI):
)
self.valid_cb.setObjectName("n_check")
grid0.addWidget(self.valid_cb, 23, 0, 1, 2)
gen_grid.addWidget(self.valid_cb, 10, 0, 1, 2)
self.layout.addStretch()
FCGridLayout.set_common_column_size([par_grid, tool_grid, gen_grid], 0)
# self.layout.addStretch()