Skip to content
Snippets Groups Projects
application.xsd 2.35 KiB
Newer Older
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="https://github.com/ChimeraTK/ApplicationCore"
            xmlns="https://github.com/ChimeraTK/ApplicationCore"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

  <xsd:annotation>
    <xsd:documentation xml:lang="en">
     Application variable description schema for ChimeraTK ApplicationCore. XML files produced by Application::generateXML() validate against this schema.
  <xsd:element name="application" type="DirectoryType"/>
      <xsd:choice minOccurs="0" maxOccurs="unbounded">
        <xsd:element name="directory" type="DirectoryType"/>
        <xsd:element name="variable" type="VariableType"/>
      </xsd:choice>
    </xsd:sequence>
    <xsd:attribute name="name" type="xsd:string" use="required"/>
  </xsd:complexType>

  <xsd:complexType name="VariableType">
    <xsd:sequence>
      <xsd:element name="value_type" type="ValueType" minOccurs="1" maxOccurs="1"/>
      <xsd:element name="direction" type="DirectionType" minOccurs="1" maxOccurs="1"/>
      <xsd:element name="unit" type="xsd:string" minOccurs="1" maxOccurs="1"/>
      <xsd:element name="description" type="xsd:string" minOccurs="1" maxOccurs="1"/>
      <xsd:element name="numberOfElements" type="xsd:integer" minOccurs="1" maxOccurs="1"/>
    </xsd:sequence>
    <xsd:attribute name="name" type="xsd:string" use="required"/>
  </xsd:complexType>

  <xsd:simpleType name="ValueType">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="int8"/>
      <xsd:enumeration value="uint8"/>
      <xsd:enumeration value="int16"/>
      <xsd:enumeration value="uint16"/>
      <xsd:enumeration value="int32"/>
      <xsd:enumeration value="uint32"/>
      <xsd:enumeration value="int64"/>
      <xsd:enumeration value="uint64"/>
      <xsd:enumeration value="float"/>
      <xsd:enumeration value="double"/>
      <xsd:enumeration value="string"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="DirectionType">
    <xsd:restriction base="xsd:string">
      <xsd:enumeration value="control_system_to_application"/>
      <xsd:enumeration value="application_to_control_system"/>
    </xsd:restriction>
  </xsd:simpleType>

</xsd:schema>