<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.nrc.ca/namespaces/widar" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:widar="http://www.nrc.ca/namespaces/widar" elementFormDefault="qualified">
	<xs:annotation>
		<xs:documentation> 
		File: widarCommon.xsd (XML Schema)
		Author:	Sonja.Vrcic@nrc.gc.ca
		Copyright:  National Research Council of Canada, NRC-HIA-DRAO 2008
		Description: Elements and type defintions for the WIDAR Correlator Schemata.
		Version of the protocol: DRAO Document: VCI Protocol Specification, A25201N0000, Revision 3.5, 
		target namespace has been defined for VCI schemata. Additional changes are due as result of the VCI review.
		$Date: 2010-10-04 17:35:02 -0700 (Mon, 04 Oct 2010) $
		$Revision: 4744 $
	    </xs:documentation>
	</xs:annotation>
	<xs:element name="component">
		<xs:annotation>
			<xs:documentation>
			This is an attempt to define an XML element that could be used to 
			query or report status of any h/w or s/w component.
			Element component can be generated both by the VCI client and by the correlator.
			ID and type are enough to unquely identify any WIDAR component. 
			Optionally, a name can be assigned, but VCI clinet can not use the name
			to identify component. 
			Attributes xmlTag and status are specified only by the correlator.
			If an XML element is specified for the component, 
			the message generated by the correlator 
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="id" type="xs:string" use="required"/>
			<xs:attribute name="type" type="xs:string" use="required"/>
			<xs:attribute name="xmlTag" type="xs:string" use="optional"/>
			<xs:attribute name="name" type="xs:string" use="optional"/>
			<xs:attribute name="status" type="xs:string" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="HwComponentStatusType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="off"/>
			<xs:enumeration value="sleep"/>
			<xs:enumeration value="standby"/>
			<xs:enumeration value="run"/>
			<xs:enumeration value="unknown"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SwComponentStatusType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="run"/>
			<xs:enumeration value="kill"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="DwellTimeType">
		<xs:annotation>
			<xs:documentation> 
				Duration of dwell in seconds (for rollover and fast swtiching)
				For rollover 0 means no rollover
				For fast switching 0 means no fast switching. 
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="360"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="LogLevelType">
		<xs:annotation>
			<xs:documentation> 
			Priority level for logs and alarms. 
			Also used to specify required logging level.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:NMTOKEN">
			<xs:enumeration value="TRACE"/>
			<xs:enumeration value="DEBUG"/>
			<xs:enumeration value="INFO"/>
			<xs:enumeration value="NOTICE"/>
			<xs:enumeration value="WARNING"/>
			<xs:enumeration value="ERROR"/>
			<xs:enumeration value="CRITICAL"/>
			<xs:enumeration value="ALERT"/>
			<xs:enumeration value="EMERGENCY"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="LogDescriptorType">
		<xs:annotation>
			<xs:documentation>
			Log descriptor for logs and alarms. Log descriptor is used by the ALMA Common Software. 
			It is to be defined whether EVLA will use this. 
			"Instant" is used for events where concept of "termination" does not apply, i.e. when an alarm is raised the
			device/subsystem does not enter an "alarm" state.  Active and terminate are used for events where it is
			 meaninful to indicate beginning and end of an "alarm" state. Change is used to indicate a change for the
			 resource (device or subsystem) where an alarm is already active. For example,  may be used to report 
			 a change of temperature of the already overheated device.
			  </xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:NMTOKEN">
			<xs:enumeration value="INSTANT"/>
			<xs:enumeration value="ACTIVE"/>
			<xs:enumeration value="TERMINATE"/>
			<xs:enumeration value="CHANGE"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name="originator">
		<xs:annotation>
			<xs:documentation>  
				Originator of the vciLog. 
			       Depending on the type of event,  name of the class, method and/or thread may be provided.
			 </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="componentType" type="xs:string" use="required"/>
			<xs:attribute name="componentID" type="xs:string" use="required"/>
			<xs:attribute name="class" type="xs:string" use="optional"/>
			<xs:attribute name="method" type="xs:string" use="optional"/>
			<xs:attribute name="thread" type="xs:string" use="optional"/>
			<xs:attribute name="logger" type="xs:string" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="affectedComponent">
		<xs:annotation>
			<xs:documentation>
			      The component which is the source of the event or which is affected by the event. 
			      For example,  if a crash is being reported : the component that crashed.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="componentType" type="xs:string" use="required"/>
			<xs:attribute name="componentID" type="xs:string" use="required"/>
			<xs:attribute name="class" type="xs:string" use="optional"/>
			<xs:attribute name="method" type="xs:string" use="optional"/>
			<xs:attribute name="thread" type="xs:string" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="trowable">
		<xs:annotation>
			<xs:documentation>Used to log Java exceptions (object trowable).</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="type" type="xs:string"/>
				<xs:element name="message" type="xs:string"/>
				<xs:element name="stackTrace" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element ref="widar:trowable" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="HostType">
		<xs:annotation>
			<xs:documentation> 
			WIDAR host type. Host is a physical device. (As opposed to subsystem which refers to
			a software entity. More than one s/w subsystem may be running on the same host computer.)
			 </xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:NMTOKEN">
			<xs:enumeration value="MCCC"/>
			<xs:enumeration value="StationBoard"/>
			<xs:enumeration value="BaselineBoard"/>
			<xs:enumeration value="Backend"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name="widarHost">
		<xs:annotation>
			<xs:documentation>
			 Set of parameters that unequely define a WIDAR host computer (physical device). 
			 Obviously, IP address can be used to uniqely define a computer system,  while type and instance are 
			 more sutiable as information to be stored for future reference.
			 </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="type" type="widar:HostType" use="required"/>
			<xs:attribute name="instance" type="xs:string" use="optional"/>
			<xs:attribute name="destIP4address" type="widar:IP4AddressType" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="MsgCommentType">
		<xs:annotation>
			<xs:documentation>
			Decription used in log / alarm messages.
			</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element name="description" type="xs:string" maxOccurs="unbounded"/>
			<xs:element ref="widar:property" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="level" type="widar:LogLevelType" use="required"/>
		<xs:attribute name="code" type="xs:string" use="optional"/>
	</xs:complexType>
	<xs:element name="property">
		<xs:annotation>
			<xs:documentation>
			Used to report  status of the parameters which are not defined in the WIDAR XML Schema.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="name" type="xs:string" use="required"/>
			<xs:attribute name="value" type="xs:string" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="AntennaType">
		<xs:annotation>
			<xs:documentation>
			Antenna Type. More types will be added.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="EVLA"/>
			<xs:enumeration value="TestPatternGenerator"/>
			<xs:enumeration value="DelayModuleTestVector"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="PolarizationType">
		<xs:annotation>
			<xs:documentation>
			Baseband polarization.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:enumeration value="R"/>
			<xs:enumeration value="L"/>
			<xs:enumeration value="X"/>
			<xs:enumeration value="Y"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="BitsForInitialQuantizationType">
		<xs:annotation>
			<xs:documentation>
			Number of bits per sample for 
			inital quantization (Station Board input) </xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:enumeration value="1"/>
			<xs:enumeration value="2"/>
			<xs:enumeration value="3"/>
			<xs:enumeration value="4"/>
			<xs:enumeration value="5"/>
			<xs:enumeration value="6"/>
			<xs:enumeration value="7"/>
			<xs:enumeration value="8"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="BitsForReQuantizationType">
		<xs:annotation>
			<xs:documentation>
			Number of bits for Station Board re-quantizer.
			Also correlation mode defined as the number of bits to correlate.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:enumeration value="4"/>
			<xs:enumeration value="7"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="StbSourceType">
		<xs:annotation>
			<xs:documentation>
			Source of the Station Board Input Data Stream.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:enumeration value="FORM"/>
			<xs:enumeration value="DelayModuleTestVector"/>
			<xs:enumeration value="TestPatternGenerator"/>
			<xs:enumeration value="VSI"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SignalToNoiseType">
		<xs:annotation>
			<xs:documentation>
			Signal to noise ratio (percent of signal in the input data) for the Station Board Filter FPGA. 
			Alternatively could be specified as a set of five scaling factors (one for each stage plus quantizer scaling factor).
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="100"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="BaseBandBwType">
		<xs:annotation>
			<xs:documentation>
			Station Board  input band width.
			TBD : specified in basic units (Herz) or in MHz and KHz (second set)
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:NMTOKEN">
			<xs:enumeration value="2048000000"/>
			<xs:enumeration value="1024000000"/>
			<xs:enumeration value="512000000"/>
			<xs:enumeration value="256000000"/>
			<xs:enumeration value="128000000"/>
			<xs:enumeration value="64000000"/>
			<xs:enumeration value="32000000"/>
			<xs:enumeration value="16000000"/>
			<xs:enumeration value="8000000"/>
			<xs:enumeration value="4000000"/>
			<xs:enumeration value="2000000"/>
			<xs:enumeration value="1000000"/>
			<xs:enumeration value="500000"/>
			<xs:enumeration value="250000"/>
			<xs:enumeration value="125000"/>
			<xs:enumeration value="62500"/>
			<xs:enumeration value="31250"/>
			<xs:enumeration value="2048MHz"/>
			<xs:enumeration value="1024MHz"/>
			<xs:enumeration value="512MHz"/>
			<xs:enumeration value="256MHz"/>
			<xs:enumeration value="128MHz"/>
			<xs:enumeration value="64MHz"/>
			<xs:enumeration value="32MHz"/>
			<xs:enumeration value="16MHz"/>
			<xs:enumeration value="8MHz"/>
			<xs:enumeration value="4MHz"/>
			<xs:enumeration value="2MHz"/>
			<xs:enumeration value="1MHz"/>
			<xs:enumeration value="500KHz"/>
			<xs:enumeration value="250KHz"/>
			<xs:enumeration value="125KHz"/>
			<xs:enumeration value="62500Hz"/>
			<xs:enumeration value="31250Hz"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SbBwType">
		<xs:annotation>
			<xs:documentation>
			Station Board Filter output  band width.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:NMTOKEN">
			<xs:enumeration value="128000000"/>
			<xs:enumeration value="64000000"/>
			<xs:enumeration value="32000000"/>
			<xs:enumeration value="16000000"/>
			<xs:enumeration value="8000000"/>
			<xs:enumeration value="4000000"/>
			<xs:enumeration value="2000000"/>
			<xs:enumeration value="1000000"/>
			<xs:enumeration value="500000"/>
			<xs:enumeration value="250000"/>
			<xs:enumeration value="125000"/>
			<xs:enumeration value="62500"/>
			<xs:enumeration value="31250"/>
			<xs:enumeration value="128MHz"/>
			<xs:enumeration value="64MHz"/>
			<xs:enumeration value="32MHz"/>
			<xs:enumeration value="16MHz"/>
			<xs:enumeration value="8MHz"/>
			<xs:enumeration value="4MHz"/>
			<xs:enumeration value="2MHz"/>
			<xs:enumeration value="1MHz"/>
			<xs:enumeration value="500KHz"/>
			<xs:enumeration value="250KHz"/>
			<xs:enumeration value="125KHz"/>
			<xs:enumeration value="62500Hz"/>
			<xs:enumeration value="31250Hz"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SpectChannelsType">
		<xs:annotation>
			<xs:documentation>
			Number of spectral channels per product (for "narrow band" correlation on the Baseline Board).
			Must be multiple of 64, i.e. 64*n, n=1,2,3,etc.
			 </xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="64"/>
			<xs:maxInclusive value="262144"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="RecirculationFactorType">
		<xs:annotation>
			<xs:documentation>
			Recirculation factor.  
			Recirculation factor = 1 means NO recirculation. 
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="256"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="MinHwIntTimeType">
		<xs:annotation>
			<xs:documentation>
			Minimum Hadrware Integration Time in micro seconds.
			Used by the Station Board to generate DUMPTRIG.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:double">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="500.0"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="IntegrationFactorType">
		<xs:annotation>
			<xs:documentation>
			Integration Factor. Specifies how many times the same lag or measurement  should be added before
			off-loading the integrated value. On the Station Board integration is performed by software  to reduce the
			amount of output data and traffic generated by the Station Board. On the Baseline Board integration is 
			performed in hardware (polarization product lags, pulsar binning).
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="10"/>
			<xs:maxInclusive value="1000"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="NumBinsType">
		<xs:annotation>
			<xs:documentation>
			Number of bins for pulsar binning. If zero, pulsar binning is not required.
			There are two banks, each has 2000 bins.
			If up to 2000 bins are used, the correlator alternates between two banks: 
			While transmitting the conent of one bank, integration is performed in the other, i.e. there is no data loss.
			If more than 2000 bins are specified, integration can not be performed while data is being off-loaded (transmitted). 
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="4000"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="GateWidthType">
		<xs:annotation>
			<xs:documentation>
			Pulsar gate width expressed in fractions of cycle.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="100"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="PhasedArraySampleType">
		<xs:annotation>
			<xs:documentation>
			Number of bits per sample for phased array
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:enumeration value="1"/>
			<xs:enumeration value="2"/>
			<xs:enumeration value="3"/>
			<xs:enumeration value="4"/>
			<xs:enumeration value="7"/>
			<xs:enumeration value="8"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="StationIdOrAllType">
		<xs:annotation>
			<xs:documentation>
			Station ID or "all" 
			</xs:documentation>
		</xs:annotation>
		<xs:union>
			<xs:simpleType>
				<xs:restriction base="xs:int">
					<xs:minInclusive value="1"/>
					<xs:maxInclusive value="255"/>
				</xs:restriction>
			</xs:simpleType>
			<xs:simpleType>
				<xs:restriction base="xs:token">
					<xs:enumeration value="all"/>
					<xs:enumeration value="list"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:union>
	</xs:simpleType>
	<xs:simpleType name="StationRackIdType">
		<xs:annotation>
			<xs:documentation>
			Rack Identifier
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="8"/>
		</xs:restriction>
	</xs:simpleType>
		<xs:simpleType name="BaselineRackIdType">
		<xs:annotation>
			<xs:documentation>
			Rack Identifier
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="101"/>
			<xs:maxInclusive value="108"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="RackIdType">
		<xs:annotation>
			<xs:documentation>
			Rack Identifier
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="255"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="CrateIdType">
		<xs:annotation>
			<xs:documentation>
			Crate Identifier.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:enumeration value="0"/>
			<xs:enumeration value="1"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SlotIdType">
		<xs:annotation>
			<xs:documentation>
			Slot Identifier.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="7"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name="moduleLocation">
		<xs:annotation>
			<xs:documentation>
			Module Location Id as specified in the System Numbering Plan. 
			Defines the physical location of the module.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="rack" type="widar:RackIdType"/>
			<xs:attribute name="crate" type="widar:CrateIdType"/>
			<xs:attribute name="slot" type="widar:SlotIdType"/>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="MlidAsStringType" >
		<xs:annotation>
			<xs:documentation>
			MLID in format Rack-Crate-Slot
			Enumeration will be replaced by the regular expression.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="1-0-1"/>
			<xs:enumeration value="101-1-7"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="StbDataPathIdType" >
		<xs:annotation>
			<xs:documentation>
			Identifier of the "data path" on the Station Board. 
			A Station Board has two sets of 18 filters and associated devices, 
			so that two input streams (basebands) can be porcesses on a single Station Board.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:enumeration value="0"/>
			<xs:enumeration value="1"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="StationIdType">
		<xs:annotation>
			<xs:documentation>
			Station Identifier.
			The first within the set of the three identifiers that are inserted in the Station Board output data stream.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="255"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="BBIDtype">
		<xs:annotation>
			<xs:documentation>
			Baseband Identifier. 
			The second of  the three identifiers that are inserted in the Station Board Output Data Stream.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="7"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SBIDtype">
		<xs:annotation>
			<xs:documentation>
			Subband Identifier. 
			The third of the three identifiers that are inserted in the Station Board Output Data Stream.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="17"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="StbNumberOfBandsType">
		<xs:annotation>
			<xs:documentation>
			Number of bands in the Station Board Input Data Stream.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:enumeration value="1"/>
			<xs:enumeration value="2"/>
			<xs:enumeration value="4"/>
			<xs:enumeration value="8"/>
			<xs:enumeration value="16"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="StbInputBandIndexType">
		<xs:annotation>
			<xs:documentation>
			Index of the band in the Station Board Input Data Stream.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="15"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="StationXBarSwitchIdType">
		<xs:annotation>
			<xs:documentation>
			X-Bar Board Switch ID. 
			There are 8 X-Bar boards in the Station rack. 
			Each X-Bar board has 2 cross-bar switches. 
			There are 16 cross bar switches per Station rack.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="15"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="XBarWaferGroupIdType">
		<xs:annotation>
			<xs:documentation>
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="3"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="XBarWaferIdType">
		<xs:annotation>
			<xs:documentation>
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="3"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="XBarStreamIdType" >
		<xs:annotation>
			<xs:documentation>
			X-Bar board wafers consist of 3 streams:
			streams A and B carry data (output of one filter from each of the two Station Board filter banks),
			the  3rd stream is control stream. 
			Value "all" is provided for the case when all 3 streams from a X-Bar board input wafer are 
			switched to the same output wafer.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="A"/>
			<xs:enumeration value="B"/>
			<xs:enumeration value="C"/>
			<xs:enumeration value="all"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="BlbInpWaferIdType">
		<xs:annotation>
			<xs:documentation>
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="31"/>
		</xs:restriction>
	</xs:simpleType>	
	<xs:simpleType name="BlbPairIdType">
		<xs:annotation>
			<xs:documentation>
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="15"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:simpleType name="QuadIdType">
		<xs:annotation>
			<xs:documentation>
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="4"/>
		</xs:restriction>
	</xs:simpleType>
	

	
	
	<xs:simpleType name="CCQIdType">
		<xs:annotation>
			<xs:documentation>
			Correlator Chip Cell Quad Identifier
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="3"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="CCCIdType">
		<xs:annotation>
			<xs:documentation>
			Correlator Chip Cell (CCC) Identifier.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="15"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ProductIdType">
		<xs:annotation>
			<xs:documentation>
			Identifier assigned to a correlation product.  
			TBD: Do we allow VCI client to specify more than 4 products.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="32"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="CorrelationType">
		<xs:restriction base="xs:token">
			<xs:enumeration value="A*A"/>
			<xs:enumeration value="A*B"/>
			<xs:enumeration value="B*A"/>
			<xs:enumeration value="B*B"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="OnOffType">
		<xs:restriction base="xs:token">
			<xs:enumeration value="off"/>
			<xs:enumeration value="on"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="EnableDisableType">
		<xs:restriction base="xs:token">
			<xs:enumeration value="disable"/>
			<xs:enumeration value="enable"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="YesNoType">
		<xs:restriction base="xs:token">
			<xs:enumeration value="no"/>
			<xs:enumeration value="yes"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="UpperLowerType">
		<xs:restriction base="xs:token">
			<xs:enumeration value="upper"/>
			<xs:enumeration value="lower"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="EarlyLateType">
		<xs:restriction base="xs:token">
			<xs:enumeration value="early"/>
			<xs:enumeration value="late"/>
		</xs:restriction>
	</xs:simpleType>	
	<xs:simpleType name="AllowedType">
		<xs:restriction base="xs:token">
			<xs:enumeration value="notAllowed"/>
			<xs:enumeration value="allowed"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="IP4AddressType">
		<xs:annotation>
			<xs:documentation>
			IP v4 address pattern.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="(([1-9]?[0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([1-9]?[0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="IP6AddressType">
		<xs:annotation>
			<xs:documentation>
			IP v6 address pattern.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:pattern value="(([0-9]|[A-F]|[a-f]){0,4}:){7}(([0-9]|[A-F]|[a-f]){0,4})"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="NumberOfBlbPairsType">
		<xs:annotation>
			<xs:documentation> 
			Number of the Baseline Board Pairs in the Quad 
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="1"/>
			<xs:maxInclusive value="16"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="MaxMinPackType">
		<xs:annotation>
			<xs:documentation>
			Station packing algorithm and product packing algorithm.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:enumeration value="maxPack"/>
			<xs:enumeration value="minPack"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="AutoCorrAlgorithmType">
		<xs:annotation>
			<xs:documentation>
			Subset of auto-correlation products.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
		    <xs:enumeration value="halfStationsMaxProd"/>
			<xs:enumeration value="timeMuxHalfStationsMaxProd"/>
			<xs:enumeration value="timeMuxAllStationsMinProd"/>
			<xs:enumeration value="allStationsMaxProd"/>
			<xs:enumeration value="allStationsMinProd"/>
			<xs:enumeration value="crossCorrOnly"/>
			<xs:enumeration value="autoCorrOnly"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="StartFromType">
		<xs:annotation>
			<xs:documentation>
			For packing algorithm
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:enumeration value="lowestStId"/>
			<xs:enumeration value="scndLowestStId"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ABType">
		<xs:annotation>
			<xs:documentation>
			Used to identify Baseband in a pair
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:enumeration value="A"/>
			<xs:enumeration value="B"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="XYType">
		<xs:annotation>
			<xs:documentation>
			Used to identify Baseline Board Input
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:enumeration value="X"/>
			<xs:enumeration value="Y"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="ZeroOneType">
		<xs:annotation>
			<xs:documentation> 
			Used in Baseline Board Single to identify Baseline Board in a pair.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="1"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="PhArrayRqNumBitsType">
		<xs:annotation>
			<xs:documentation>
			Baseband in a pair.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:enumeration value="1"/>
			<xs:enumeration value="2"/>
			<xs:enumeration value="3"/>
			<xs:enumeration value="4"/>
			<xs:enumeration value="7"/>
			<xs:enumeration value="8"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:attributeGroup name="outputDataControl">
		<xs:annotation>
			<xs:documentation>
			 Control for the Station Board output data.
			</xs:documentation>
		</xs:annotation>
		<xs:attribute name="status" type="widar:EnableDisableType" use="required"/>
		<xs:attribute name="integFactor" type="widar:IntegrationFactorType" use="optional" default="10"/>
		<xs:attribute name="destination" type="xs:anyURI" use="optional"/>
	</xs:attributeGroup>
	<xs:element name="inputStateCounts">
		<xs:annotation>
			<xs:documentation>control input state count monitoring</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attributeGroup ref="widar:outputDataControl"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="tickIntervalCounts">
		<xs:annotation>
			<xs:documentation>control tick interval monitoring</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attributeGroup ref="widar:outputDataControl"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="clipCounts">
		<xs:annotation>
			<xs:documentation>control sampler clip monitoring</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attributeGroup ref="widar:outputDataControl"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="powerCounts">
		<xs:annotation>
			<xs:documentation>control power monitoring</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attributeGroup ref="widar:outputDataControl"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="errorCounts">
		<xs:annotation>
			<xs:documentation>error counts</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attributeGroup ref="widar:outputDataControl"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="rfiCounts">
		<xs:annotation>
			<xs:documentation>control radio frequency interference monitoring</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attributeGroup ref="widar:outputDataControl"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="outputStateCounts">
		<xs:annotation>
			<xs:documentation>control output state count monitoring</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attributeGroup ref="widar:outputDataControl"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="crcTable">
		<xs:annotation>
			<xs:documentation>control CRC status monitoring</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attributeGroup ref="widar:outputDataControl"/>
			<xs:attribute name="resetAction">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:enumeration value="autoClear"/>
						<xs:enumeration value="accumulate"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="toneExtraction">
		<xs:annotation>
			<xs:documentation>control CRC status monitoring</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attributeGroup ref="widar:outputDataControl"/>
			<xs:attribute name="numTones" type="xs:int" use="required"/>
			<xs:attribute name="dwellTime" type="xs:int" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="noiseDiode">
		<xs:annotation>
			<xs:documentation>
			Noise Diode configuration.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="status" type="widar:EnableDisableType" use="optional" default="enable"/>
			<xs:attribute name="periodMilliSec" type="widar:NsdFrequencyType" use="optional" default="9.6"/>
			<xs:attribute name="dutyCycle" type="widar:DutyCycleType" use="optional" default="50.0"/>
			<xs:attribute name="phase" type="xs:double" use="optional" default="0.0"/>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="NsdFrequencyType">
		<xs:annotation>
			<xs:documentation> 
			Used in Baseline Board Single to identify Baseline Board in a pair.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:double">
			<xs:minInclusive value="0.0"/>
			<xs:maxInclusive value="50.0"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="DutyCycleType">
		<xs:annotation>
			<xs:documentation> 
			Used in Baseline Board Single to identify Baseline Board in a pair.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:double">
			<xs:minInclusive value="0.0"/>
			<xs:maxInclusive value="100.0"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name="pulsarGating">
		<xs:annotation>
			<xs:documentation>
			Pulsar Gating. Period in milliseconds (or frequency in Hz). 
			Gate width is specified as percent of the period (when the gate is on).
			Epoch is specified as UT (or should it be the same as activation  time).
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="status" type="widar:EnableDisableType" use="optional" default="disable"/>
			<xs:attribute name="period" type="xs:double" use="required"/>
			<xs:attribute name="firstDerivative" type="xs:int" use="optional"/>
			<xs:attribute name="secondDerivative" type="xs:int" use="optional"/>
			<xs:attribute name="gateWidth" type="widar:DutyCycleType" use="optional" default="0.5"/>
			<xs:attribute name="epoch" type="xs:dateTime" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="gateModel">
		<xs:annotation>
			<xs:documentation>
			Model for pulsar gating. 
			Period in milliseconds. 
			Gate width is specified as percent of the period (when the gate is on).
			Epoch is specified as UT (or should it be the same as activation  time).
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="period" type="xs:double" use="required"/>
			<xs:attribute name="gateWidth" type="widar:DutyCycleType" use="optional" default="0.5"/>
			<xs:attribute name="epoch" type="xs:dateTime" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="modelCoeff">
		<xs:annotation>
			<xs:documentation>
				Coefficent for the gate models is the same as for delay models.
				This format will be used during the testing.
				When the full system is installed  ASCII representation may be replaced by hexBinary.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="index" type="xs:int" use="required"/>
			<xs:attribute name="cff" type="xs:double" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="wbcProductByBandId">
		<xs:annotation>
			<xs:documentation>Wideband Correlator Product. Specifies the product ID and input data streams that should
			 be correlated. This format is used when there are multiple basebands in a  Station Board input data stream.
			 Data path and input band identifiers are used to specify the product. 
			 </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="prodId" type="widar:ProductIdType" use="required"/>
			<xs:attribute name="spectChannels" type="widar:WbcNumSpectChanType" use="required"/>
			<xs:attribute name="integFactor" type="xs:int" use="optional" default="1"/>
			<xs:attribute name="promptDpId" type="widar:StbDataPathIdType" use="required"/>
			<xs:attribute name="promptBandId" type="widar:StbInputBandIdType" use="required"/>
			<xs:attribute name="laggedDpId" type="widar:StbDataPathIdType" use="required"/>
			<xs:attribute name="laggedBandId" type="widar:StbInputBandIdType" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="WbcNumSpectChanType">
		<xs:annotation>
			<xs:documentation>
			Wideband Correlator: Number of spectral channels.
			Must be multiple of 64.
			Max. 4096 is specified in the stationBoard schema.
			Should the maximum be 524288 (and why) ? 
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="64"/>
			<xs:maxInclusive value="4096"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="StbInputBandIdType">
		<xs:annotation>
			<xs:documentation>
			Index of the band in the Station Board Input Data Stream.
			</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:int">
			<xs:minInclusive value="0"/>
			<xs:maxInclusive value="15"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:attributeGroup name="VciFilterParams">
		<xs:annotation>
			<xs:documentation>
			Configuration parameters for the Station Board Filter (defines narrow band output of the filter). 
			 </xs:documentation>
		</xs:annotation>
		<xs:attribute name="useMixer" type="widar:YesNoType" use="optional" default="no"/>
		<xs:attribute name="mixerPhaseErrorCorr" type="widar:YesNoType" use="optional" default="no"/>
		<xs:attribute name="signalToNoise" type="widar:SignalToNoiseType" default="0"/>
	</xs:attributeGroup>
</xs:schema>
