<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
	- Author: Andrea Orlati
	-
	- History:
	-   22-12-2008  Created
-->

<xs:schema
	targetNamespace="urn:schemas-cosylab-com:Scheduler:1.0"
	xmlns="urn:schemas-cosylab-com:Scheduler:1.0"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
	xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
	xmlns:mng="urn:schemas-cosylab-com:Managment:1.0"
	xmlns:antenna="urn:schemas-cosylab-com:Antenna:1.0"
	elementFormDefault="qualified"
	attributeFormDefault="unqualified">
	<xs:import namespace="urn:schemas-cosylab-com:CDB:1.0" schemaLocation="CDB.xsd"/>
	<xs:import namespace="urn:schemas-cosylab-com:BACI:1.0" schemaLocation="BACI.xsd"/>
	<xs:import namespace="urn:schemas-cosylab-com:Managment:1.0" schemaLocation="Managment.xsd"/>
	<xs:import namespace="urn:schemas-cosylab-com:Antenna:1.0" schemaLocation="Antenna.xsd"/>
		
	<xs:complexType name="SchedulerType">
     <xs:complexContent>
      <xs:extension base="baci:CharacteristicComponent">
		<xs:sequence>
			<xs:element name="scheduleName" type="baci:ROstring"/>
			<xs:element name="scanID" type="baci:ROlong" />
			<xs:element name="subScanID" type="baci:ROlong" />
			<xs:element name="currentDevice" type="baci:ROlong" />
			<xs:element name="status" type="mng:SystemStatusType" />
			<xs:element name="tracking" type="mng:BooleanType" />	
			<xs:element name="projectCode" type="baci:ROstring"/>
			<xs:element name="currentBackend" type="baci:ROstring"/>
			<xs:element name="currentRecorder" type="baci:ROstring"/>	
			<xs:element name="restFrequency" type="baci:ROdoubleSeq"/>
		</xs:sequence>
		<!-- directory where to find the schedules -->
		<xs:attribute name="SchedDir" type="xs:string" use="required" />
		<!-- directory where to store data files -->
		<xs:attribute name="DataDir" type="xs:string" use="required" />
		<!-- directory where to store system file and auxiliary files in general -->
		<xs:attribute name="SystemDataDir" type="xs:string" use="required" />		
		<!-- Location inside the CDB where the component looks for the procedures files -->
		<xs:attribute name="ProceduresLocation" type="xs:string" use="required" />
		<!-- user log files directory -->
		<xs:attribute name="LogDir" type="xs:string" use="required" />
		<!-- Location of the report file of the schedule, it could be empty in that case no report is created -->
		<xs:attribute name="ScheduleReportPath" type="xs:string" use="required" />
		<!-- Location where the scheduler will store the schedule after it has been launched, it could be empty to disable the copy -->
		<xs:attribute name="ScheduleBackuptPath" type="xs:string" use="required" />
		<!-- This is the (lock) file that is created (absolute path) when the system is executing a schedule and recording -->
		<xs:attribute name="RecordingLockFile" type="xs:string" use="required" />	
		<!-- Name of the procedure file table (inside the CDB) that will be loaded at startup -->
		<xs:attribute name="DefaultProceduresFile" type="xs:string" use="required" />		
		<!-- the cache time (microseconds) for logging repetition filter -->
		<xs:attribute name="RepetitionCacheTime" type="xs:unsignedLong" use="required" />
		<!-- the expire time (microseconds) for logging repetition filter -->
		<xs:attribute name="RepetitionExpireTime" type="xs:unsignedLong" use="required" />
		<!-- sleep time of the executor thread in microseconds -->
		<xs:attribute name="ScheduleExecutorSleepTime" type="xs:unsignedLong" use="required" />
		<!-- This the gap (microseconds) that the scheduler must respects for a transition of the calibration diode. Used in Tsys computation. -->
		<xs:attribute name="TsysTransitionGap" type="xs:unsignedLong" use="required" />								
		<!-- here a list of used component follows -->
		<!-- the interface of the component that leads the Antenna subsystem -->
		<xs:attribute name="AntennaBossInterface" type="xs:string" use="required" />
		<!-- the interface of component that stores observatory information -->
		<xs:attribute name="ObservatoryInterface" type="xs:string" use="required" />		
		<!-- the interface of component that leads the receivers subsystem -->
		<xs:attribute name="ReceiversBossInterface" type="xs:string" use="required" />
		<!-- the interface of component that leads the minor servo subsystem -->
		<xs:attribute name="MinorServoBossInterface" type="xs:string" use="required" />
		<!-- the interface of component that leads the active surface subsystem -->
		<xs:attribute name="ActiveSurfaceBossInterface" type="xs:string" use="required" />		
		<!-- the interface of component that is in charge of log file creation -->
		<xs:attribute name="CustomLoggerInterface" type="xs:string" use="required" />
		<!-- the interface of weather station -->
		<xs:attribute name="WeatherStationInstance" type="xs:string" use="required" />
		<!-- the instance of the default backend -->
		<xs:attribute name="DefaultBackendInstance" type="xs:string" use="required" />
		<!-- the instance of the default data receiver -->
		<xs:attribute name="DefaultDataReceiverInstance" type="xs:string" use="required" />
		<!-- the code of the default project, loaded at the startup -->
		<xs:attribute name="DefaultProjectCode" type="xs:string" use="required" />
		<!-- This flag is "true" or "false" to control if the system should check the project code for its existance or not -->
        <xs:attribute name="CheckProjectCode" type="xs:boolean" use="required" />
      </xs:extension>
     </xs:complexContent>
	</xs:complexType>

	<xs:element name="Scheduler" type="SchedulerType"/>
	
</xs:schema>
