Compare commits

...

2 Commits

Author SHA1 Message Date
ea6d07d9df Docstring change 2024-08-12 11:59:45 +08:00
f5338e97f3 Fix control method no bolding & underline at init 2024-08-12 11:41:03 +08:00
2 changed files with 7 additions and 4 deletions

View File

@ -57,7 +57,7 @@ class CtrlPanel(QObject):
for handle in sigActivated_handles[ch]: for handle in sigActivated_handles[ch]:
param.child(*handle[0]).sigActivated.connect(handle[1]) param.child(*handle[0]).sigActivated.connect(handle[1])
def _indicate_usage(param, control_method): def _indicate_usage(param, control_method="constant_current"):
for item in param.child("i_set").items: for item in param.child("i_set").items:
is_constant_current = control_method == "constant_current" is_constant_current = control_method == "constant_current"
font = item.font(0) font = item.font(0)
@ -71,7 +71,10 @@ class CtrlPanel(QObject):
font.setBold(is_temperature_pid) font.setBold(is_temperature_pid)
item.setFont(0, font) item.setFont(0, font)
param.child("output", "control_method").sigValueChanged.connect(_indicate_usage) param.child("output", "control_method").sigValueChanged.connect(
_indicate_usage
)
_indicate_usage(param.child("output", "control_method"))
for item in param.child("output", "control_method").items: for item in param.child("output", "control_method").items:
font = item.font(0) font = item.font(0)

View File

@ -23,8 +23,8 @@ class UnitfulSpinBox(SpinBox):
* The "pinSiPrefix" option, where the siPrefix could be fixed to a * The "pinSiPrefix" option, where the siPrefix could be fixed to a
particular scale instead of as determined by its value. particular scale instead of as determined by its value.
* The "noUnitEditing" option, where the unit portion of the * The "noUnitEditing" option, where the suffix and pinned siPrefix
SpinBox text, including the siPrefix, is fixed and uneditable. of the SpinBox text is fixed and uneditable.
""" """
def __init__(self, parent=None, value=0.0, **kwargs): def __init__(self, parent=None, value=0.0, **kwargs):