GUI: Control Panel changes #2

Open
atse wants to merge 21 commits from gui_dev-ctrl_panel into gui_dev
Showing only changes of commit 55a7583867 - Show all commits

View File

@ -1,335 +1,335 @@
{ {
"ctrl_panel":[ "ctrl_panel": [
{ {
"name":"Temperature", "name": "Temperature",
"type":"float", "type": "float",
"format":"{value:.4f} °C", "format": "{value:.4f} °C",
"readonly":true "readonly": true
}, },
{ {
"name":"Current through TEC", "name": "Current through TEC",
"type":"float", "type": "float",
"suffix":"mA", "suffix": "mA",
"decimals":6, "decimals": 6,
"readonly":true "readonly": true
}, },
{ {
"name":"Output Config", "name": "Output Config",
"expanded":true, "expanded": true,
"type":"group", "type": "group",
"children":[ "children": [
{ {
"name":"Control Method", "name": "Control Method",
"type":"mutex", "type": "mutex",
"limits":[ "limits": [
"Constant Current", "Constant Current",
"Temperature PID" "Temperature PID"
], ],
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pwm", "topic": "pwm",
"field":"pid" "field": "pid"
}, },
"children":[ "children": [
{ {
"name":"Set Current", "name": "Set Current",
"type":"float", "type": "float",
"value":0, "value": 0,
"step":100, "step": 100,
"limits":[ "limits": [
-2000, -2000,
2000 2000
], ],
"triggerOnShow":true, "triggerOnShow": true,
"decimals":6, "decimals": 6,
"suffix":"mA", "suffix": "mA",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pwm", "topic": "pwm",
"field":"i_set" "field": "i_set"
}, },
"lock":false "lock": false
}, },
{ {
"name":"Set Temperature", "name": "Set Temperature",
"type":"float", "type": "float",
"value":25, "value": 25,
"step":0.1, "step": 0.1,
"limits":[ "limits": [
-273, -273,
300 300
], ],
"format":"{value:.4f} °C", "format": "{value:.4f} °C",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pid", "topic": "pid",
"field":"target" "field": "target"
}, },
"lock":false "lock": false
} }
] ]
}, },
{ {
"name":"Limits", "name": "Limits",
"expanded":true, "expanded": true,
"type":"group", "type": "group",
"children":[ "children": [
{ {
"name":"Max Cooling Current", "name": "Max Cooling Current",
"type":"float", "type": "float",
"value":0, "value": 0,
"step":100, "step": 100,
"decimals":6, "decimals": 6,
"limits":[ "limits": [
0, 0,
2000 2000
], ],
"suffix":"mA", "suffix": "mA",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pwm", "topic": "pwm",
"field":"max_i_pos" "field": "max_i_pos"
}, },
"lock":false "lock": false
}, },
{ {
"name":"Max Heating Current", "name": "Max Heating Current",

Replacing the incorrectly defined FLOAT_REGEX on pyqtgraph.functions is more preferable.

Replacing the incorrectly defined FLOAT_REGEX on pyqtgraph.functions is more preferable.
Outdated
Review

How do I do this as a patch to PyQtGraph itself? Seems to be a cleaner solution compared to patching it in our own code.

How do I do this as a patch to PyQtGraph itself? Seems to be a cleaner solution compared to patching it in our own code.
"type":"float", "type": "float",
"value":0, "value": 0,
"step":100, "step": 100,
"decimals":6, "decimals": 6,
"limits":[ "limits": [
0, 0,
2000 2000
], ],
"suffix":"mA", "suffix": "mA",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pwm", "topic": "pwm",
"field":"max_i_neg" "field": "max_i_neg"
}, },
"lock":false "lock": false
}, },
{ {
"name":"Max Voltage Difference", "name": "Max Voltage Difference",
"type":"float", "type": "float",
"value":0, "value": 0,
"step":0.1, "step": 0.1,
"limits":[ "limits": [
0, 0,
5 5
], ],
"siPrefix":true, "siPrefix": true,
"suffix":"V", "suffix": "V",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pwm", "topic": "pwm",
"field":"max_v" "field": "max_v"
}, },
"lock":false "lock": false
} }
] ]
} }
] ]
}, },
{ {
"name":"Thermistor Config", "name": "Thermistor Config",
"expanded":true, "expanded": true,
"type":"group", "type": "group",
"children":[ "children": [
{ {
"name":"T₀", "name": "T₀",
"type":"float", "type": "float",
"value":25, "value": 25,
"step":0.1, "step": 0.1,
"limits":[ "limits": [
-100, -100,
100 100
], ],
"format":"{value:.4f} °C", "format": "{value:.4f} °C",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"s-h", "topic": "s-h",
"field":"t0" "field": "t0"
}, },
"lock":false "lock": false
}, },
{ {
"name":"R₀", "name": "R₀",
"type":"float", "type": "float",
"value":10000, "value": 10000,
"step":1, "step": 1,
"siPrefix":true, "siPrefix": true,
"suffix":"Ω", "suffix": "Ω",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"s-h", "topic": "s-h",
"field":"r0" "field": "r0"
}, },
"lock":false "lock": false
}, },
{ {
"name":"B", "name": "B",
"type":"float", "type": "float",
"value":3950, "value": 3950,
"step":1, "step": 1,
"suffix":"K", "suffix": "K",
"decimals":4, "decimals": 4,
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"s-h", "topic": "s-h",
"field":"b" "field": "b"
}, },
"lock":false "lock": false
}, },
{ {
"name":"Postfilter Rate", "name": "Postfilter Rate",
"type":"list", "type": "list",
"value":16.67, "value": 16.67,
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"postfilter", "topic": "postfilter",
"field":"rate" "field": "rate"
}, },
"limits":{ "limits": {
"Off":null, "Off": null,
"16.67 Hz":16.67, "16.67 Hz": 16.67,
"20 Hz":20.0, "20 Hz": 20.0,
"21.25 Hz":21.25, "21.25 Hz": 21.25,
"27 Hz":27.0 "27 Hz": 27.0
}, },
"lock":false "lock": false
} }
] ]
}, },
{ {
"name":"PID Config", "name": "PID Config",
"expanded":true, "expanded": true,
"type":"group", "type": "group",
"children":[ "children": [
{ {
"name":"Kp", "name": "Kp",
"type":"float", "type": "float",
"step":0.1, "step": 0.1,
"suffix":"", "suffix": "",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pid", "topic": "pid",
"field":"kp" "field": "kp"
}, },
"lock":false "lock": false
}, },
{ {
"name":"Ki", "name": "Ki",
"type":"float", "type": "float",
"step":0.1, "step": 0.1,
"suffix":"Hz", "suffix": "Hz",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pid", "topic": "pid",
"field":"ki" "field": "ki"
}, },
"lock":false "lock": false
}, },
{ {
"name":"Kd", "name": "Kd",
"type":"float", "type": "float",

You should fix all the siPrefix. Especially when we do not allow unit to be modified now. It will be confusing if the siPrefix of the unit suddenly changes.

You should fix **all** the siPrefix. Especially when we do not allow unit to be modified now. It will be confusing if the siPrefix of the unit suddenly changes.
"step":0.1, "step": 0.1,
"suffix":"s", "suffix": "s",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pid", "topic": "pid",
"field":"kd" "field": "kd"
}, },
"lock":false "lock": false
}, },
{ {
"name":"PID Output Clamping", "name": "PID Output Clamping",
"expanded":true, "expanded": true,
"type":"group", "type": "group",
"children":[ "children": [
{ {
"name":"Minimum", "name": "Minimum",
"type":"float", "type": "float",
"step":100, "step": 100,
"limits":[ "limits": [
-2000, -2000,
2000 2000
], ],
"decimals":6, "decimals": 6,
"suffix":"mA", "suffix": "mA",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pid", "topic": "pid",
"field":"output_min" "field": "output_min"
}, },
"lock":false "lock": false
}, },
{ {
"name":"Maximum", "name": "Maximum",
"type":"float", "type": "float",
"step":100, "step": 100,
"limits":[ "limits": [
-2000, -2000,
2000 2000
], ],
"decimals":6, "decimals": 6,
"suffix":"mA", "suffix": "mA",
"thermostat:set_param":{ "thermostat:set_param": {
"topic":"pid", "topic": "pid",
"field":"output_max" "field": "output_max"
}, },
"lock":false "lock": false
} }
] ]
}, },
{ {
"name":"PID Auto Tune", "name": "PID Auto Tune",
"expanded":false, "expanded": false,
"type":"group", "type": "group",
"children":[ "children": [
{ {
"name":"Target Temperature", "name": "Target Temperature",
"type":"float", "type": "float",
"value":20, "value": 20,
"step":0.1, "step": 0.1,
"format":"{value:.4f} °C", "format": "{value:.4f} °C",
"pid_autotune":"target_temp" "pid_autotune": "target_temp"
}, },
{ {
"name":"Test Current", "name": "Test Current",
"type":"float", "type": "float",
"value":0, "value": 0,
"decimals":6, "decimals": 6,
"step":100, "step": 100,
"limits":[ "limits": [
-2000, -2000,
2000 2000
], ],
"suffix":"mA", "suffix": "mA",
"pid_autotune":"test_current" "pid_autotune": "test_current"
}, },
{ {
"name":"Temperature Swing", "name": "Temperature Swing",
"type":"float", "type": "float",
"value":1.5, "value": 1.5,
"step":0.1, "step": 0.1,
"prefix":"±", "prefix": "±",
"format":"{value:.4f} °C", "format": "{value:.4f} °C",
"pid_autotune":"temp_swing" "pid_autotune": "temp_swing"
}, },
{ {
"name":"Lookback", "name": "Lookback",
"type":"float", "type": "float",
"value":3.0, "value": 3.0,
"step":0.1, "step": 0.1,
"format":"{value:.4f} s", "format": "{value:.4f} s",
"pid_autotune":"lookback" "pid_autotune": "lookback"
}, },
{ {
"name":"Run", "name": "Run",
"type":"action", "type": "action",
"tip":"Run" "tip": "Run"
} }
] ]
} }
] ]
}, },
{ {
"name":"Save to flash", "name": "Save to flash",
"type":"action", "type": "action",
"tip":"Save config to thermostat, applies on reset" "tip": "Save config to thermostat, applies on reset"
}, },
{ {
"name":"Load from flash", "name": "Load from flash",
"type":"action", "type": "action",
"tip":"Load config from flash" "tip": "Load config from flash"
} }
] ]
} }