From 4a7d7abf3a5c1813d472e9a9195a4b8ef90a4272 Mon Sep 17 00:00:00 2001 From: atse Date: Mon, 22 Jul 2024 16:00:17 +0800 Subject: [PATCH] ctrl_panel: Put plotted values into readings group For more intuitiveness to first-time users --- pytec/pytec/gui/view/ctrl_panel.py | 6 ++-- pytec/pytec/gui/view/param_tree.json | 42 +++++++++++++++++----------- 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/pytec/pytec/gui/view/ctrl_panel.py b/pytec/pytec/gui/view/ctrl_panel.py index 858d8de..d29f7d2 100644 --- a/pytec/pytec/gui/view/ctrl_panel.py +++ b/pytec/pytec/gui/view/ctrl_panel.py @@ -142,11 +142,13 @@ class CtrlPanel(QObject): "output", "control_method", "i_set" ).setValue(settings["i_set"]) if settings["temperature"] is not None: - self.params[channel].child("temperature").setValue( + self.params[channel].child("readings", "temperature").setValue( settings["temperature"] ) if settings["tec_i"] is not None: - self.params[channel].child("tec_i").setValue(settings["tec_i"]) + self.params[channel].child("readings", "tec_i").setValue( + settings["tec_i"] + ) @pyqtSlot("QVariantList") def update_thermistor(self, sh_data): diff --git a/pytec/pytec/gui/view/param_tree.json b/pytec/pytec/gui/view/param_tree.json index abcd1c7..f7e588f 100644 --- a/pytec/pytec/gui/view/param_tree.json +++ b/pytec/pytec/gui/view/param_tree.json @@ -1,23 +1,31 @@ { "ctrl_panel": [ { - "name": "temperature", - "title": "Temperature", - "type": "float", - "format": "{value:.4f} {suffix}", - "suffix": "°C", - "readonly": true, - "tip": "The measured temperature at the thermistor" - }, - { - "name": "tec_i", - "title": "Current through TEC", - "type": "float", - "siPrefix": true, - "suffix": "A", - "decimals": 6, - "readonly": true, - "tip": "The measured current through the TEC" + "name": "readings", + "title": "Readings", + "type": "group", + "tip": "Thermostat readings", + "children": [ + { + "name": "temperature", + "title": "Temperature", + "type": "float", + "format": "{value:.4f} {suffix}", + "suffix": "°C", + "readonly": true, + "tip": "The measured temperature at the thermistor" + }, + { + "name": "tec_i", + "title": "Current through TEC", + "type": "float", + "siPrefix": true, + "suffix": "A", + "decimals": 6, + "readonly": true, + "tip": "The measured current through the TEC" + } + ] }, { "name": "output",