Fix control method no bolding & underline at init

This commit is contained in:
atse 2024-08-12 11:41:03 +08:00
parent c6fa3cdb80
commit f5338e97f3

View File

@ -57,7 +57,7 @@ class CtrlPanel(QObject):
for handle in sigActivated_handles[ch]:
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:
is_constant_current = control_method == "constant_current"
font = item.font(0)
@ -71,7 +71,10 @@ class CtrlPanel(QObject):
font.setBold(is_temperature_pid)
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:
font = item.font(0)