Commit 0533e668d8f17fcd2f4a2634ae4fd4cd300494b0

Authored by ankraft
1 parent bcbcaab4

Added another constraint example

... ... @@ -12,22 +12,22 @@ Domain =
12 12 element Device {
13 13 attribute id { xsd:Name },
14 14 DocDef,
15   - CharacteristicsDef?,
  15 + PropertiesDef?,
16 16 Modules?,
17 17 element SubDevices {
18 18 element SubDevice {
19 19 attribute id { xsd:Name },
20 20 DocDef,
21   - CharacteristicsDef?,
  21 + PropertiesDef?,
22 22 Modules?
23 23 }+
24 24 }?
25 25 }+
26 26 }?
27 27 }
28   -CharacteristicsDef =
29   - element Characteristics {
30   - element Characteristic {
  28 +PropertiesDef =
  29 + element Properties {
  30 + element Property {
31 31 attribute name { text },
32 32 attribute optional { xsd:boolean }?,
33 33 attribute value { text }?,
... ... @@ -94,7 +94,7 @@ ModuleDef =
94 94 attribute class { text }
95 95 }?,
96 96 DocDef,
97   - CharacteristicsDef?,
  97 + PropertiesDef?,
98 98 Actions?,
99 99 Data?,
100 100 Events?
... ...
... ... @@ -43,7 +43,7 @@
43 43 </attribute>
44 44 <ref name="DocDef"/>
45 45 <optional>
46   - <ref name="CharacteristicsDef"/>
  46 + <ref name="PropertiesDef"/>
47 47 </optional>
48 48 <optional>
49 49 <ref name="Modules"/>
... ... @@ -57,7 +57,7 @@
57 57 </attribute>
58 58 <ref name="DocDef"/>
59 59 <optional>
60   - <ref name="CharacteristicsDef"/>
  60 + <ref name="PropertiesDef"/>
61 61 </optional>
62 62 <optional>
63 63 <ref name="Modules"/>
... ... @@ -74,10 +74,10 @@
74 74 </define>
75 75  
76 76  
77   - <define name="CharacteristicsDef">
78   - <element name="Characteristics">
  77 + <define name="PropertiesDef">
  78 + <element name="Properties">
79 79 <oneOrMore>
80   - <element name="Characteristic">
  80 + <element name="Property">
81 81 <attribute name="name">
82 82 <text/>
83 83 </attribute>
... ... @@ -252,7 +252,7 @@
252 252 </optional>
253 253 <ref name="DocDef"/>
254 254 <optional>
255   - <ref name="CharacteristicsDef"/>
  255 + <ref name="PropertiesDef"/>
256 256 </optional>
257 257 <optional>
258 258 <ref name="Actions"/>
... ...
... ... @@ -42,7 +42,7 @@
42 42 <xs:complexType>
43 43 <xs:sequence>
44 44 <xs:group ref="DocDef"/>
45   - <xs:element minOccurs="0" ref="Characteristics"/>
  45 + <xs:element minOccurs="0" ref="Properties"/>
46 46 <xs:element minOccurs="0" ref="Modules"/>
47 47 <xs:element minOccurs="0" ref="SubDevices"/>
48 48 </xs:sequence>
... ... @@ -60,20 +60,20 @@
60 60 <xs:complexType>
61 61 <xs:sequence>
62 62 <xs:group ref="DocDef"/>
63   - <xs:element minOccurs="0" ref="Characteristics"/>
  63 + <xs:element minOccurs="0" ref="Properties"/>
64 64 <xs:element minOccurs="0" ref="Modules"/>
65 65 </xs:sequence>
66 66 <xs:attribute name="id" use="required" type="xs:Name"/>
67 67 </xs:complexType>
68 68 </xs:element>
69   - <xs:element name="Characteristics">
  69 + <xs:element name="Properties">
70 70 <xs:complexType>
71 71 <xs:sequence>
72   - <xs:element maxOccurs="unbounded" ref="Characteristic"/>
  72 + <xs:element maxOccurs="unbounded" ref="Property"/>
73 73 </xs:sequence>
74 74 </xs:complexType>
75 75 </xs:element>
76   - <xs:element name="Characteristic">
  76 + <xs:element name="Property">
77 77 <xs:complexType>
78 78 <xs:sequence>
79 79 <xs:group ref="DocDef"/>
... ... @@ -196,7 +196,7 @@
196 196 <xs:sequence>
197 197 <xs:element minOccurs="0" ref="extends"/>
198 198 <xs:group ref="DocDef"/>
199   - <xs:element minOccurs="0" ref="Characteristics"/>
  199 + <xs:element minOccurs="0" ref="Properties"/>
200 200 <xs:element minOccurs="0" ref="Actions"/>
201 201 <xs:element minOccurs="0" ref="Data"/>
202 202 <xs:element minOccurs="0" ref="Events"/>
... ...
... ... @@ -19,18 +19,18 @@
19 19 <tt>on</tt> and <tt>off</tt>. This is clearly a candidate for the
20 20 module class <tt>BooleanState</tt>.
21 21 </Doc>
22   - <Characteristics>
23   - <Characteristic name="Name">
  22 + <Properties>
  23 + <Property name="Name">
24 24 <Doc>Original value: PowerSwitch</Doc>
25 25 <SimpleType type="string" />
26   - </Characteristic>
  26 + </Property>
27 27  
28 28 <!-- The Vendor field should probably be part of the domain -->
29   - <Characteristic name="Vendor">
  29 + <Property name="Vendor">
30 30 <Doc>Original value: Telekom Innovation Laboratories</Doc>
31 31 <SimpleType type="string" />
32   - </Characteristic>
33   - </Characteristics>
  32 + </Property>
  33 + </Properties>
34 34  
35 35 <Modules>
36 36 <Module name="proprietaryPower">
... ...
... ... @@ -125,28 +125,28 @@
125 125 <Doc>
126 126 This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
127 127 </Doc>
128   - <Characteristics>
129   - <Characteristic name="Name">
  128 + <Properties>
  129 + <Property name="Name">
130 130 <Doc>Original value: Multi Socket Electrical-Extension-Block</Doc>
131 131 <SimpleType type="string" />
132   - </Characteristic>
133   - <Characteristic name="Vendor">
  132 + </Property>
  133 + <Property name="Vendor">
134 134 <Doc>Original value: HGI</Doc>
135 135 <SimpleType type="string" />
136   - </Characteristic>
137   - <Characteristic name="FirmwareVersion">
  136 + </Property>
  137 + <Property name="FirmwareVersion">
138 138 <Doc>Original value: 1.0</Doc>
139 139 <SimpleType type="string" />
140   - </Characteristic>
141   - <Characteristic name="VendorURL">
  140 + </Property>
  141 + <Property name="VendorURL">
142 142 <Doc>Original value: http://www.homegatewayinitative.org</Doc>
143 143 <SimpleType type="uri" />
144   - </Characteristic>
145   - <Characteristic name="SerialNumber">
  144 + </Property>
  145 + <Property name="SerialNumber">
146 146 <Doc>Original value: 1234.5</Doc>
147 147 <SimpleType type="string" />
148   - </Characteristic>
149   - </Characteristics>
  148 + </Property>
  149 + </Properties>
150 150  
151 151 <!-- These are the modules for the device:
152 152 - Switch on/off all contained switches. It inherits from hgi.dal.core.BooleanState.
... ... @@ -160,12 +160,12 @@
160 160 The proprietry interface for turning all switches of the extension block on and off.
161 161 The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false".
162 162 </Doc>
163   - <Characteristics>
164   - <Characteristic name="version" value="1.0.0">
  163 + <Properties>
  164 + <Property name="version" value="1.0.0">
165 165 <Doc>Version for this ModuleClass</Doc>
166 166 <SimpleType type="string" />
167   - </Characteristic>
168   - </Characteristics>
  167 + </Property>
  168 + </Properties>
169 169 </Module>
170 170 <Module name="power">
171 171 <Actions>
... ... @@ -182,6 +182,9 @@
182 182 <Constraint name="minValue" type="float" value="0.0">
183 183 <Doc>The value must be equal or greater 0.0</Doc>
184 184 </Constraint>
  185 + <Constraint name="step" type="float" value="0.1">
  186 + <Doc>Steps are 0.1</Doc>
  187 + </Constraint>
185 188 </Constraints>
186 189 </DataType>
187 190 </Array>
... ... @@ -252,14 +255,14 @@
252 255 <Doc>
253 256 This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
254 257 </Doc>
255   - <Characteristics>
256   - <Characteristic name="Name" value="PowerSwitch 1">
  258 + <Properties>
  259 + <Property name="Name" value="PowerSwitch 1">
257 260 <SimpleType type="string" />
258   - </Characteristic>
259   - <Characteristic name="Vendor" value="HGI">
  261 + </Property>
  262 + <Property name="Vendor" value="HGI">
260 263 <SimpleType type="string" />
261   - </Characteristic>
262   - </Characteristics>
  264 + </Property>
  265 + </Properties>
263 266 <Modules>
264 267 <Module name="power">
265 268 <extends domain="hgi.dal.core" class="BooleanState"/>
... ... @@ -273,20 +276,20 @@
273 276 <Doc>
274 277 This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
275 278 </Doc>
276   - <Characteristics>
277   - <Characteristic name="Name" value="PowerSwitch 2">
  279 + <Properties>
  280 + <Property name="Name" value="PowerSwitch 2">
278 281 <SimpleType type="string" />
279   - </Characteristic>
280   - <Characteristic name="Vendor" value="HGI">
  282 + </Property>
  283 + <Property name="Vendor" value="HGI">
281 284 <SimpleType type="string" />
282   - </Characteristic>
283   - <Characteristic name="VendorURL" value="http://homegatwaysinitiative.org">
  285 + </Property>
  286 + <Property name="VendorURL" value="http://homegatwaysinitiative.org">
284 287 <SimpleType type="uri" />
285   - </Characteristic>
286   - <Characteristic name="maximumAltitude" value="2800">
  288 + </Property>
  289 + <Property name="maximumAltitude" value="2800">
287 290 <SimpleType type="integer" />
288   - </Characteristic>
289   - </Characteristics>
  291 + </Property>
  292 + </Properties>
290 293 <Modules>
291 294 <Module name="power">
292 295 <extends domain="hgi.dal.core" class="BooleanState"/>
... ...