Change-Id: If1377ef41f8d500ccab0e2a0979343b4c090c036
This commit is contained in:
Enrico Faulhaber
2017-09-11 17:38:31 +02:00
parent 77b01404d9
commit ba59448442
7 changed files with 148 additions and 67 deletions

View File

@ -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....)

View File

@ -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....)

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -21,70 +21,6 @@
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Contact point:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="contactPointLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Equipment ID:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="equipmentIdLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Protocol version:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="protocolVersionLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
@ -141,6 +77,117 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</widget>
<widget class="QWidget" name="nodeInfoTab">
<attribute name="title">
<string>NodeInfo</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Contact point:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="contactPointLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Equipment ID:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="equipmentIdLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Protocol version:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="protocolVersionLabel">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Description:</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="nodeDescriptionLabel">
<property name="text">
<string>Description
long line</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="modulesTab">
<property name="enabled">
<bool>true</bool>
@ -160,7 +207,7 @@ p, li { white-space: pre-wrap; }
<x>0</x>
<y>0</y>
<width>610</width>
<height>324</height>
<height>413</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5">

View File

@ -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):