<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="../schema2xhtml.xsl" type="text/xsl"?>

<!-- $Id: sensors-2-9-6.xsd 23230 2013-04-15 16:57:44Z kevin-dickerson $ -->

<!-- This schema is part of JMRI. Copyright 2009.                           -->
<!--                                                                        -->
<!-- JMRI is free software; you can redistribute it and/or modify it under  -->
<!-- the terms of version 2 of the GNU General Public License as published  -->
<!-- by the Free Software Foundation. See the "COPYING" file for a copy     -->
<!-- of this license.                                                       -->
<!--                                                                        -->
<!-- JMRI is distributed in the hope that it will be useful, but WITHOUT    -->
<!-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or  -->
<!-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License  -->
<!-- for more details.                                                      -->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:docbook="http://docbook.org/ns/docbook"
           xmlns:jmri="http://jmri.org/xml/schema/JMRIschema"
           xsi:schemaLocation="
                http://jmri.org/xml/schema/JMRIschema http://jmri.org/xml/schema/JMRIschema.xsd
                http://docbook.org/ns/docbook http://jmri.org/xml/schema/docbook/DocBook.xsd
            "
        >
    <xs:complexType name="SensorManagerType">
      <xs:annotation>
        <xs:documentation>
          Define the XML stucture for storing the contents of a SensorManager implementation.
        </xs:documentation>
        <xs:appinfo>
            <jmri:usingclass configurexml="true">jmri.managers.configurexml.AbstractSensorManagerConfigXML</jmri:usingclass>
        </xs:appinfo>
      </xs:annotation>
      <xs:sequence>
        <xs:element name="defaultInitialState" minOccurs="0" maxOccurs="1">
          <xs:simpleType>
            <xs:restriction base="xs:token">
              <xs:enumeration value="inactive"/>
              <xs:enumeration value="active"/>
              <xs:enumeration value="unknown"/>
              <xs:enumeration value="inconsistent"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:element>
        <xs:element name="globalDebounceTimers" minOccurs="0" maxOccurs="1">
          <xs:complexType>
          <xs:sequence>
            <xs:element name="goingActive" minOccurs="1" maxOccurs="1" />
            <xs:element name="goingInActive" minOccurs="1" maxOccurs="1" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="sensor" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:all>
              <xs:element name="systemName" type="systemNameType" minOccurs="1" maxOccurs="1"/>
              <xs:element name="userName" type="userNameType" minOccurs="0" maxOccurs="1"/>
              <xs:element name="comment" type="commentType" minOccurs="0" maxOccurs="1" />
              <xs:element name="useGlobalDebounceTimer" type="yesNoType" minOccurs="0" maxOccurs="1" />
              <xs:element name="debounceTimers" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="goingActive" minOccurs="1" maxOccurs="1" />
                    <xs:element name="goingInActive" minOccurs="1" maxOccurs="1" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:all>
            <xs:attribute name="systemName" type="systemNameType">
                <xs:annotation><xs:documentation>Deprecated 2.9.6 in favor of separate element</xs:documentation></xs:annotation>
            </xs:attribute>
            <xs:attribute name="userName" type="userNameType">
                <xs:annotation><xs:documentation>Deprecated 2.9.6 in favor of separate element</xs:documentation></xs:annotation>
            </xs:attribute>
            <xs:attribute name="inverted" type="xs:boolean" default="false" />
          </xs:complexType>
        </xs:element>
            
      </xs:sequence>
      <xs:attribute name="class" type="classType" use="required"/>
    </xs:complexType>

</xs:schema>
