From 2952df46ac4dd7776b64f381035ae89c8f7abefd Mon Sep 17 00:00:00 2001 From: atse Date: Fri, 28 Jun 2024 11:20:37 +0800 Subject: [PATCH] Use siPrefix for displaying measured current Won't have the unit adjustment problem --- pytec/pytec/gui/view/ctrl_panel.py | 2 +- pytec/pytec/gui/view/param_tree.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pytec/pytec/gui/view/ctrl_panel.py b/pytec/pytec/gui/view/ctrl_panel.py index 70be738..c678252 100644 --- a/pytec/pytec/gui/view/ctrl_panel.py +++ b/pytec/pytec/gui/view/ctrl_panel.py @@ -161,7 +161,7 @@ class CtrlPanel(QObject): ) if settings["tec_i"] is not None: self.params[channel].child("current").setValue( - settings["tec_i"] * 1000 + settings["tec_i"] ) @pyqtSlot("QVariantList") diff --git a/pytec/pytec/gui/view/param_tree.json b/pytec/pytec/gui/view/param_tree.json index da44132..1ca7c49 100644 --- a/pytec/pytec/gui/view/param_tree.json +++ b/pytec/pytec/gui/view/param_tree.json @@ -11,7 +11,8 @@ "name":"current", "title":"Current through TEC", "type":"float", - "suffix":"mA", + "siPrefix":true, + "suffix":"A", "decimals":6, "readonly":true },