- more UI changes in the Preferences to align them to the new app look

This commit is contained in:
Marius Stanciu
2021-09-29 22:17:49 +03:00
committed by Marius
parent b4c817722b
commit 75972180a8
7 changed files with 268 additions and 197 deletions

View File

@@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta
================================================= =================================================
29.09.2021
- more UI changes in the Preferences to align them to the new app look
28.09.2021 28.09.2021
- changed the circle resolution back to the default of 16 since this value is good for fast rendering of Gerber files - changed the circle resolution back to the default of 16 since this value is good for fast rendering of Gerber files

View File

@@ -191,7 +191,7 @@ class GeneralAPPSetGroupUI(OptionsGroupUI):
# Font Frame # Font Frame
# ############################################################################################################# # #############################################################################################################
# Font Size # Font Size
self.font_size_label = FCLabel('<span style="color:red;"><b>%s</b></span>' % _('Font Size')) self.font_size_label = FCLabel('<span style="color:teal;"><b>%s</b></span>' % _('Font Size'))
self.layout.addWidget(self.font_size_label) self.layout.addWidget(self.font_size_label)
fnt_frame = FCFrame() fnt_frame = FCFrame()

View File

@@ -132,7 +132,7 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
# ############################################################################################################# # #############################################################################################################
# Grid1 Frame # Grid1 Frame
# ############################################################################################################# # #############################################################################################################
self.color_lbl = FCLabel('<span style="color:red;"><b>%s</b></span>' % _("Colors")) self.color_lbl = FCLabel('<span style="color:teal;"><b>%s</b></span>' % _("Colors"))
self.layout.addWidget(self.color_lbl) self.layout.addWidget(self.color_lbl)
color_frame = FCFrame() color_frame = FCFrame()

View File

@@ -32,10 +32,10 @@ class PluginsPreferencesUI(QtWidgets.QWidget):
self.defaults = defaults self.defaults = defaults
self.tools_drill_group = ToolsDrillPrefGroupUI(decimals=self.decimals, defaults=self.defaults) self.tools_drill_group = ToolsDrillPrefGroupUI(decimals=self.decimals, defaults=self.defaults)
self.tools_drill_group.setMinimumWidth(220) self.tools_drill_group.setMinimumWidth(180)
self.tools_mill_group = ToolsMillPrefGroupUI(decimals=self.decimals, defaults=self.defaults) self.tools_mill_group = ToolsMillPrefGroupUI(decimals=self.decimals, defaults=self.defaults)
self.tools_mill_group.setMinimumWidth(220) self.tools_mill_group.setMinimumWidth(180)
self.tools_cutout_group = ToolsCutoutPrefGroupUI(decimals=self.decimals, defaults=self.defaults) self.tools_cutout_group = ToolsCutoutPrefGroupUI(decimals=self.decimals, defaults=self.defaults)
self.tools_cutout_group.setMinimumWidth(220) self.tools_cutout_group.setMinimumWidth(220)

View File

@@ -2,7 +2,7 @@ from PyQt6 import QtWidgets, QtCore
from PyQt6.QtCore import Qt from PyQt6.QtCore import Qt
from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, NumericalEvalTupleEntry, \ from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, NumericalEvalTupleEntry, \
OptionalInputSection, NumericalEvalEntry, FCLabel, FCGridLayout, FCComboBox2 OptionalInputSection, NumericalEvalEntry, FCLabel, FCGridLayout, FCComboBox2, FCFrame
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext import gettext
@@ -22,15 +22,20 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.decimals = decimals self.decimals = decimals
self.defaults = defaults self.defaults = defaults
# ## Clear non-copper regions # #############################################################################################################
self.drill_label = FCLabel("<b>%s:</b>" % _("Parameters")) # PARAMETERS Frame
# #############################################################################################################
self.drill_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
self.drill_label.setToolTip( self.drill_label.setToolTip(
_("Create CNCJob with toolpaths for drilling or milling holes.") _("Create CNCJob with toolpaths for drilling or milling holes.")
) )
self.layout.addWidget(self.drill_label) self.layout.addWidget(self.drill_label)
grid0 = FCGridLayout(v_spacing=5, h_spacing=3) param_frame = FCFrame()
self.layout.addLayout(grid0) self.layout.addWidget(param_frame)
param_grid = FCGridLayout(v_spacing=5, h_spacing=3)
param_frame.setLayout(param_grid)
# Tool order Radio Button # Tool order Radio Button
self.order_label = FCLabel('%s:' % _('Tool order')) self.order_label = FCLabel('%s:' % _('Tool order'))
@@ -44,8 +49,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.order_combo = FCComboBox2() self.order_combo = FCComboBox2()
self.order_combo.addItems([_('Default'), _('Forward'), _('Reverse')]) self.order_combo.addItems([_('Default'), _('Forward'), _('Reverse')])
grid0.addWidget(self.order_label, 1, 0) param_grid.addWidget(self.order_label, 0, 0)
grid0.addWidget(self.order_combo, 1, 1, 1, 2) param_grid.addWidget(self.order_combo, 0, 1, 1, 2)
# Cut Z # Cut Z
cutzlabel = FCLabel('%s:' % _('Cut Z')) cutzlabel = FCLabel('%s:' % _('Cut Z'))
@@ -60,8 +65,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.cutz_entry.setSingleStep(0.1) self.cutz_entry.setSingleStep(0.1)
self.cutz_entry.set_precision(self.decimals) self.cutz_entry.set_precision(self.decimals)
grid0.addWidget(cutzlabel, 3, 0) param_grid.addWidget(cutzlabel, 2, 0)
grid0.addWidget(self.cutz_entry, 3, 1, 1, 2) param_grid.addWidget(self.cutz_entry, 2, 1, 1, 2)
# Multi-Depth # Multi-Depth
self.mpass_cb = FCCheckBox('%s:' % _("Multi-Depth")) self.mpass_cb = FCCheckBox('%s:' % _("Multi-Depth"))
@@ -81,8 +86,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.maxdepth_entry.setToolTip(_("Depth of each pass (positive).")) self.maxdepth_entry.setToolTip(_("Depth of each pass (positive)."))
grid0.addWidget(self.mpass_cb, 5, 0) param_grid.addWidget(self.mpass_cb, 4, 0)
grid0.addWidget(self.maxdepth_entry, 5, 1, 1, 2) param_grid.addWidget(self.maxdepth_entry, 4, 1, 1, 2)
self.ois_md = OptionalInputSection(self.mpass_cb, [self.maxdepth_entry]) self.ois_md = OptionalInputSection(self.mpass_cb, [self.maxdepth_entry])
@@ -97,8 +102,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.travelz_entry.set_precision(self.decimals) self.travelz_entry.set_precision(self.decimals)
self.travelz_entry.set_range(-10000.0000, 10000.0000) self.travelz_entry.set_range(-10000.0000, 10000.0000)
grid0.addWidget(travelzlabel, 7, 0) param_grid.addWidget(travelzlabel, 6, 0)
grid0.addWidget(self.travelz_entry, 7, 1, 1, 2) param_grid.addWidget(self.travelz_entry, 6, 1, 1, 2)
# Tool change: # Tool change:
self.toolchange_cb = FCCheckBox('%s' % _("Tool change")) self.toolchange_cb = FCCheckBox('%s' % _("Tool change"))
@@ -106,7 +111,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
_("Include tool-change sequence\n" _("Include tool-change sequence\n"
"in G-Code (Pause for tool change).") "in G-Code (Pause for tool change).")
) )
grid0.addWidget(self.toolchange_cb, 9, 0, 1, 3) param_grid.addWidget(self.toolchange_cb, 8, 0, 1, 3)
# Tool Change Z # Tool Change Z
toolchangezlabel = FCLabel('%s:' % _('Toolchange Z')) toolchangezlabel = FCLabel('%s:' % _('Toolchange Z'))
@@ -119,8 +124,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.toolchangez_entry.set_precision(self.decimals) self.toolchangez_entry.set_precision(self.decimals)
self.toolchangez_entry.set_range(-10000.0000, 10000.0000) self.toolchangez_entry.set_range(-10000.0000, 10000.0000)
grid0.addWidget(toolchangezlabel, 11, 0) param_grid.addWidget(toolchangezlabel, 10, 0)
grid0.addWidget(self.toolchangez_entry, 11, 1, 1, 2) param_grid.addWidget(self.toolchangez_entry, 10, 1, 1, 2)
# End Move Z # End Move Z
endz_label = FCLabel('%s:' % _('End move Z')) endz_label = FCLabel('%s:' % _('End move Z'))
@@ -132,8 +137,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.endz_entry.set_precision(self.decimals) self.endz_entry.set_precision(self.decimals)
self.endz_entry.set_range(-10000.0000, 10000.0000) self.endz_entry.set_range(-10000.0000, 10000.0000)
grid0.addWidget(endz_label, 15, 0) param_grid.addWidget(endz_label, 12, 0)
grid0.addWidget(self.endz_entry, 15, 1, 1, 2) param_grid.addWidget(self.endz_entry, 12, 1, 1, 2)
# End Move X,Y # End Move X,Y
endmove_xy_label = FCLabel('%s:' % _('End move X,Y')) endmove_xy_label = FCLabel('%s:' % _('End move X,Y'))
@@ -144,8 +149,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
) )
self.endxy_entry = NumericalEvalTupleEntry(border_color='#0069A9') self.endxy_entry = NumericalEvalTupleEntry(border_color='#0069A9')
grid0.addWidget(endmove_xy_label, 17, 0) param_grid.addWidget(endmove_xy_label, 14, 0)
grid0.addWidget(self.endxy_entry, 17, 1, 1, 2) param_grid.addWidget(self.endxy_entry, 14, 1, 1, 2)
# Feedrate Z # Feedrate Z
frlabel = FCLabel('%s:' % _('Feedrate Z')) frlabel = FCLabel('%s:' % _('Feedrate Z'))
@@ -159,8 +164,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.feedrate_z_entry.set_precision(self.decimals) self.feedrate_z_entry.set_precision(self.decimals)
self.feedrate_z_entry.set_range(0, 910000.0000) self.feedrate_z_entry.set_range(0, 910000.0000)
grid0.addWidget(frlabel, 19, 0) param_grid.addWidget(frlabel, 16, 0)
grid0.addWidget(self.feedrate_z_entry, 19, 1, 1, 2) param_grid.addWidget(self.feedrate_z_entry, 16, 1, 1, 2)
# Spindle speed # Spindle speed
spdlabel = FCLabel('%s:' % _('Spindle Speed')) spdlabel = FCLabel('%s:' % _('Spindle Speed'))
@@ -173,8 +178,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.spindlespeed_entry.set_range(0, 1000000) self.spindlespeed_entry.set_range(0, 1000000)
self.spindlespeed_entry.set_step(100) self.spindlespeed_entry.set_step(100)
grid0.addWidget(spdlabel, 21, 0) param_grid.addWidget(spdlabel, 18, 0)
grid0.addWidget(self.spindlespeed_entry, 21, 1, 1, 2) param_grid.addWidget(self.spindlespeed_entry, 18, 1, 1, 2)
# Dwell # Dwell
self.dwell_cb = FCCheckBox('%s' % _('Enable Dwell')) self.dwell_cb = FCCheckBox('%s' % _('Enable Dwell'))
@@ -183,7 +188,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
"speed before cutting.") "speed before cutting.")
) )
grid0.addWidget(self.dwell_cb, 23, 0) param_grid.addWidget(self.dwell_cb, 20, 0)
# Dwell Time # Dwell Time
self.dwelltime_entry = FCDoubleSpinner() self.dwelltime_entry = FCDoubleSpinner()
@@ -191,7 +196,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.dwelltime_entry.set_precision(self.decimals) self.dwelltime_entry.set_precision(self.decimals)
self.dwelltime_entry.set_range(0, 910000.0000) self.dwelltime_entry.set_range(0, 910000.0000)
grid0.addWidget(self.dwelltime_entry, 23, 1, 1, 2) param_grid.addWidget(self.dwelltime_entry, 20, 1, 1, 2)
self.ois_dwell_exc = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry]) self.ois_dwell_exc = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry])
@@ -212,24 +217,40 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.pp_excellon_name_cb.setItemData(it, self.pp_excellon_name_cb.itemText(it), self.pp_excellon_name_cb.setItemData(it, self.pp_excellon_name_cb.itemText(it),
QtCore.Qt.ItemDataRole.ToolTipRole) QtCore.Qt.ItemDataRole.ToolTipRole)
grid0.addWidget(pp_excellon_label, 27, 0) param_grid.addWidget(pp_excellon_label, 24, 0)
grid0.addWidget(self.pp_excellon_name_cb, 27, 1, 1, 2) param_grid.addWidget(self.pp_excellon_name_cb, 24, 1, 1, 2)
separator_line = QtWidgets.QFrame() # separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 29, 0, 1, 3) # param_grid.addWidget(separator_line, 29, 0, 1, 3)
# DRILL SLOTS LABEL # #############################################################################################################
self.dslots_label = FCLabel('<b>%s:</b>' % _('Drilling Slots')) # Drill Slots Frame
grid0.addWidget(self.dslots_label, 31, 0, 1, 3) # #############################################################################################################
self.dslots_label = FCLabel('<span style="color:brown;"><b>%s</b></span>' % _('Drilling Slots'))
self.layout.addWidget(self.dslots_label)
ds_frame = FCFrame()
self.layout.addWidget(ds_frame)
ds_grid = FCGridLayout(v_spacing=5, h_spacing=3)
ds_frame.setLayout(ds_grid)
# Drill slots # Drill slots
self.drill_slots_cb = FCCheckBox('%s' % _('Drill slots')) self.drill_slots_cb = FCCheckBox('%s' % _('Drill slots'))
self.drill_slots_cb.setToolTip( self.drill_slots_cb.setToolTip(
_("If the selected tool has slots then they will be drilled.") _("If the selected tool has slots then they will be drilled.")
) )
grid0.addWidget(self.drill_slots_cb, 33, 0, 1, 3) ds_grid.addWidget(self.drill_slots_cb, 0, 0)
# Last drill in slot
self.last_drill_cb = FCCheckBox('%s' % _('Last drill'))
self.last_drill_cb.setToolTip(
_("If the slot length is not completely covered by drill holes,\n"
"add a drill hole on the slot end point.")
)
ds_grid.addWidget(self.last_drill_cb, 0, 1, 1, 2)
# Drill Overlap # Drill Overlap
self.drill_overlap_label = FCLabel('%s:' % _('Overlap')) self.drill_overlap_label = FCLabel('%s:' % _('Overlap'))
@@ -242,27 +263,28 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.drill_overlap_entry.set_range(0.0, 10000.0000) self.drill_overlap_entry.set_range(0.0, 10000.0000)
self.drill_overlap_entry.setSingleStep(0.1) self.drill_overlap_entry.setSingleStep(0.1)
grid0.addWidget(self.drill_overlap_label, 35, 0) ds_grid.addWidget(self.drill_overlap_label, 2, 0)
grid0.addWidget(self.drill_overlap_entry, 35, 1, 1, 2) ds_grid.addWidget(self.drill_overlap_entry, 2, 1, 1, 2)
# Last drill in slot # separator_line = QtWidgets.QFrame()
self.last_drill_cb = FCCheckBox('%s' % _('Last drill')) # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
self.last_drill_cb.setToolTip( # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
_("If the slot length is not completely covered by drill holes,\n" # ds_grid.addWidget(separator_line, 6, 0, 1, 3)
"add a drill hole on the slot end point.")
)
grid0.addWidget(self.last_drill_cb, 37, 0, 1, 3)
separator_line = QtWidgets.QFrame() # #############################################################################################################
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # Advanced Options Frame
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # #############################################################################################################
grid0.addWidget(separator_line, 39, 0, 1, 3) self.exc_label = FCLabel('<span style="color:teal;"><b>%s</b></span>' % _('Advanced Options'))
self.exc_label = FCLabel('<b>%s:</b>' % _('Advanced Options'))
self.exc_label.setToolTip( self.exc_label.setToolTip(
_("A list of advanced parameters.") _("A list of advanced parameters.")
) )
grid0.addWidget(self.exc_label, 41, 0, 1, 3) self.layout.addWidget(self.exc_label)
adv_frame = FCFrame()
self.layout.addWidget(adv_frame)
adv_grid = FCGridLayout(v_spacing=5, h_spacing=3)
adv_frame.setLayout(adv_grid)
# Offset Z # Offset Z
offsetlabel = FCLabel('%s:' % _('Offset Z')) offsetlabel = FCLabel('%s:' % _('Offset Z'))
@@ -274,8 +296,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.offset_entry.set_precision(self.decimals) self.offset_entry.set_precision(self.decimals)
self.offset_entry.set_range(-999.9999, 999.9999) self.offset_entry.set_range(-999.9999, 999.9999)
grid0.addWidget(offsetlabel, 43, 0) adv_grid.addWidget(offsetlabel, 0, 0)
grid0.addWidget(self.offset_entry, 43, 1, 1, 2) adv_grid.addWidget(self.offset_entry, 0, 1, 1, 2)
# ToolChange X,Y # ToolChange X,Y
toolchange_xy_label = FCLabel('%s:' % _('Toolchange X,Y')) toolchange_xy_label = FCLabel('%s:' % _('Toolchange X,Y'))
@@ -284,8 +306,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
) )
self.toolchangexy_entry = NumericalEvalTupleEntry(border_color='#0069A9') self.toolchangexy_entry = NumericalEvalTupleEntry(border_color='#0069A9')
grid0.addWidget(toolchange_xy_label, 45, 0) adv_grid.addWidget(toolchange_xy_label, 2, 0)
grid0.addWidget(self.toolchangexy_entry, 45, 1, 1, 2) adv_grid.addWidget(self.toolchangexy_entry, 2, 1, 1, 2)
# Start Z # Start Z
startzlabel = FCLabel('%s:' % _('Start Z')) startzlabel = FCLabel('%s:' % _('Start Z'))
@@ -295,8 +317,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
) )
self.estartz_entry = NumericalEvalEntry(border_color='#0069A9') self.estartz_entry = NumericalEvalEntry(border_color='#0069A9')
grid0.addWidget(startzlabel, 47, 0) adv_grid.addWidget(startzlabel, 4, 0)
grid0.addWidget(self.estartz_entry, 47, 1, 1, 2) adv_grid.addWidget(self.estartz_entry, 4, 1, 1, 2)
# Feedrate Rapids # Feedrate Rapids
fr_rapid_label = FCLabel('%s:' % _('Feedrate Rapids')) fr_rapid_label = FCLabel('%s:' % _('Feedrate Rapids'))
@@ -311,8 +333,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.feedrate_rapid_entry.set_precision(self.decimals) self.feedrate_rapid_entry.set_precision(self.decimals)
self.feedrate_rapid_entry.set_range(0, 910000.0000) self.feedrate_rapid_entry.set_range(0, 910000.0000)
grid0.addWidget(fr_rapid_label, 49, 0) adv_grid.addWidget(fr_rapid_label, 6, 0)
grid0.addWidget(self.feedrate_rapid_entry, 49, 1, 1, 2) adv_grid.addWidget(self.feedrate_rapid_entry, 6, 1, 1, 2)
# Probe depth # Probe depth
self.pdepth_label = FCLabel('%s:' % _("Probe Z depth")) self.pdepth_label = FCLabel('%s:' % _("Probe Z depth"))
@@ -324,8 +346,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.pdepth_entry.set_precision(self.decimals) self.pdepth_entry.set_precision(self.decimals)
self.pdepth_entry.set_range(-910000.0000, 0.0000) self.pdepth_entry.set_range(-910000.0000, 0.0000)
grid0.addWidget(self.pdepth_label, 51, 0) adv_grid.addWidget(self.pdepth_label, 8, 0)
grid0.addWidget(self.pdepth_entry, 51, 1, 1, 2) adv_grid.addWidget(self.pdepth_entry, 8, 1, 1, 2)
# Probe feedrate # Probe feedrate
self.feedrate_probe_label = FCLabel('%s:' % _("Feedrate Probe")) self.feedrate_probe_label = FCLabel('%s:' % _("Feedrate Probe"))
@@ -336,8 +358,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.feedrate_probe_entry.set_precision(self.decimals) self.feedrate_probe_entry.set_precision(self.decimals)
self.feedrate_probe_entry.set_range(0, 910000.0000) self.feedrate_probe_entry.set_range(0, 910000.0000)
grid0.addWidget(self.feedrate_probe_label, 53, 0) adv_grid.addWidget(self.feedrate_probe_label, 10, 0)
grid0.addWidget(self.feedrate_probe_entry, 53, 1, 1, 2) adv_grid.addWidget(self.feedrate_probe_entry, 10, 1, 1, 2)
# Spindle direction # Spindle direction
spindle_dir_label = FCLabel('%s:' % _('Spindle direction')) spindle_dir_label = FCLabel('%s:' % _('Spindle direction'))
@@ -349,9 +371,9 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
) )
self.spindledir_radio = RadioSet([{'label': _('CW'), 'value': 'CW'}, self.spindledir_radio = RadioSet([{'label': _('CW'), 'value': 'CW'},
{'label': _('CCW'), 'value': 'CCW'}]) {'label': _('CCW'), 'value': 'CCW'}], compact=True)
grid0.addWidget(spindle_dir_label, 55, 0) adv_grid.addWidget(spindle_dir_label, 12, 0)
grid0.addWidget(self.spindledir_radio, 55, 1, 1, 2) adv_grid.addWidget(self.spindledir_radio, 12, 1, 1, 2)
self.fplunge_cb = FCCheckBox('%s' % _('Fast Plunge')) self.fplunge_cb = FCCheckBox('%s' % _('Fast Plunge'))
self.fplunge_cb.setToolTip( self.fplunge_cb.setToolTip(
@@ -360,7 +382,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
"meaning the fastest speed available.\n" "meaning the fastest speed available.\n"
"WARNING: the move is done at Toolchange X,Y coords.") "WARNING: the move is done at Toolchange X,Y coords.")
) )
grid0.addWidget(self.fplunge_cb, 57, 0, 1, 3) adv_grid.addWidget(self.fplunge_cb, 14, 0)
self.fretract_cb = FCCheckBox('%s' % _('Fast Retract')) self.fretract_cb = FCCheckBox('%s' % _('Fast Retract'))
self.fretract_cb.setToolTip( self.fretract_cb.setToolTip(
@@ -372,21 +394,27 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
"(travel height) is done as fast as possible (G0) in one move.") "(travel height) is done as fast as possible (G0) in one move.")
) )
grid0.addWidget(self.fretract_cb, 59, 0, 1, 3) adv_grid.addWidget(self.fretract_cb, 14, 1, 1, 2)
separator_line = QtWidgets.QFrame() # separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 61, 0, 1, 3) # adv_grid.addWidget(separator_line, 18, 0, 1, 3)
# ----------------------------- # #############################################################################################################
# --- Area Exclusion ---------- # Area Exclusion Frame
# ----------------------------- # #############################################################################################################
self.area_exc_label = FCLabel('<b>%s:</b>' % _('Area Exclusion')) self.area_exc_label = FCLabel('<span style="color:magenta;"><b>%s</b></span>' % _('Area Exclusion'))
self.area_exc_label.setToolTip( self.area_exc_label.setToolTip(
_("Area exclusion parameters.") _("Area exclusion parameters.")
) )
grid0.addWidget(self.area_exc_label, 63, 0, 1, 3) self.layout.addWidget(self.area_exc_label)
area_frame = FCFrame()
self.layout.addWidget(area_frame)
area_grid = FCGridLayout(v_spacing=5, h_spacing=3)
area_frame.setLayout(area_grid)
# Exclusion Area CB # Exclusion Area CB
self.exclusion_cb = FCCheckBox('%s' % _("Exclusion areas")) self.exclusion_cb = FCCheckBox('%s' % _("Exclusion areas"))
@@ -397,7 +425,7 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
"is forbidden." "is forbidden."
) )
) )
grid0.addWidget(self.exclusion_cb, 65, 0, 1, 3) area_grid.addWidget(self.exclusion_cb, 0, 0, 1, 3)
# Area Selection shape # Area Selection shape
self.area_shape_label = FCLabel('%s:' % _("Shape")) self.area_shape_label = FCLabel('%s:' % _("Shape"))
@@ -408,8 +436,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'}, self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
{'label': _("Polygon"), 'value': 'polygon'}]) {'label': _("Polygon"), 'value': 'polygon'}])
grid0.addWidget(self.area_shape_label, 67, 0) area_grid.addWidget(self.area_shape_label, 2, 0)
grid0.addWidget(self.area_shape_radio, 67, 1, 1, 2) area_grid.addWidget(self.area_shape_radio, 2, 1, 1, 2)
# Chose Strategy # Chose Strategy
self.strategy_label = FCLabel('%s:' % _("Strategy")) self.strategy_label = FCLabel('%s:' % _("Strategy"))
@@ -420,8 +448,8 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.strategy_radio = RadioSet([{'label': _('Over'), 'value': 'over'}, self.strategy_radio = RadioSet([{'label': _('Over'), 'value': 'over'},
{'label': _('Around'), 'value': 'around'}]) {'label': _('Around'), 'value': 'around'}])
grid0.addWidget(self.strategy_label, 69, 0) area_grid.addWidget(self.strategy_label, 4, 0)
grid0.addWidget(self.strategy_radio, 69, 1, 1, 2) area_grid.addWidget(self.strategy_radio, 4, 1, 1, 2)
# Over Z # Over Z
self.over_z_label = FCLabel('%s:' % _("Over Z")) self.over_z_label = FCLabel('%s:' % _("Over Z"))
@@ -431,7 +459,9 @@ class ToolsDrillPrefGroupUI(OptionsGroupUI):
self.over_z_entry.set_range(-10000.000, 10000.0000) self.over_z_entry.set_range(-10000.000, 10000.0000)
self.over_z_entry.set_precision(self.decimals) self.over_z_entry.set_precision(self.decimals)
grid0.addWidget(self.over_z_label, 71, 0) area_grid.addWidget(self.over_z_label, 6, 0)
grid0.addWidget(self.over_z_entry, 71, 1, 1, 2) area_grid.addWidget(self.over_z_entry, 6, 1, 1, 2)
FCGridLayout.set_common_column_size([param_grid, ds_grid, adv_grid, area_grid], 0)
self.layout.addStretch() self.layout.addStretch()

View File

@@ -2,7 +2,7 @@ from PyQt6 import QtWidgets, QtCore
from PyQt6.QtCore import Qt from PyQt6.QtCore import Qt
from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, NumericalEvalTupleEntry, \ from appGUI.GUIElements import RadioSet, FCDoubleSpinner, FCComboBox, FCCheckBox, FCSpinner, NumericalEvalTupleEntry, \
OptionalInputSection, NumericalEvalEntry, FCLabel, FCComboBox2, FCEntry, FCGridLayout OptionalInputSection, NumericalEvalEntry, FCLabel, FCComboBox2, FCEntry, FCGridLayout, FCFrame
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext import gettext
@@ -22,15 +22,20 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.decimals = decimals self.decimals = decimals
self.defaults = defaults self.defaults = defaults
# ## Clear non-copper regions # #############################################################################################################
self.mill_label = FCLabel("<b>%s:</b>" % _("Parameters")) # PARAMETERS Frame
# #############################################################################################################
self.mill_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
self.mill_label.setToolTip( self.mill_label.setToolTip(
_("Create CNCJob with toolpaths for milling either Geometry or drill holes.") _("Create CNCJob with toolpaths for milling either Geometry or drill holes.")
) )
self.layout.addWidget(self.mill_label) self.layout.addWidget(self.mill_label)
grid0 = FCGridLayout(v_spacing=5, h_spacing=3) param_frame = FCFrame()
self.layout.addLayout(grid0) self.layout.addWidget(param_frame)
param_grid = FCGridLayout(v_spacing=5, h_spacing=3)
param_frame.setLayout(param_grid)
# Tooldia # Tooldia
tdlabel = FCLabel('<b><font color="green">%s:</font></b>' % _('Tools Dia')) tdlabel = FCLabel('<b><font color="green">%s:</font></b>' % _('Tools Dia'))
@@ -41,8 +46,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
) )
self.cnctooldia_entry = FCEntry() self.cnctooldia_entry = FCEntry()
grid0.addWidget(tdlabel, 0, 0) param_grid.addWidget(tdlabel, 0, 0)
grid0.addWidget(self.cnctooldia_entry, 0, 1) param_grid.addWidget(self.cnctooldia_entry, 0, 1)
# Tip Dia # Tip Dia
self.tipdialabel = FCLabel('%s:' % _('V-Tip Dia')) self.tipdialabel = FCLabel('%s:' % _('V-Tip Dia'))
@@ -56,8 +61,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.tipdia_entry.set_range(0.00001, 10000.0000) self.tipdia_entry.set_range(0.00001, 10000.0000)
self.tipdia_entry.setSingleStep(0.1) self.tipdia_entry.setSingleStep(0.1)
grid0.addWidget(self.tipdialabel, 2, 0) param_grid.addWidget(self.tipdialabel, 2, 0)
grid0.addWidget(self.tipdia_entry, 2, 1) param_grid.addWidget(self.tipdia_entry, 2, 1)
# Tip Angle # Tip Angle
self.tipanglelabel = FCLabel('%s:' % _('V-Tip Angle')) self.tipanglelabel = FCLabel('%s:' % _('V-Tip Angle'))
@@ -72,8 +77,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.tipangle_entry.set_range(1.0, 180.0) self.tipangle_entry.set_range(1.0, 180.0)
self.tipangle_entry.setSingleStep(1) self.tipangle_entry.setSingleStep(1)
grid0.addWidget(self.tipanglelabel, 4, 0) param_grid.addWidget(self.tipanglelabel, 4, 0)
grid0.addWidget(self.tipangle_entry, 4, 1) param_grid.addWidget(self.tipangle_entry, 4, 1)
# Cut Z # Cut Z
cutzlabel = FCLabel('%s:' % _('Cut Z')) cutzlabel = FCLabel('%s:' % _('Cut Z'))
@@ -88,8 +93,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.cutz_entry.setSingleStep(0.1) self.cutz_entry.setSingleStep(0.1)
self.cutz_entry.setWrapping(True) self.cutz_entry.setWrapping(True)
grid0.addWidget(cutzlabel, 6, 0) param_grid.addWidget(cutzlabel, 6, 0)
grid0.addWidget(self.cutz_entry, 6, 1) param_grid.addWidget(self.cutz_entry, 6, 1)
# Multidepth CheckBox # Multidepth CheckBox
self.multidepth_cb = FCCheckBox(label=_('Multi-Depth')) self.multidepth_cb = FCCheckBox(label=_('Multi-Depth'))
@@ -101,7 +106,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
"reached." "reached."
) )
) )
grid0.addWidget(self.multidepth_cb, 8, 0) param_grid.addWidget(self.multidepth_cb, 8, 0)
# Depth/pass # Depth/pass
self.depthperpass_entry = FCDoubleSpinner() self.depthperpass_entry = FCDoubleSpinner()
@@ -113,7 +118,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.depthperpass_entry.setSingleStep(0.1) self.depthperpass_entry.setSingleStep(0.1)
self.depthperpass_entry.setWrapping(True) self.depthperpass_entry.setWrapping(True)
grid0.addWidget(self.depthperpass_entry, 8, 1) param_grid.addWidget(self.depthperpass_entry, 8, 1)
self.ois_multidepth = OptionalInputSection(self.multidepth_cb, [self.depthperpass_entry]) self.ois_multidepth = OptionalInputSection(self.multidepth_cb, [self.depthperpass_entry])
@@ -130,8 +135,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.travelz_entry.setSingleStep(0.1) self.travelz_entry.setSingleStep(0.1)
self.travelz_entry.setWrapping(True) self.travelz_entry.setWrapping(True)
grid0.addWidget(travelzlabel, 10, 0) param_grid.addWidget(travelzlabel, 10, 0)
grid0.addWidget(self.travelz_entry, 10, 1) param_grid.addWidget(self.travelz_entry, 10, 1)
# Tool change: # Tool change:
self.toolchange_cb = FCCheckBox('%s' % _("Tool change")) self.toolchange_cb = FCCheckBox('%s' % _("Tool change"))
@@ -141,7 +146,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
"in the Machine Code (Pause for tool change)." "in the Machine Code (Pause for tool change)."
) )
) )
grid0.addWidget(self.toolchange_cb, 12, 0, 1, 2) param_grid.addWidget(self.toolchange_cb, 12, 0, 1, 2)
# Toolchange Z # Toolchange Z
toolchangezlabel = FCLabel('%s:' % _('Toolchange Z')) toolchangezlabel = FCLabel('%s:' % _('Toolchange Z'))
@@ -158,8 +163,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.toolchangez_entry.setSingleStep(0.1) self.toolchangez_entry.setSingleStep(0.1)
self.toolchangez_entry.setWrapping(True) self.toolchangez_entry.setWrapping(True)
grid0.addWidget(toolchangezlabel, 14, 0) param_grid.addWidget(toolchangezlabel, 14, 0)
grid0.addWidget(self.toolchangez_entry, 14, 1) param_grid.addWidget(self.toolchangez_entry, 14, 1)
# End move Z # End move Z
endz_label = FCLabel('%s:' % _('End move Z')) endz_label = FCLabel('%s:' % _('End move Z'))
@@ -174,8 +179,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.endz_entry.setSingleStep(0.1) self.endz_entry.setSingleStep(0.1)
self.endz_entry.setWrapping(True) self.endz_entry.setWrapping(True)
grid0.addWidget(endz_label, 16, 0) param_grid.addWidget(endz_label, 16, 0)
grid0.addWidget(self.endz_entry, 16, 1) param_grid.addWidget(self.endz_entry, 16, 1)
# End Move X,Y # End Move X,Y
endmove_xy_label = FCLabel('%s:' % _('End move X,Y')) endmove_xy_label = FCLabel('%s:' % _('End move X,Y'))
@@ -186,8 +191,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
) )
self.endxy_entry = NumericalEvalTupleEntry(border_color='#0069A9') self.endxy_entry = NumericalEvalTupleEntry(border_color='#0069A9')
grid0.addWidget(endmove_xy_label, 18, 0) param_grid.addWidget(endmove_xy_label, 18, 0)
grid0.addWidget(self.endxy_entry, 18, 1) param_grid.addWidget(self.endxy_entry, 18, 1)
# Feedrate X-Y # Feedrate X-Y
frlabel = FCLabel('%s:' % _('Feedrate X-Y')) frlabel = FCLabel('%s:' % _('Feedrate X-Y'))
@@ -201,8 +206,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.cncfeedrate_entry.setSingleStep(0.1) self.cncfeedrate_entry.setSingleStep(0.1)
self.cncfeedrate_entry.setWrapping(True) self.cncfeedrate_entry.setWrapping(True)
grid0.addWidget(frlabel, 20, 0) param_grid.addWidget(frlabel, 20, 0)
grid0.addWidget(self.cncfeedrate_entry, 20, 1) param_grid.addWidget(self.cncfeedrate_entry, 20, 1)
# Feedrate Z (Plunge) # Feedrate Z (Plunge)
frz_label = FCLabel('%s:' % _('Feedrate Z')) frz_label = FCLabel('%s:' % _('Feedrate Z'))
@@ -217,8 +222,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.feedrate_z_entry.setSingleStep(0.1) self.feedrate_z_entry.setSingleStep(0.1)
self.feedrate_z_entry.setWrapping(True) self.feedrate_z_entry.setWrapping(True)
grid0.addWidget(frz_label, 22, 0) param_grid.addWidget(frz_label, 22, 0)
grid0.addWidget(self.feedrate_z_entry, 22, 1) param_grid.addWidget(self.feedrate_z_entry, 22, 1)
# Spindle Speed # Spindle Speed
spdlabel = FCLabel('%s:' % _('Spindle speed')) spdlabel = FCLabel('%s:' % _('Spindle speed'))
@@ -233,8 +238,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.cncspindlespeed_entry.set_range(0, 1000000) self.cncspindlespeed_entry.set_range(0, 1000000)
self.cncspindlespeed_entry.set_step(100) self.cncspindlespeed_entry.set_step(100)
grid0.addWidget(spdlabel, 24, 0) param_grid.addWidget(spdlabel, 24, 0)
grid0.addWidget(self.cncspindlespeed_entry, 24, 1) param_grid.addWidget(self.cncspindlespeed_entry, 24, 1)
# Dwell # Dwell
self.dwell_cb = FCCheckBox(label='%s' % _('Enable Dwell')) self.dwell_cb = FCCheckBox(label='%s' % _('Enable Dwell'))
@@ -252,8 +257,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.dwelltime_entry.setSingleStep(0.1) self.dwelltime_entry.setSingleStep(0.1)
self.dwelltime_entry.setWrapping(True) self.dwelltime_entry.setWrapping(True)
grid0.addWidget(self.dwell_cb, 26, 0) param_grid.addWidget(self.dwell_cb, 26, 0)
grid0.addWidget(self.dwelltime_entry, 26, 1) param_grid.addWidget(self.dwelltime_entry, 26, 1)
self.ois_dwell = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry]) self.ois_dwell = OptionalInputSection(self.dwell_cb, [self.dwelltime_entry])
@@ -269,18 +274,32 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
QtWidgets.QSizePolicy.Policy.Preferred) QtWidgets.QSizePolicy.Policy.Preferred)
self.pp_geometry_name_cb.addItems(self.defaults["tools_mill_preprocessor_list"]) self.pp_geometry_name_cb.addItems(self.defaults["tools_mill_preprocessor_list"])
for it in range(self.pp_geometry_name_cb.count()): for it in range(self.pp_geometry_name_cb.count()):
self.pp_geometry_name_cb.setItemData(it, self.pp_geometry_name_cb.itemText(it), self.pp_geometry_name_cb.setItemData(it, self.pp_geometry_name_cb.itemText(it),
QtCore.Qt.ItemDataRole.ToolTipRole) QtCore.Qt.ItemDataRole.ToolTipRole)
grid0.addWidget(pp_label, 28, 0) param_grid.addWidget(pp_label, 28, 0)
grid0.addWidget(self.pp_geometry_name_cb, 28, 1) param_grid.addWidget(self.pp_geometry_name_cb, 28, 1)
separator_line = QtWidgets.QFrame() # separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 30, 0, 1, 2) # param_grid.addWidget(separator_line, 30, 0, 1, 2)
# #############################################################################################################
# Advanced Options Frame
# #############################################################################################################
self.adv_label = FCLabel('<span style="color:teal;"><b>%s</b></span>' % _('Advanced Options'))
self.adv_label.setToolTip(
_("A list of advanced parameters.")
)
self.layout.addWidget(self.adv_label)
adv_frame = FCFrame()
self.layout.addWidget(adv_frame)
adv_grid = FCGridLayout(v_spacing=5, h_spacing=3)
adv_frame.setLayout(adv_grid)
# Toolchange X,Y # Toolchange X,Y
toolchange_xy_label = FCLabel('%s:' % _('Toolchange X-Y')) toolchange_xy_label = FCLabel('%s:' % _('Toolchange X-Y'))
@@ -289,8 +308,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
) )
self.toolchangexy_entry = NumericalEvalTupleEntry(border_color='#0069A9') self.toolchangexy_entry = NumericalEvalTupleEntry(border_color='#0069A9')
grid0.addWidget(toolchange_xy_label, 32, 0) adv_grid.addWidget(toolchange_xy_label, 0, 0)
grid0.addWidget(self.toolchangexy_entry, 32, 1) adv_grid.addWidget(self.toolchangexy_entry, 0, 1)
# Start move Z # Start move Z
startzlabel = FCLabel('%s:' % _('Start Z')) startzlabel = FCLabel('%s:' % _('Start Z'))
@@ -300,8 +319,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
) )
self.gstartz_entry = NumericalEvalEntry(border_color='#0069A9') self.gstartz_entry = NumericalEvalEntry(border_color='#0069A9')
grid0.addWidget(startzlabel, 34, 0) adv_grid.addWidget(startzlabel, 2, 0)
grid0.addWidget(self.gstartz_entry, 34, 1) adv_grid.addWidget(self.gstartz_entry, 2, 1)
# Feedrate rapids # Feedrate rapids
fr_rapid_label = FCLabel('%s:' % _('Feedrate Rapids')) fr_rapid_label = FCLabel('%s:' % _('Feedrate Rapids'))
@@ -318,8 +337,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.feedrate_rapid_entry.setSingleStep(0.1) self.feedrate_rapid_entry.setSingleStep(0.1)
self.feedrate_rapid_entry.setWrapping(True) self.feedrate_rapid_entry.setWrapping(True)
grid0.addWidget(fr_rapid_label, 36, 0) adv_grid.addWidget(fr_rapid_label, 4, 0)
grid0.addWidget(self.feedrate_rapid_entry, 36, 1) adv_grid.addWidget(self.feedrate_rapid_entry, 4, 1)
# End move extra cut # End move extra cut
self.extracut_cb = FCCheckBox('%s' % _('Re-cut')) self.extracut_cb = FCCheckBox('%s' % _('Re-cut'))
@@ -341,8 +360,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
"meet with last cut, we generate an\n" "meet with last cut, we generate an\n"
"extended cut over the first cut section.") "extended cut over the first cut section.")
) )
grid0.addWidget(self.extracut_cb, 38, 0) adv_grid.addWidget(self.extracut_cb, 6, 0)
grid0.addWidget(self.e_cut_entry, 38, 1) adv_grid.addWidget(self.e_cut_entry, 6, 1)
# Probe depth # Probe depth
self.pdepth_label = FCLabel('%s:' % _("Probe Z depth")) self.pdepth_label = FCLabel('%s:' % _("Probe Z depth"))
@@ -356,8 +375,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.pdepth_entry.setSingleStep(0.1) self.pdepth_entry.setSingleStep(0.1)
self.pdepth_entry.setWrapping(True) self.pdepth_entry.setWrapping(True)
grid0.addWidget(self.pdepth_label, 40, 0) adv_grid.addWidget(self.pdepth_label, 8, 0)
grid0.addWidget(self.pdepth_entry, 40, 1) adv_grid.addWidget(self.pdepth_entry, 8, 1)
# Probe feedrate # Probe feedrate
self.feedrate_probe_label = FCLabel('%s:' % _("Feedrate Probe")) self.feedrate_probe_label = FCLabel('%s:' % _("Feedrate Probe"))
@@ -370,8 +389,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.feedrate_probe_entry.setSingleStep(0.1) self.feedrate_probe_entry.setSingleStep(0.1)
self.feedrate_probe_entry.setWrapping(True) self.feedrate_probe_entry.setWrapping(True)
grid0.addWidget(self.feedrate_probe_label, 42, 0) adv_grid.addWidget(self.feedrate_probe_label, 10, 0)
grid0.addWidget(self.feedrate_probe_entry, 42, 1) adv_grid.addWidget(self.feedrate_probe_entry, 10, 1)
# Spindle direction # Spindle direction
spindle_dir_label = FCLabel('%s:' % _('Spindle direction')) spindle_dir_label = FCLabel('%s:' % _('Spindle direction'))
@@ -383,9 +402,9 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
) )
self.spindledir_radio = RadioSet([{'label': _('CW'), 'value': 'CW'}, self.spindledir_radio = RadioSet([{'label': _('CW'), 'value': 'CW'},
{'label': _('CCW'), 'value': 'CCW'}]) {'label': _('CCW'), 'value': 'CCW'}], compact=True)
grid0.addWidget(spindle_dir_label, 44, 0) adv_grid.addWidget(spindle_dir_label, 12, 0)
grid0.addWidget(self.spindledir_radio, 44, 1) adv_grid.addWidget(self.spindledir_radio, 12, 1)
# Fast Move from Z Toolchange # Fast Move from Z Toolchange
self.fplunge_cb = FCCheckBox('%s' % _('Fast Plunge')) self.fplunge_cb = FCCheckBox('%s' % _('Fast Plunge'))
@@ -395,21 +414,27 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
"meaning the fastest speed available.\n" "meaning the fastest speed available.\n"
"WARNING: the move is done at Toolchange X,Y coords.") "WARNING: the move is done at Toolchange X,Y coords.")
) )
grid0.addWidget(self.fplunge_cb, 46, 0, 1, 2) adv_grid.addWidget(self.fplunge_cb, 14, 0, 1, 2)
separator_line = QtWidgets.QFrame() # separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 48, 0, 1, 2) # param_grid.addWidget(separator_line, 48, 0, 1, 2)
# ----------------------------- # #############################################################################################################
# --- Area Exclusion ---------- # Area Exclusion Frame
# ----------------------------- # #############################################################################################################
self.area_exc_label = FCLabel('<b>%s:</b>' % _('Area Exclusion')) self.area_exc_label = FCLabel('<span style="color:magenta;"><b>%s</b></span>' % _('Area Exclusion'))
self.area_exc_label.setToolTip( self.area_exc_label.setToolTip(
_("Area exclusion parameters.") _("Area exclusion parameters.")
) )
grid0.addWidget(self.area_exc_label, 52, 0, 1, 2) self.layout.addWidget(self.area_exc_label)
area_frame = FCFrame()
self.layout.addWidget(area_frame)
area_grid = FCGridLayout(v_spacing=5, h_spacing=3)
area_frame.setLayout(area_grid)
# Exclusion Area CB # Exclusion Area CB
self.exclusion_cb = FCCheckBox('%s' % _("Exclusion areas")) self.exclusion_cb = FCCheckBox('%s' % _("Exclusion areas"))
@@ -420,7 +445,7 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
"is forbidden." "is forbidden."
) )
) )
grid0.addWidget(self.exclusion_cb, 54, 0, 1, 2) area_grid.addWidget(self.exclusion_cb, 0, 0, 1, 2)
# Area Selection shape # Area Selection shape
self.area_shape_label = FCLabel('%s:' % _("Shape")) self.area_shape_label = FCLabel('%s:' % _("Shape"))
@@ -431,8 +456,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'}, self.area_shape_radio = RadioSet([{'label': _("Square"), 'value': 'square'},
{'label': _("Polygon"), 'value': 'polygon'}]) {'label': _("Polygon"), 'value': 'polygon'}])
grid0.addWidget(self.area_shape_label, 56, 0) area_grid.addWidget(self.area_shape_label, 2, 0)
grid0.addWidget(self.area_shape_radio, 56, 1) area_grid.addWidget(self.area_shape_radio, 2, 1)
# Chose Strategy # Chose Strategy
self.strategy_label = FCLabel('%s:' % _("Strategy")) self.strategy_label = FCLabel('%s:' % _("Strategy"))
@@ -443,8 +468,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.strategy_radio = RadioSet([{'label': _('Over'), 'value': 'over'}, self.strategy_radio = RadioSet([{'label': _('Over'), 'value': 'over'},
{'label': _('Around'), 'value': 'around'}]) {'label': _('Around'), 'value': 'around'}])
grid0.addWidget(self.strategy_label, 58, 0) area_grid.addWidget(self.strategy_label, 4, 0)
grid0.addWidget(self.strategy_radio, 58, 1) area_grid.addWidget(self.strategy_radio, 4, 1)
# Over Z # Over Z
self.over_z_label = FCLabel('%s:' % _("Over Z")) self.over_z_label = FCLabel('%s:' % _("Over Z"))
@@ -454,24 +479,29 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.over_z_entry.set_range(-10000.000, 10000.0000) self.over_z_entry.set_range(-10000.000, 10000.0000)
self.over_z_entry.set_precision(self.decimals) self.over_z_entry.set_precision(self.decimals)
grid0.addWidget(self.over_z_label, 60, 0) area_grid.addWidget(self.over_z_label, 6, 0)
grid0.addWidget(self.over_z_entry, 60, 1) area_grid.addWidget(self.over_z_entry, 6, 1)
separator_line = QtWidgets.QFrame() # separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 62, 0, 1, 2) # param_grid.addWidget(separator_line, 62, 0, 1, 2)
# ----------------------------- # #############################################################################################################
# --- Area POLISH ---------- # Area Polish Frame
# ----------------------------- # #############################################################################################################
self.pol_label = FCLabel('<span style="color:brown;"><b>%s</b></span>' % _('Add Polish'))
self.pol_label = FCLabel('<b>%s:</b>' % _('Add Polish'))
self.pol_label.setToolTip( self.pol_label.setToolTip(
_("Will add a Paint section at the end of the GCode.\n" _("Will add a Paint section at the end of the GCode.\n"
"A metallic brush will clean the material after milling.") "A metallic brush will clean the material after milling.")
) )
grid0.addWidget(self.pol_label, 70, 0, 1, 2) self.layout.addWidget(self.pol_label)
polish_frame = FCFrame()
self.layout.addWidget(polish_frame)
polish_grid = FCGridLayout(v_spacing=5, h_spacing=3)
polish_frame.setLayout(polish_grid)
# Polish Margin # Polish Margin
self.polish_margin_lbl = FCLabel('%s:' % _('Margin')) self.polish_margin_lbl = FCLabel('%s:' % _('Margin'))
@@ -482,8 +512,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.polish_margin_entry.set_precision(self.decimals) self.polish_margin_entry.set_precision(self.decimals)
self.polish_margin_entry.set_range(-10000.0000, 10000.0000) self.polish_margin_entry.set_range(-10000.0000, 10000.0000)
grid0.addWidget(self.polish_margin_lbl, 72, 0) polish_grid.addWidget(self.polish_margin_lbl, 0, 0)
grid0.addWidget(self.polish_margin_entry, 72, 1) polish_grid.addWidget(self.polish_margin_entry, 0, 1)
# Polish Overlap # Polish Overlap
self.polish_over_lbl = FCLabel('%s:' % _('Overlap')) self.polish_over_lbl = FCLabel('%s:' % _('Overlap'))
@@ -496,8 +526,8 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
self.polish_over_entry.set_range(0.0000, 99.9999) self.polish_over_entry.set_range(0.0000, 99.9999)
self.polish_over_entry.setSingleStep(0.1) self.polish_over_entry.setSingleStep(0.1)
grid0.addWidget(self.polish_over_lbl, 74, 0) polish_grid.addWidget(self.polish_over_lbl, 2, 0)
grid0.addWidget(self.polish_over_entry, 74, 1) polish_grid.addWidget(self.polish_over_entry, 2, 1)
# Polish Method # Polish Method
self.polish_method_lbl = FCLabel('%s:' % _('Method')) self.polish_method_lbl = FCLabel('%s:' % _('Method'))
@@ -513,7 +543,9 @@ class ToolsMillPrefGroupUI(OptionsGroupUI):
[_("Standard"), _("Seed"), _("Lines")] [_("Standard"), _("Seed"), _("Lines")]
) )
grid0.addWidget(self.polish_method_lbl, 76, 0) polish_grid.addWidget(self.polish_method_lbl, 4, 0)
grid0.addWidget(self.polish_method_combo, 76, 1) polish_grid.addWidget(self.polish_method_combo, 4, 1)
FCGridLayout.set_common_column_size([param_grid, adv_grid, area_grid, polish_grid], 0)
self.layout.addStretch() self.layout.addStretch()

View File

@@ -1,6 +1,6 @@
from PyQt6 import QtWidgets from PyQt6 import QtWidgets
from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox, FCLabel, FCGridLayout from appGUI.GUIElements import FCDoubleSpinner, FCSpinner, RadioSet, FCCheckBox, FCLabel, FCGridLayout, FCFrame
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
import gettext import gettext
@@ -21,8 +21,10 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
self.decimals = decimals self.decimals = decimals
self.defaults = defaults self.defaults = defaults
# ## Board cuttout # #############################################################################################################
self.panelize_label = FCLabel("<b>%s:</b>" % _("Parameters")) # PARAMETERS Frame
# #############################################################################################################
self.panelize_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
self.panelize_label.setToolTip( self.panelize_label.setToolTip(
_("Create an object that contains an array of (x, y) elements,\n" _("Create an object that contains an array of (x, y) elements,\n"
"each element is a copy of the source object spaced\n" "each element is a copy of the source object spaced\n"
@@ -30,8 +32,11 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
) )
self.layout.addWidget(self.panelize_label) self.layout.addWidget(self.panelize_label)
grid0 = FCGridLayout(v_spacing=5, h_spacing=3) param_frame = FCFrame()
self.layout.addLayout(grid0) self.layout.addWidget(param_frame)
param_grid = FCGridLayout(v_spacing=5, h_spacing=3)
param_frame.setLayout(param_grid)
# ## Spacing Columns # ## Spacing Columns
self.pspacing_columns = FCDoubleSpinner() self.pspacing_columns = FCDoubleSpinner()
@@ -44,8 +49,8 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
_("Spacing between columns of the desired panel.\n" _("Spacing between columns of the desired panel.\n"
"In current units.") "In current units.")
) )
grid0.addWidget(self.spacing_columns_label, 0, 0) param_grid.addWidget(self.spacing_columns_label, 0, 0)
grid0.addWidget(self.pspacing_columns, 0, 1) param_grid.addWidget(self.pspacing_columns, 0, 1)
# ## Spacing Rows # ## Spacing Rows
self.pspacing_rows = FCDoubleSpinner() self.pspacing_rows = FCDoubleSpinner()
@@ -58,8 +63,8 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
_("Spacing between rows of the desired panel.\n" _("Spacing between rows of the desired panel.\n"
"In current units.") "In current units.")
) )
grid0.addWidget(self.spacing_rows_label, 1, 0) param_grid.addWidget(self.spacing_rows_label, 2, 0)
grid0.addWidget(self.pspacing_rows, 1, 1) param_grid.addWidget(self.pspacing_rows, 2, 1)
# ## Columns # ## Columns
self.pcolumns = FCSpinner() self.pcolumns = FCSpinner()
@@ -70,8 +75,8 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
self.columns_label.setToolTip( self.columns_label.setToolTip(
_("Number of columns of the desired panel") _("Number of columns of the desired panel")
) )
grid0.addWidget(self.columns_label, 2, 0) param_grid.addWidget(self.columns_label, 4, 0)
grid0.addWidget(self.pcolumns, 2, 1) param_grid.addWidget(self.pcolumns, 4, 1)
# ## Rows # ## Rows
self.prows = FCSpinner() self.prows = FCSpinner()
@@ -82,8 +87,8 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
self.rows_label.setToolTip( self.rows_label.setToolTip(
_("Number of rows of the desired panel") _("Number of rows of the desired panel")
) )
grid0.addWidget(self.rows_label, 3, 0) param_grid.addWidget(self.rows_label, 6, 0)
grid0.addWidget(self.prows, 3, 1) param_grid.addWidget(self.prows, 6, 1)
# ## Type of resulting Panel object # ## Type of resulting Panel object
self.panel_type_radio = RadioSet([{'label': _('Gerber'), 'value': 'gerber'}, self.panel_type_radio = RadioSet([{'label': _('Gerber'), 'value': 'gerber'},
@@ -95,8 +100,8 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
"- Geometry") "- Geometry")
) )
grid0.addWidget(self.panel_type_label, 4, 0) param_grid.addWidget(self.panel_type_label, 8, 0)
grid0.addWidget(self.panel_type_radio, 4, 1) param_grid.addWidget(self.panel_type_radio, 8, 1)
# Path optimization # Path optimization
self.poptimization_cb = FCCheckBox('%s' % _("Path Optimization")) self.poptimization_cb = FCCheckBox('%s' % _("Path Optimization"))
@@ -106,7 +111,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
"any two overlapping Line elements in the panel\n" "any two overlapping Line elements in the panel\n"
"and will remove the overlapping parts, keeping only one of them.") "and will remove the overlapping parts, keeping only one of them.")
) )
grid0.addWidget(self.poptimization_cb, 5, 0, 1, 2) param_grid.addWidget(self.poptimization_cb, 10, 0, 1, 2)
# ## Constrains # ## Constrains
self.pconstrain_cb = FCCheckBox('%s:' % _("Constrain within")) self.pconstrain_cb = FCCheckBox('%s:' % _("Constrain within"))
@@ -117,7 +122,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
"the final panel will have as many columns and rows as\n" "the final panel will have as many columns and rows as\n"
"they fit completely within selected area.") "they fit completely within selected area.")
) )
grid0.addWidget(self.pconstrain_cb, 10, 0, 1, 2) param_grid.addWidget(self.pconstrain_cb, 12, 0, 1, 2)
self.px_width_entry = FCDoubleSpinner() self.px_width_entry = FCDoubleSpinner()
self.px_width_entry.set_range(0.000001, 10000.0000) self.px_width_entry.set_range(0.000001, 10000.0000)
@@ -129,8 +134,8 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
_("The width (DX) within which the panel must fit.\n" _("The width (DX) within which the panel must fit.\n"
"In current units.") "In current units.")
) )
grid0.addWidget(self.x_width_lbl, 12, 0) param_grid.addWidget(self.x_width_lbl, 14, 0)
grid0.addWidget(self.px_width_entry, 12, 1) param_grid.addWidget(self.px_width_entry, 14, 1)
self.py_height_entry = FCDoubleSpinner() self.py_height_entry = FCDoubleSpinner()
self.py_height_entry.set_range(0.000001, 10000.0000) self.py_height_entry.set_range(0.000001, 10000.0000)
@@ -142,7 +147,7 @@ class ToolsPanelizePrefGroupUI(OptionsGroupUI):
_("The height (DY)within which the panel must fit.\n" _("The height (DY)within which the panel must fit.\n"
"In current units.") "In current units.")
) )
grid0.addWidget(self.y_height_lbl, 17, 0) param_grid.addWidget(self.y_height_lbl, 16, 0)
grid0.addWidget(self.py_height_entry, 17, 1) param_grid.addWidget(self.py_height_entry, 16, 1)
self.layout.addStretch() self.layout.addStretch()