
%+++ Program +++
%
\begin{zsection}
  \SECTION ~ Program ~ \parents ~ scj\_prelude, MissionId, MissionIds, \\
  \t1 SchedulableId, SchedulableIds, MissionChan, SchedulableMethChan, MissionFW,\\
  \t1 SafeletFW, TopLevelMissionSequencerFW, NetworkChannels, ManagedThreadFW, \\
  \t1 SchedulableMissionSequencerFW, PeriodicEventHandlerFW, OneShotEventHandlerFW,\\
  \t1 AperiodicEventHandlerFW, ObjectFW, ThreadFW, \\
  \t1 ACSafeletApp, MainMissionSequencerApp,

MainMissionApp,

ACModeChangerApp
	,
ControlHandlerApp
	,
\\ \t1
CommunicationsHandlerApp
	,
EnvironmentMonitorApp
	,
FlightSensorsMonitorApp
	,
\\ \t1
AperiodicSimulatorApp
	
	
	,
TakeOffMissionApp,

LandingGearHandlerTakeOffApp
	,
TakeOffFailureHandlerApp
	,
\\ \t1
TakeOffMonitorApp
	
	,
CruiseMissionApp,

BeginLandingHandlerApp
	,
NavigationMonitorApp
	
\\ \t1
	,
LandMissionApp,

LandingGearHandlerLandApp
	,
SafeLandingHandlerApp
	,
GroundDistanceMonitorApp
	,
\\ \t1
InstrumentLandingSystemMonitorApp
	
	
	
\end{zsection}
%
\begin{circus}
\circprocess ControlTier \circdef \\
\circblockopen
SafeletFW \\
\t1 \lpar ControlTierSync \rpar \\
TopLevelMissionSequencerFW(MainMissionSequencer)
\circblockclose
\end{circus}
%


\begin{circus}
\circprocess Tier0 \circdef \\

\circblockopen
	MissionFW(MainMissionID)\\
		\t1 	\lpar MissionSync \rpar \\
		\circblockopen









			SchedulableMissionSequencerFW(ACModeChangerID)\\
\t1 \lpar SchedulablesSync \rpar\\


\circblockopen
			AperiodicEventHandlerFW(ControlHandlerID ,(time(10,0),null)   )\\
			\t1 \lpar SchedulablesSync \rpar\\
			AperiodicEventHandlerFW(CommunicationsHandlerID ,(NULL,nullSchedulableId)   )\\
\circblockclose \\


\t1 \lpar SchedulablesSync \rpar\\



\circblockopen
			PeriodicEventHandlerFW(EnvironmentMonitorID ,(time(10,0),NULL,NULL,nullSchedulableId)   )\\
			\t1 \lpar SchedulablesSync \rpar\\
			PeriodicEventHandlerFW(FlightSensorsMonitorID ,(time(10,0),NULL,NULL,nullSchedulableId)   )\\
			\t1 \lpar SchedulablesSync \rpar\\
			PeriodicEventHandlerFW(AperiodicSimulatorID ,(time(10,0),NULL,NULL,nullSchedulableId)   )\\
\circblockclose \\

		\circblockclose
\circblockclose
\end{circus}
%
\begin{circus}
\circprocess Tier1 \circdef \\

\circblockopen
	MissionFW(TakeOffMissionID)\\
		\t1 	\lpar MissionSync \rpar \\
		\circblockopen










\circblockopen
			AperiodicEventHandlerFW(LandingGearHandlerTakeOffID ,(NULL,nullSchedulableId)   )\\
			\t1 \lpar SchedulablesSync \rpar\\
			AperiodicEventHandlerFW(TakeOffFailureHandlerID ,(NULL,nullSchedulableId)   )\\
\circblockclose \\


\t1 \lpar SchedulablesSync \rpar\\



			PeriodicEventHandlerFW(TakeOffMonitorID ,(time(0,0),time(500,0),NULL,nullSchedulableId)   )\\
		\circblockclose
\circblockclose
	\\ \t1 \lpar ClusterSync \rpar \\

\circblockopen
	MissionFW(CruiseMissionID)\\
		\t1 	\lpar MissionSync \rpar \\
		\circblockopen










			AperiodicEventHandlerFW(BeginLandingHandlerID ,(NULL,nullSchedulableId)   )\\

\t1 \lpar SchedulablesSync \rpar\\



			PeriodicEventHandlerFW(NavigationMonitorID ,(time(0,0),time(10,0),NULL,nullSchedulableId)   )\\
		\circblockclose
\circblockclose
	\\ \t1 \lpar ClusterSync \rpar \\

\circblockopen
	MissionFW(LandMissionID)\\
		\t1 	\lpar MissionSync \rpar \\
		\circblockopen










\circblockopen
			AperiodicEventHandlerFW(LandingGearHandlerLandID ,(NULL,nullSchedulableId)   )\\
			\t1 \lpar SchedulablesSync \rpar\\
			AperiodicEventHandlerFW(SafeLandingHandlerID ,(NULL,nullSchedulableId)   )\\
\circblockclose \\


\t1 \lpar SchedulablesSync \rpar\\



\circblockopen
			PeriodicEventHandlerFW(GroundDistanceMonitorID ,(time(0,0),time(10,0),NULL,nullSchedulableId)   )\\
			\t1 \lpar SchedulablesSync \rpar\\
			PeriodicEventHandlerFW(InstrumentLandingSystemMonitorID ,(time(0,0),time(10,0),NULL,nullSchedulableId)   )\\
\circblockclose \\

		\circblockclose
\circblockclose
\end{circus}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%Framework +++
%
\begin{circus}
\circprocess Framework \circdef \\
\circblockopen
ControlTier \\
\t1 \lpar TierSync \rpar \\
 \circblockopen
Tier0
\\ \t1 \lpar Tier0Sync \rpar \\
Tier1
\circblockclose
\circblockclose
\end{circus}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% APPLICATION
%
\begin{circus}
\circprocess  Application \circdef \\
\circblockopen
ACSafeletApp\\
\interleave\\
MainMissionSequencerApp\\
\interleave \\
		MainMissionApp\\
		\interleave \\
			ACModeChangerApp ( MainMissionID  ) \\
			\interleave \\
			ControlHandlerApp\\
			\interleave \\
			CommunicationsHandlerApp\\
			\interleave \\
			EnvironmentMonitorApp ( MainMissionID  ) \\
			\interleave \\
			FlightSensorsMonitorApp ( MainMissionID  ) \\
			\interleave \\
			AperiodicSimulatorApp ( controlHandlerID  ) \\
			
		
		\interleave \\
		TakeOffMissionApp\\
		\interleave \\
			LandingGearHandlerTakeOffApp ( TakeOffMissionID  ) \\
			\interleave \\
			TakeOffFailureHandlerApp ( MainMission ,  TakeOffMissionID ,    ) \\
			\interleave \\
			TakeOffMonitorApp ( MainMission ,  TakeOffMissionID ,   ,  landingGearHandlerID  ) \\
			
		\interleave \\
		CruiseMissionApp\\
		\interleave \\
			BeginLandingHandlerApp ( MainMission  ) \\
			\interleave \\
			NavigationMonitorApp ( MainMission  ) \\
			
		\interleave \\
		LandMissionApp\\
		\interleave \\
			LandingGearHandlerLandApp ( LandMissionID  ) \\
			\interleave \\
			SafeLandingHandlerApp ( MainMission ,    ) \\
			\interleave \\
			GroundDistanceMonitorApp ( MainMission  ) \\
			\interleave \\
			InstrumentLandingSystemMonitorApp ( LandMissionID  ) \\
			
		
\circblockclose
\end{circus}
