fix handling of StructOf datatype

- change secop.client.SecopClient to use native types instead of
  strings for its setParameter and execCommand methods.
- secop-gui: for now, setParameter accept strings for complex types.
  this should be changed to use native type in an other change
- fix bugs in parser.py

+ SecopClient: make visible in an error message that the error
  was generated on the SEC node
+ fix a bug when a command is called with 0 as argument

Change-Id: Id87d4678311ef8cf43a25153254d36127e16c6d9
Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/23299
Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
2020-06-24 14:15:35 +02:00
parent c16adf38cd
commit 1655e252fc
6 changed files with 54 additions and 42 deletions

View File

@ -75,14 +75,16 @@ class QSECNode(QObject):
return self.modules[module]['parameters'][parameter]
def setParameter(self, module, parameter, value):
self.conn.setParameter(module, parameter, value)
# TODO: change the widgets for complex types to no longer use strings
datatype = self.conn.modules[module]['parameters'][parameter]['datatype']
self.conn.setParameter(module, parameter, datatype.from_string(value))
def getParameter(self, module, parameter):
return self.conn.getParameter(module, parameter, True)
def execCommand(self, module, command, arg):
def execCommand(self, module, command, argument):
try:
return self.conn.execCommand(module, command, arg)
return self.conn.execCommand(module, command, argument)
except Exception as e:
return 'ERROR: %r' % e, {}