From 4309f9044ce00e43f59d9ca61f301f7c32086c64 Mon Sep 17 00:00:00 2001 From: atse Date: Fri, 28 Jun 2024 11:20:37 +0800 Subject: [PATCH] ctrl_panel: Appropriate units for measured current Allow the readonly display of current to vary its SI prefix in the unit, since as a display entry it won't have the unit adjustment problem. --- pytec/pytec/gui/view/ctrl_panel.py | 4 +--- pytec/pytec/gui/view/param_tree.json | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pytec/pytec/gui/view/ctrl_panel.py b/pytec/pytec/gui/view/ctrl_panel.py index 560a122..b68c4fd 100644 --- a/pytec/pytec/gui/view/ctrl_panel.py +++ b/pytec/pytec/gui/view/ctrl_panel.py @@ -160,9 +160,7 @@ class CtrlPanel(QObject): settings["temperature"] ) if settings["tec_i"] is not None: - self.params[channel].child("tec_i").setValue( - settings["tec_i"] * 1000 - ) + self.params[channel].child("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 8f5a1b7..c010bf3 100644 --- a/pytec/pytec/gui/view/param_tree.json +++ b/pytec/pytec/gui/view/param_tree.json @@ -12,7 +12,8 @@ "name": "tec_i", "title": "Current through TEC", "type": "float", - "suffix": "mA", + "siPrefix": true, + "suffix": "A", "decimals": 6, "readonly": true, "tip": "The measured current through the TEC"