From 0533e668d8f17fcd2f4a2634ae4fd4cd300494b0 Mon Sep 17 00:00:00 2001 From: ankraft <an.kraft@googlemail.com> Date: Fri, 16 Oct 2015 14:06:58 +0200 Subject: [PATCH] Added another constraint example --- SDT/schema3.0/etc/domain.rnc | 12 +++---- SDT/schema3.0/src/domain.rng | 12 +++---- SDT/schema3.0/src/domain.xsd | 12 +++---- SDT/schema3.0/test/dal-eg.xml | 12 +++---- SDT/schema3.0/test/mseeb.xml | 67 ++++++++++++++++++----------------- 5 files changed, 59 insertions(+), 56 deletions(-) diff --git a/SDT/schema3.0/etc/domain.rnc b/SDT/schema3.0/etc/domain.rnc index 958b9a4..e3f4061 100644 --- a/SDT/schema3.0/etc/domain.rnc +++ b/SDT/schema3.0/etc/domain.rnc @@ -12,22 +12,22 @@ Domain = element Device { attribute id { xsd:Name }, DocDef, - CharacteristicsDef?, + PropertiesDef?, Modules?, element SubDevices { element SubDevice { attribute id { xsd:Name }, DocDef, - CharacteristicsDef?, + PropertiesDef?, Modules? }+ }? }+ }? } -CharacteristicsDef = - element Characteristics { - element Characteristic { +PropertiesDef = + element Properties { + element Property { attribute name { text }, attribute optional { xsd:boolean }?, attribute value { text }?, @@ -94,7 +94,7 @@ ModuleDef = attribute class { text } }?, DocDef, - CharacteristicsDef?, + PropertiesDef?, Actions?, Data?, Events? diff --git a/SDT/schema3.0/src/domain.rng b/SDT/schema3.0/src/domain.rng index c6630d1..9601c6c 100644 --- a/SDT/schema3.0/src/domain.rng +++ b/SDT/schema3.0/src/domain.rng @@ -43,7 +43,7 @@ </attribute> <ref name="DocDef"/> <optional> - <ref name="CharacteristicsDef"/> + <ref name="PropertiesDef"/> </optional> <optional> <ref name="Modules"/> @@ -57,7 +57,7 @@ </attribute> <ref name="DocDef"/> <optional> - <ref name="CharacteristicsDef"/> + <ref name="PropertiesDef"/> </optional> <optional> <ref name="Modules"/> @@ -74,10 +74,10 @@ </define> - <define name="CharacteristicsDef"> - <element name="Characteristics"> + <define name="PropertiesDef"> + <element name="Properties"> <oneOrMore> - <element name="Characteristic"> + <element name="Property"> <attribute name="name"> <text/> </attribute> @@ -252,7 +252,7 @@ </optional> <ref name="DocDef"/> <optional> - <ref name="CharacteristicsDef"/> + <ref name="PropertiesDef"/> </optional> <optional> <ref name="Actions"/> diff --git a/SDT/schema3.0/src/domain.xsd b/SDT/schema3.0/src/domain.xsd index fcb7f93..3776e88 100644 --- a/SDT/schema3.0/src/domain.xsd +++ b/SDT/schema3.0/src/domain.xsd @@ -42,7 +42,7 @@ <xs:complexType> <xs:sequence> <xs:group ref="DocDef"/> - <xs:element minOccurs="0" ref="Characteristics"/> + <xs:element minOccurs="0" ref="Properties"/> <xs:element minOccurs="0" ref="Modules"/> <xs:element minOccurs="0" ref="SubDevices"/> </xs:sequence> @@ -60,20 +60,20 @@ <xs:complexType> <xs:sequence> <xs:group ref="DocDef"/> - <xs:element minOccurs="0" ref="Characteristics"/> + <xs:element minOccurs="0" ref="Properties"/> <xs:element minOccurs="0" ref="Modules"/> </xs:sequence> <xs:attribute name="id" use="required" type="xs:Name"/> </xs:complexType> </xs:element> - <xs:element name="Characteristics"> + <xs:element name="Properties"> <xs:complexType> <xs:sequence> - <xs:element maxOccurs="unbounded" ref="Characteristic"/> + <xs:element maxOccurs="unbounded" ref="Property"/> </xs:sequence> </xs:complexType> </xs:element> - <xs:element name="Characteristic"> + <xs:element name="Property"> <xs:complexType> <xs:sequence> <xs:group ref="DocDef"/> @@ -196,7 +196,7 @@ <xs:sequence> <xs:element minOccurs="0" ref="extends"/> <xs:group ref="DocDef"/> - <xs:element minOccurs="0" ref="Characteristics"/> + <xs:element minOccurs="0" ref="Properties"/> <xs:element minOccurs="0" ref="Actions"/> <xs:element minOccurs="0" ref="Data"/> <xs:element minOccurs="0" ref="Events"/> diff --git a/SDT/schema3.0/test/dal-eg.xml b/SDT/schema3.0/test/dal-eg.xml index 8c32446..60a5b87 100644 --- a/SDT/schema3.0/test/dal-eg.xml +++ b/SDT/schema3.0/test/dal-eg.xml @@ -19,18 +19,18 @@ <tt>on</tt> and <tt>off</tt>. This is clearly a candidate for the module class <tt>BooleanState</tt>. </Doc> - <Characteristics> - <Characteristic name="Name"> + <Properties> + <Property name="Name"> <Doc>Original value: PowerSwitch</Doc> <SimpleType type="string" /> - </Characteristic> + </Property> <!-- The Vendor field should probably be part of the domain --> - <Characteristic name="Vendor"> + <Property name="Vendor"> <Doc>Original value: Telekom Innovation Laboratories</Doc> <SimpleType type="string" /> - </Characteristic> - </Characteristics> + </Property> + </Properties> <Modules> <Module name="proprietaryPower"> diff --git a/SDT/schema3.0/test/mseeb.xml b/SDT/schema3.0/test/mseeb.xml index c92aade..04dacf7 100644 --- a/SDT/schema3.0/test/mseeb.xml +++ b/SDT/schema3.0/test/mseeb.xml @@ -125,28 +125,28 @@ <Doc> This device is intended as a demonstration of how to define a Root Device with multiple sub-devices. </Doc> - <Characteristics> - <Characteristic name="Name"> + <Properties> + <Property name="Name"> <Doc>Original value: Multi Socket Electrical-Extension-Block</Doc> <SimpleType type="string" /> - </Characteristic> - <Characteristic name="Vendor"> + </Property> + <Property name="Vendor"> <Doc>Original value: HGI</Doc> <SimpleType type="string" /> - </Characteristic> - <Characteristic name="FirmwareVersion"> + </Property> + <Property name="FirmwareVersion"> <Doc>Original value: 1.0</Doc> <SimpleType type="string" /> - </Characteristic> - <Characteristic name="VendorURL"> + </Property> + <Property name="VendorURL"> <Doc>Original value: http://www.homegatewayinitative.org</Doc> <SimpleType type="uri" /> - </Characteristic> - <Characteristic name="SerialNumber"> + </Property> + <Property name="SerialNumber"> <Doc>Original value: 1234.5</Doc> <SimpleType type="string" /> - </Characteristic> - </Characteristics> + </Property> + </Properties> <!-- These are the modules for the device: - Switch on/off all contained switches. It inherits from hgi.dal.core.BooleanState. @@ -160,12 +160,12 @@ The proprietry interface for turning all switches of the extension block on and off. The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false". </Doc> - <Characteristics> - <Characteristic name="version" value="1.0.0"> + <Properties> + <Property name="version" value="1.0.0"> <Doc>Version for this ModuleClass</Doc> <SimpleType type="string" /> - </Characteristic> - </Characteristics> + </Property> + </Properties> </Module> <Module name="power"> <Actions> @@ -182,6 +182,9 @@ <Constraint name="minValue" type="float" value="0.0"> <Doc>The value must be equal or greater 0.0</Doc> </Constraint> + <Constraint name="step" type="float" value="0.1"> + <Doc>Steps are 0.1</Doc> + </Constraint> </Constraints> </DataType> </Array> @@ -252,14 +255,14 @@ <Doc> This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain. </Doc> - <Characteristics> - <Characteristic name="Name" value="PowerSwitch 1"> + <Properties> + <Property name="Name" value="PowerSwitch 1"> <SimpleType type="string" /> - </Characteristic> - <Characteristic name="Vendor" value="HGI"> + </Property> + <Property name="Vendor" value="HGI"> <SimpleType type="string" /> - </Characteristic> - </Characteristics> + </Property> + </Properties> <Modules> <Module name="power"> <extends domain="hgi.dal.core" class="BooleanState"/> @@ -273,20 +276,20 @@ <Doc> This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain. </Doc> - <Characteristics> - <Characteristic name="Name" value="PowerSwitch 2"> + <Properties> + <Property name="Name" value="PowerSwitch 2"> <SimpleType type="string" /> - </Characteristic> - <Characteristic name="Vendor" value="HGI"> + </Property> + <Property name="Vendor" value="HGI"> <SimpleType type="string" /> - </Characteristic> - <Characteristic name="VendorURL" value="http://homegatwaysinitiative.org"> + </Property> + <Property name="VendorURL" value="http://homegatwaysinitiative.org"> <SimpleType type="uri" /> - </Characteristic> - <Characteristic name="maximumAltitude" value="2800"> + </Property> + <Property name="maximumAltitude" value="2800"> <SimpleType type="integer" /> - </Characteristic> - </Characteristics> + </Property> + </Properties> <Modules> <Module name="power"> <extends domain="hgi.dal.core" class="BooleanState"/> -- GitLab