reworked xml stuff
This commit is contained in:
parent
ed1f10efe1
commit
7402015920
23
config.xml
23
config.xml
@ -2,23 +2,22 @@
|
|||||||
<DeviceList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<DeviceList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:noNamespaceSchemaLocation="config.xsd">
|
xsi:noNamespaceSchemaLocation="config.xsd">
|
||||||
<Device name="example">
|
<Device name="example">
|
||||||
<Value type="boolean"/>
|
<ValueInfo type="boolean"/>
|
||||||
<Protocol type="DI">
|
<Port protocol="DI">
|
||||||
<Port>
|
|
||||||
<Pin>GPIO_2</Pin>
|
<Pin>GPIO_2</Pin>
|
||||||
</Port>
|
</Port>
|
||||||
</Protocol>
|
|
||||||
</Device>
|
</Device>
|
||||||
<Device name="example2">
|
<Device name="sensorarray">
|
||||||
<Value type="int" unit="°C">
|
<ValueInfo type="int" unit="°C">
|
||||||
<Conversion type="Offset" value="1.2" />
|
<Offset>1.2</Offset>
|
||||||
<Conversion type="Factor" value="2.5" />
|
<Factor>2.5</Factor>
|
||||||
</Value>
|
</ValueInfo>
|
||||||
<Protocol type="AI">
|
<Port protocol="DI">
|
||||||
<Port>
|
|
||||||
<Pin>GPIO_3</Pin>
|
<Pin>GPIO_3</Pin>
|
||||||
|
<Pin>GPIO_4</Pin>
|
||||||
|
<Pin>GPIO_5</Pin>
|
||||||
|
<Pin>GPIO_6</Pin>
|
||||||
</Port>
|
</Port>
|
||||||
</Protocol>
|
|
||||||
</Device>
|
</Device>
|
||||||
|
|
||||||
</DeviceList>
|
</DeviceList>
|
47
config.xsd
47
config.xsd
@ -20,13 +20,6 @@
|
|||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
|
|
||||||
<!-- available conversion types -->
|
|
||||||
<xs:simpleType name="ConversionType">
|
|
||||||
<xs:restriction base="xs:string">
|
|
||||||
<xs:enumeration value="Factor"/>
|
|
||||||
<xs:enumeration value="Offset"/>
|
|
||||||
</xs:restriction>
|
|
||||||
</xs:simpleType>
|
|
||||||
|
|
||||||
<!-- available Pins -->
|
<!-- available Pins -->
|
||||||
<xs:simpleType name="Pin">
|
<xs:simpleType name="Pin">
|
||||||
@ -81,10 +74,10 @@
|
|||||||
<xs:element name="Device">
|
<xs:element name="Device">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element ref="Value"
|
<xs:element ref="ValueInfo"
|
||||||
minOccurs="1"
|
minOccurs="1"
|
||||||
maxOccurs="1"/>
|
maxOccurs="1"/>
|
||||||
<xs:element ref="Protocol"
|
<xs:element ref="Port"
|
||||||
minOccurs="1"
|
minOccurs="1"
|
||||||
maxOccurs="1"/>
|
maxOccurs="1"/>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
@ -94,25 +87,17 @@
|
|||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|
||||||
<xs:element name="Protocol">
|
<xs:element name="ValueInfo">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
<xs:element ref="Port"
|
<xs:element name="Offset"
|
||||||
minOccurs="1"
|
type="xs:float"
|
||||||
maxOccurs="1"/>
|
|
||||||
</xs:sequence>
|
|
||||||
<xs:attribute name="type"
|
|
||||||
type="ProtocolType"
|
|
||||||
use="required"/>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
|
|
||||||
<xs:element name="Value">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:sequence>
|
|
||||||
<xs:element ref="Conversion"
|
|
||||||
minOccurs="0"
|
minOccurs="0"
|
||||||
maxOccurs="unbounded"/>
|
maxOccurs="1"/>
|
||||||
|
<xs:element name="Factor"
|
||||||
|
type="xs:float"
|
||||||
|
minOccurs="0"
|
||||||
|
maxOccurs="1"/>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
<xs:attribute name="type"
|
<xs:attribute name="type"
|
||||||
type="ValueType"
|
type="ValueType"
|
||||||
@ -123,17 +108,6 @@
|
|||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|
||||||
<xs:element name="Conversion">
|
|
||||||
<xs:complexType>
|
|
||||||
<xs:attribute name="type"
|
|
||||||
type="ConversionType"
|
|
||||||
use="required"/>
|
|
||||||
<xs:attribute name="value"
|
|
||||||
type="xs:float"
|
|
||||||
use="required"/>
|
|
||||||
</xs:complexType>
|
|
||||||
</xs:element>
|
|
||||||
|
|
||||||
<xs:element name="Port">
|
<xs:element name="Port">
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:sequence>
|
<xs:sequence>
|
||||||
@ -142,6 +116,7 @@
|
|||||||
minOccurs="1"
|
minOccurs="1"
|
||||||
maxOccurs="unbounded"/>
|
maxOccurs="unbounded"/>
|
||||||
</xs:sequence>
|
</xs:sequence>
|
||||||
|
<xs:attribute name="protocol" type="ProtocolType" use="required"/>
|
||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
</xs:schema>
|
</xs:schema>
|
Loading…
x
Reference in New Issue
Block a user