ctrl_panel: Add tooltips

For users' better understanding of what the parameters do
This commit is contained in:
atse 2024-06-20 16:13:27 +08:00
parent 30ba8260d0
commit 3c7b21a709
2 changed files with 43 additions and 9 deletions

View File

@ -42,6 +42,13 @@ class MutexParameter(pTypes.ListParameter):
registerParameterType("mutex", MutexParameter) registerParameterType("mutex", MutexParameter)
def set_tree_label_tips(tree):
for item in tree.listAllItems():
p = item.param
if "tip" in p.opts:
item.setToolTip(0, p.opts["tip"])
class CtrlPanel(QObject): class CtrlPanel(QObject):
set_zero_limits_warning_sig = pyqtSignal(list) set_zero_limits_warning_sig = pyqtSignal(list)
@ -79,6 +86,8 @@ class CtrlPanel(QObject):
self.params[i].setValue = self._setValue self.params[i].setValue = self._setValue
self.params[i].sigTreeStateChanged.connect(sigTreeStateChanged_handle) self.params[i].sigTreeStateChanged.connect(sigTreeStateChanged_handle)
set_tree_label_tips(tree)
for handle in sigActivated_handles[i]: for handle in sigActivated_handles[i]:
self.params[i].child(*handle[0]).sigActivated.connect(handle[1]) self.params[i].child(*handle[0]).sigActivated.connect(handle[1])

View File

@ -5,7 +5,8 @@
"title": "Temperature", "title": "Temperature",
"type":"float", "type":"float",
"format":"{value:.4f} °C", "format":"{value:.4f} °C",
"readonly":true "readonly":true,
"tip": "The measured temperature, according to the B-Parameter equation"
}, },
{ {
"name":"tec_i", "name":"tec_i",
@ -13,13 +14,15 @@
"type":"float", "type":"float",
"suffix":"mA", "suffix":"mA",
"decimals":6, "decimals":6,
"readonly":true "readonly":true,
"tip": "The measured current going through the TEC"
}, },
{ {
"name":"output", "name":"output",
"title":"Output Settings", "title":"Output Settings",
"expanded":true, "expanded":true,
"type":"group", "type":"group",
"tip": "Settings of the output through to the load",
"children":[ "children":[
{ {
"name":"control_method", "name":"control_method",
@ -37,6 +40,7 @@
"pid" "pid"
] ]
], ],
"tip":"Select control method of output",
"children":[ "children":[
{ {
"name":"i_set", "name":"i_set",
@ -56,6 +60,7 @@
"ch", "ch",
"i_set" "i_set"
], ],
"tip": "Set current through output",
"lock":false "lock":false
}, },
{ {
@ -74,6 +79,7 @@
"ch", "ch",
"target" "target"
], ],
"tip": "Set target temperature",
"lock":false "lock":false
} }
] ]
@ -101,6 +107,7 @@
"ch", "ch",
"max_i_pos" "max_i_pos"
], ],
"tip": "The maximum cooling (+ve) current through the output pins",
"lock":false "lock":false
}, },
{ {
@ -120,11 +127,12 @@
"ch", "ch",
"max_i_neg" "max_i_neg"
], ],
"tip": "The maximum heating (-ve) current through the output pins",
"lock":false "lock":false
}, },
{ {
"name":"max_v", "name":"max_v",
"title":"Max Voltage Difference", "title":"Max Absolute Voltage",
"type":"float", "type":"float",
"value":0, "value":0,
"step":0.1, "step":0.1,
@ -139,6 +147,7 @@
"ch", "ch",
"max_v" "max_v"
], ],
"tip": "The maximum voltage across the output pins",
"lock":false "lock":false
} }
] ]
@ -150,7 +159,7 @@
"title":"Thermistor Settings", "title":"Thermistor Settings",
"expanded":true, "expanded":true,
"type":"group", "type":"group",
"tip": "Settings of the connected Thermistor", "tip": "Settings of the connected Thermistor, including for the B-Parameter conversion.",
"children":[ "children":[
{ {
"name":"t0", "name":"t0",
@ -168,6 +177,7 @@
"ch", "ch",
"t0" "t0"
], ],
"tip": "The origin temperature for the B-Parameter equation",
"lock":false "lock":false
}, },
{ {
@ -183,6 +193,7 @@
"ch", "ch",
"r0" "r0"
], ],
"tip": "The origin resistance for the B-Parameter equation",
"lock":false "lock":false
}, },
{ {
@ -198,6 +209,7 @@
"ch", "ch",
"b" "b"
], ],
"tip": "The B-Parameter",
"lock":false "lock":false
}, },
{ {
@ -217,6 +229,7 @@
"21.25 Hz":21.25, "21.25 Hz":21.25,
"27 Hz":27.0 "27 Hz":27.0
}, },
"tip": "Filter some frequencies on the SENS input",
"lock":false "lock":false
} }
] ]
@ -226,6 +239,7 @@
"title":"PID Settings", "title":"PID Settings",
"expanded":true, "expanded":true,
"type":"group", "type":"group",
"tip": "",
"children":[ "children":[
{ {
"name":"kp", "name":"kp",
@ -238,6 +252,7 @@
"ch", "ch",
"kp" "kp"
], ],
"tip": "Proportional gain",
"lock":false "lock":false
}, },
{ {
@ -251,6 +266,7 @@
"ch", "ch",
"ki" "ki"
], ],
"tip": "Integral gain",
"lock":false "lock":false
}, },
{ {
@ -264,6 +280,7 @@
"ch", "ch",
"kd" "kd"
], ],
"tip": "Differential gain",
"lock":false "lock":false
}, },
{ {
@ -271,6 +288,7 @@
"title":"PID Output Clamping", "title":"PID Output Clamping",
"expanded":true, "expanded":true,
"type":"group", "type":"group",
"tip": "Clamps PID outputs to specified range\nCould be different than output limits",
"children":[ "children":[
{ {
"name":"output_min", "name":"output_min",
@ -288,6 +306,7 @@
"ch", "ch",
"output_min" "output_min"
], ],
"tip": "Minimum PID output",
"lock":false "lock":false
}, },
{ {
@ -306,6 +325,7 @@
"ch", "ch",
"output_max" "output_max"
], ],
"tip": "Maximum PID output",
"lock":false "lock":false
} }
] ]
@ -315,6 +335,7 @@
"title":"PID Auto Tune", "title":"PID Auto Tune",
"expanded":false, "expanded":false,
"type":"group", "type":"group",
"tip": "Automatically tune PID parameters",
"children":[ "children":[
{ {
"name":"target_temp", "name":"target_temp",
@ -326,7 +347,8 @@
"pid_autotune":[ "pid_autotune":[
"target_temp", "target_temp",
"ch" "ch"
] ],
"tip": "The target temperature to autotune for"
}, },
{ {
"name":"test_current", "name":"test_current",
@ -343,7 +365,8 @@
"pid_autotune":[ "pid_autotune":[
"test_current", "test_current",
"ch" "ch"
] ],
"tip": "The testing current when autotuning"
}, },
{ {
"name":"temp_swing", "name":"temp_swing",
@ -356,7 +379,8 @@
"pid_autotune":[ "pid_autotune":[
"temp_swing", "temp_swing",
"ch" "ch"
] ],
"tip": "The temperature swing around the target"
}, },
{ {
"name":"lookback", "name":"lookback",
@ -368,13 +392,14 @@
"pid_autotune":[ "pid_autotune":[
"lookback", "lookback",
"ch" "ch"
] ],
"tip": "Amount of time to lookback"
}, },
{ {
"name":"run_pid", "name":"run_pid",
"title":"Run", "title":"Run",
"type":"action", "type":"action",
"tip":"Run" "tip":"Run PID Autotune with above settings"
} }
] ]
} }