Compare commits

..

8 Commits

Author SHA1 Message Date
a6c852369f ctrl_panel: Reformat SpinBox text always if valid
The parameter SpinBoxes previously would only update if the interpreted
value was changed, missing cases where the text would have changed but
the value stays the same, e.g. removing trailing decimal zeros.
2024-08-07 17:59:32 +08:00
3ed181403f ctrl_panel: Move postfilter into its own group 2024-08-07 17:59:27 +08:00
205f5c0ae9 ctrl_panel: Use new locking mechanism from Kirdy 2024-08-07 17:59:07 +08:00
3c4bc4b50c ctrl_panel: Fix editing fields with unit "°C"
A faulty regular expression within PyQtGraph causes any Parameter with a
suffix that doesn't begin with an alphanumeric character (as matched
with \w) to act abnormally. For instance, entering "100 °C" into the
input boxes gets interpreted as 10 °C.

Patch the FLOAT_REGEX in PyQtGraph to simply match for any character in
the suffix group.
2024-08-07 17:59:06 +08:00
3a0bb66212 ctrl_panel: More appropriate steps and fixes 2024-08-07 17:59:06 +08:00
9ebdcfc54f ctrl_panel: Put plotted values into readings group
For more intuitiveness to first-time users
2024-08-07 17:59:06 +08:00
980cabefb5 ctrl_panel: Fix max_v to only have unit "V"
As most users do not need to limit TEC voltage with accuracy of less
than 1mV.
2024-08-07 17:59:06 +08:00
e1861263b2 ctrl_panel: Indicate active parameter of control
Instead of hiding the inactive control parameter, underline and bold the
active control parameter title, e.g. "Set Current" when control method
is constant current, and "Setpoint" when it is temperature PID.
2024-08-07 17:59:06 +08:00

View File

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