Commit 29eea96a authored by Reto Da Forno's avatar Reto Da Forno
Browse files

support for periodic actuation events added

parent 9da17d0d
......@@ -571,7 +571,18 @@ def start_test(testid, cur, cn, obsdict_key, obsdict_id):
pin = pinconf.xpath('d:pin', namespaces=ns)[0].text.strip()
level = pinconf.xpath('d:level', namespaces=ns)[0].text.strip()
ofs = pinconf.xpath('d:offset', namespaces=ns)[0].text.strip()
xmlblock += "\t<pinConf>\n\t\t<pin>%s</pin>\n\t\t<level>%s</level>\n\t\t<offset>%s</offset>\n\t</pinConf>\n" % (pin, level, ofs)
count = pinconf.xpath('d:count', namespaces=ns)
if count:
count = int(count[0].text.strip())
else:
count = 1
period = pinconf.xpath('d:period', namespaces=ns)
if period:
period = float(period[0].text.strip())
# periodic toggling
xmlblock += "\t<pinConf>\n\t\t<pin>%s</pin>\n\t\t<level>toggle</level>\n\t\t<offset>%s</offset>\n\t\t<period>%f</period>\n\t\t<count>%d</count>\n\t</pinConf>\n" % (pin, ofs, period, count)
else:
xmlblock += "\t<pinConf>\n\t\t<pin>%s</pin>\n\t\t<level>%s</level>\n\t\t<offset>%s</offset>\n\t</pinConf>\n" % (pin, level, ofs)
for obsid in obsids:
obsid = int(obsid)
obskey = obsdict_id[obsid][0]
......
......@@ -246,7 +246,7 @@
<xs:complexType name="gpioActuationConfType">
<xs:sequence>
<xs:element name="obsIds" type="obsIdListRestType"/>
<xs:element name="pinConf" type="gpioActuationPinConfType" minOccurs="1" maxOccurs="250"/>
<xs:element name="pinConf" type="gpioActuationPinConfType" minOccurs="1" maxOccurs="1000"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="gpioActuationPinConfType">
......@@ -254,6 +254,8 @@
<xs:element name="pin" type="pinActType"/>
<xs:element name="level" type="pinActLevelType"/>
<xs:element name="offset" type="offsetSecsFloatType"/>
<xs:element name="period" type="periodSecsFloatType" minOccurs="0"/>
<xs:element name="count" type="periodicCountType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
......@@ -383,6 +385,13 @@
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="periodSecsFloatType">
<xs:restriction base="xs:float">
<xs:minInclusive value="0.001"/>
<xs:maxInclusive value="1000.0"/>
</xs:restriction>
</xs:simpleType>
<!-- Type definition for time offset in microseconds -->
<xs:simpleType name="microsecsType">
<xs:restriction base="xs:integer">
......@@ -425,7 +434,7 @@
<xs:simpleType name="periodicCountType">
<xs:restriction base="xs:integer">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="4294967295"/>
<xs:maxInclusive value="500"/>
</xs:restriction>
</xs:simpleType>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment