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

@ -20,6 +20,68 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="consoleTab">
<attribute name="title">
<string>Console</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextBrowser" name="logTextBrowser">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:11pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="2">
<widget class="QPushButton" name="clearPushButton">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="msgLineEdit"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&gt;&gt;&gt;</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="sendPushButton">
<property name="text">
<string>Send</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</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">
@ -82,63 +144,48 @@
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>1</number>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<widget class="QWidget" name="consoleTab">
<attribute name="title">
<string>Console</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextBrowser" name="logTextBrowser">
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:11pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<property name="text">
<string>Description:</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="2">
<widget class="QPushButton" name="clearPushButton">
<item row="4" column="0" colspan="2">
<widget class="QLabel" name="nodeDescriptionLabel">
<property name="text">
<string>Clear</string>
<string>Description
long line</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="msgLineEdit"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>&gt;&gt;&gt;</string>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QPushButton" name="sendPushButton">
<property name="text">
<string>Send</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
<property name="default">
<bool>false</bool>
<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">
@ -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):