From 21c49df1a24d2975c15dbc2f25b7cee6ef8bbac2 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Fri, 4 Jun 2021 12:23:55 +0200 Subject: [PATCH 1/2] fixes on secop gui - do not display a dialog when a command returns None - apply fmtstr, if available Change-Id: I74da3e86e4eae9000608581e0a0f6e8c72cef715 --- secop/gui/modulectrl.py | 3 ++- secop/gui/params/__init__.py | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/secop/gui/modulectrl.py b/secop/gui/modulectrl.py index 4c54d86..0fe5210 100644 --- a/secop/gui/modulectrl.py +++ b/secop/gui/modulectrl.py @@ -165,7 +165,8 @@ class ModuleCtrl(QWidget): result = None qualifiers = {} # XXX: flag missing data report as error - showCommandResultDialog(command, args, result, qualifiers) + if result is not None: + showCommandResultDialog(command, args, result, qualifiers) def _initModuleWidgets(self): initValues = self._node.queryCache(self._module) diff --git a/secop/gui/params/__init__.py b/secop/gui/params/__init__.py index 92e5584..60da285 100644 --- a/secop/gui/params/__init__.py +++ b/secop/gui/params/__init__.py @@ -76,7 +76,13 @@ class GenericParameterWidget(ParameterWidget): self.setLineEdit.text()) def updateValue(self, value): - self.currentLineEdit.setText(str(value)) + fmtstr = getattr(self._datatype, 'fmtstr', '%s') + if value.readerror: + value = str(value) + else: + value = fmtstr % (value.value,) + self.currentLineEdit.setText(value) + # self.currentLineEdit.setText(str(value)) class EnumParameterWidget(GenericParameterWidget): From 8d6ba91a5ed02a42a5af4a04e912766b32cb0dba Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Fri, 4 Jun 2021 12:25:41 +0200 Subject: [PATCH 2/2] changes defaults in ls370sim Change-Id: I6388358c42a4b115fc5aec4df0d4588457140744 --- secop_psi/ls370sim.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/secop_psi/ls370sim.py b/secop_psi/ls370sim.py index e0dbf08..354f4f1 100644 --- a/secop_psi/ls370sim.py +++ b/secop_psi/ls370sim.py @@ -28,12 +28,12 @@ class Ls370Sim(Communicator): ('RDGR?%d', '1.0'), ('RDGST?%d', '0'), ('RDGRNG?%d', '0,5,5,0,0'), - ('INSET?%d', '1,5,5,0,0'), - ('FILTER?%d', '1,5,80'), + ('INSET?%d', '1,3,3,0,0'), + ('FILTER?%d', '1,1,80'), ] OTHER_COMMANDS = [ ('*IDN?', 'LSCI,MODEL370,370184,05302003'), - ('SCAN?', '3,1'), + ('SCAN?', '3,0'), ] def earlyInit(self):