From ba59448442749121a95457eb78cc9b87c59b13c7 Mon Sep 17 00:00:00 2001 From: Enrico Faulhaber Date: Mon, 11 Sep 2017 17:38:31 +0200 Subject: [PATCH] fixups Change-Id: If1377ef41f8d500ccab0e2a0979343b4c090c036 --- doc/source/protocol/history.rst | 7 ++ doc/source/protocol/messages.rst | 15 +++ etc/cryo.cfg | 7 ++ secop/client/baseclient.py | 2 + secop/gui/nodectrl.py | 5 +- secop/gui/ui/nodectrl.ui | 177 +++++++++++++++++++------------ secop_mlz/amagnet.py | 2 +- 7 files changed, 148 insertions(+), 67 deletions(-) diff --git a/doc/source/protocol/history.rst b/doc/source/protocol/history.rst index bbb7e46..fbd402a 100644 --- a/doc/source/protocol/history.rst +++ b/doc/source/protocol/history.rst @@ -59,8 +59,15 @@ Merge datatype and validator * ["string", <maximum_allowed_length>] or ["string", <max_size_in_bytes>, <minimum_size_in_bytes>] * ["array", <basic_data_type>, <max_elements>] or ["array", <dtype>, <max_elements>, <min_elements>] + Interface_class +++++++++++++++ * Drivable, Writable, Readable, Module (first character uppercase, no middle 'e') + +transfer_of_blob +++++++++++++++++ + + * transport-encoding as base64-encoded string (no prefixed number of bytes....) + diff --git a/doc/source/protocol/messages.rst b/doc/source/protocol/messages.rst index 353a17a..c262169 100644 --- a/doc/source/protocol/messages.rst +++ b/doc/source/protocol/messages.rst @@ -200,3 +200,18 @@ Examples (SEC-node) 'update T1 [3.49,{"t":"149128945.921397","e":0.01897}]' ... +merge datatype and validator: +----------------------------- + * enum, int, double, bool, tuple, struct as before + * ["blob", <maximum_size_in_bytes>] or ["blob", <maximum_size_in_bytes>, <minimum_size_in_bytes>] + * ["string", <maximum_allowed_length>] or ["string", <max_size_in_bytes>, <minimum_size_in_bytes>] + * ["array", <basic_data_type>, <max_elements>] or ["array", <dtype>, <max_elements>, <min_elements>] + +interface_class +--------------- + * Drivable, Writable, Readable, Module (first character uppercase, no middle 'e') + +transfer_of_blob +---------------- + * transport-encoding as base64-encoded string (no prefixed number of bytes....) + diff --git a/etc/cryo.cfg b/etc/cryo.cfg index 88ba4bb..02912f4 100644 --- a/etc/cryo.cfg +++ b/etc/cryo.cfg @@ -5,6 +5,10 @@ description = short description This is a very long description providing all the glory details in all the glory details about the stuff we are describing +.description = short description + + This is a very long description providing all the glory details in all the glory details about the stuff we are describing + [interface tcp] interface=tcp @@ -18,6 +22,9 @@ encoding=demo [device cryo] # some (non-defaut) module properties .group=very important/stuff +.description=A simulated cc cryostat with heat-load, specific heat for the sample + and a temperature dependend heat-link between sample and regulation. + # class of module: class=secop_demo.cryo.Cryostat diff --git a/secop/client/baseclient.py b/secop/client/baseclient.py index d656686..b2d0a4c 100644 --- a/secop/client/baseclient.py +++ b/secop/client/baseclient.py @@ -52,6 +52,8 @@ class TCPConnection(object): # disguise a TCP connection as serial one def __init__(self, host, port): + import mlzlog + self.log = mlzlog.getLogger('TCPConnection') self._host = host self._port = int(port) self._thread = None diff --git a/secop/gui/nodectrl.py b/secop/gui/nodectrl.py index 8311d84..6e6b89d 100644 --- a/secop/gui/nodectrl.py +++ b/secop/gui/nodectrl.py @@ -43,6 +43,7 @@ class NodeCtrl(QWidget): self.contactPointLabel.setText(self._node.contactPoint) self.equipmentIdLabel.setText(self._node.equipmentId) self.protocolVersionLabel.setText(self._node.protocolVersion) + self.nodeDescriptionLabel.setText(self._node.describingData.get('description','no description available')) self._clearLog() # now populate modules tab @@ -197,7 +198,9 @@ class ReadableWidget(QWidget): if pname in params: return params[pname].value try: - return self._node.getParameter(self._module, pname) + # if queried, we get the qualifiers as well, but don't want them here + val = self._node.getParameter(self._module, pname)[0] + return val except Exception: self.log.exception() if fallback is not Ellipsis: diff --git a/secop/gui/ui/nodectrl.ui b/secop/gui/ui/nodectrl.ui index 284e0a4..6afb00c 100644 --- a/secop/gui/ui/nodectrl.ui +++ b/secop/gui/ui/nodectrl.ui @@ -21,70 +21,6 @@ - - - - - - 75 - true - - - - Contact point: - - - - - - - TextLabel - - - - - - - - 75 - true - - - - Equipment ID: - - - - - - - TextLabel - - - - - - - - 75 - true - - - - Protocol version: - - - - - - - TextLabel - - - - - - 1 @@ -141,6 +77,117 @@ p, li { white-space: pre-wrap; } + + + NodeInfo + + + + + + + + + 75 + true + + + + Contact point: + + + + + + + TextLabel + + + + + + + + 75 + true + + + + Equipment ID: + + + + + + + TextLabel + + + + + + + + 75 + true + + + + Protocol version: + + + + + + + TextLabel + + + + + + + + 75 + true + + + + Description: + + + + + + + Description +long line + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + true @@ -160,7 +207,7 @@ p, li { white-space: pre-wrap; } 0 0 610 - 324 + 413 diff --git a/secop_mlz/amagnet.py b/secop_mlz/amagnet.py index 64847ee..80d0488 100644 --- a/secop_mlz/amagnet.py +++ b/secop_mlz/amagnet.py @@ -33,7 +33,7 @@ from secop.lib.sequence import SequencerMixin, Step from secop.protocol import status from secop.datatypes import * from secop.errors import SECoPServerError, ConfigError, ProgrammingError, CommunicationError, HardwareError, DisabledError -from secop.modules import PARAM, CMD, OVERRIDE, Module, Readable, Drivable +from secop.modules import PARAM, CMD, OVERRIDE, Readable, Drivable class GarfieldMagnet(SequencerMixin, Drivable):