Pseudo code pour le code Esterel de la tache robot
- NOMENMAJUSCULE : partie a remplacer via generation de code
-
__foreach xxxxx___
traitement a faire en boucle via generation de code
- Exemples de Fichier genere
Fichier NOMROBOTTASK.strl
module NOMROBOTTASK:
type orcStrlPtr ;
input
>>foreach event of PRECONDITION type do : NOMPRECONDEVENT,<<
>>foreach event of POSTCONDITION type do : NOMPOSTCONDEVENT,<<
>>foreach event of PRECONDITION type do : NOMROBOTTASKTimeoutNOMPRECONDEVENT,<<
>>foreach event of T1 type do : NOMT1EVENT,<<
>>foreach event of T2 type do : NOMT2EVENT,<<
>>foreach event of T3 type do : NOMT3EVENT,<<
InitOK_NOMPHYSICALRESSOURCE,
NOMROBOTTASK_Start:orcStrlPtr,
START_NOMROBOTTASK,
FinTransite_NOMPHYSICALRESSOURCE,
Abort_Local_NOMROBOTOTASK;
output
>>forearch event of T1 type do : TreatNOMT1EVENT:orcStrlPtr,<<
>>forearch event of T2 type do : T2_NOMT2EVENT,<<
STARTED_NOMROBOTTASK,
GoodEnd_NOMROBOTTASK,
ActivateNOMROBOTTASK_NOMPHYSICALRESSOURCE:orcStrlPtr,
T2_NOMROBOTTASK,
NNOMROBOTTASKTransite : orcStrlPtr,
Abort_NOMROBOTTASK:orcStrlPtr,
BF_NOMROBOTTASK,
T3_NOMROBOTTASK,
StartTransite_NOMPHYSICALRESSOURCE,
Prev_rt_NOMPHYSICALRESSOURCE:orcStrlPtr,
ReadyToStart_NOMPHYSICALRESSOURCE;
relation
>>foreach event of PRECONDITION type do : NOMPRECONDEVENT#<<
>>foreach event of POSTCOND type do : NOMPOSTCONDFEVENT#<<
>>foreach event of PRECONDITION type do : NOMROBOTTASKTimeoutNOMPRECONDEVENT#<<
>>foreach event of T1 type do : NOMT1EVENT#<<
>>foreach event of T2 type do : NOMT2EVENT#<<
>>foreach event of T3 type do : NOMT3EVENT#<<
InitOK_NOMPHYSICALRESSOURCE#
START_NOMROBOTTASK#
Abort_Local_NOMROBOTTASK#
FinTransite_NOMPHYSICALRESSOURCE;
trap T3 in
loop
await immediate START_NOMROBOTTASK;
emit STARTED_NOMROBOTTASK;
trap Abort in
do
[
>>foreach event of PRECONDITION type do :
do
await NOMPRECONDEVENT
watching NOMROBOTTASKTimeoutNOMPRECONDEVENT
timeout exit T3
end
||<<
await InitOK_NOMPHYSICALRESSOURCE
]
watching Abort_Local_NOMROBOTTASK
timeout emit Abort_NOMROBOTTASK(?NOMROBOTTASK_Start); exit Abort;
end;
do
[
emit ReadyToStart_NOMPHYSICALRESSOURCE;
await immediate FinTransite_NOMPHYSICALRESSOURCE;
emit ActivateNOMROBOTTASK_NOMPHYSICALRESSOURCE(?NOMROBOTTASK_Start);
emit Prev_rt_NOMPHYSICALRESSOURCE(?NOMROBOTTASK_Start);
]
watching Abort_Local_NOMROBOTTASK
timeout emit StartTransite_NOMPHYSICALRESSOURCE;
emit NOMROBOTTASKTransite(?NOMROBOTTASK_Start); exit Abort
end;
trap T2 in
trap BF in
[
await Abort_Local_NOMROBOTTASK;
emit StartTransite_NOMPHYSICALRESSOURCE;
emit NOMROBOTTASKTransite(?NOMROBOTTASK_Start);
exit Abort;
]
||
>>foreach event of T1 type do :
loop
await NOMT1EVENT; emit TreatNOMT1EVENT(?NOMROBOTTASK_Start)
end loop
||<<
>>foreach event of T2 type do :
await NOMT2EVENT; emit T2_NOMT2EVENT; exit T2
||<<
>>foreach event of T3 type do :
await NOMT3EVENT; exit T3
||<<
[[
[
>>foreach event of POSTCONDITION type do :
await POSTCONDITION
||<<
>>if any event POSTCONDITION type do :
halt;<<
]
];
exit BF;
]
handle BF do
emit NOMROBOTTASKTransite(?NOMROBOTTASK_Start);
emit BF_NOMROBOTTASK; emit GoodEnd_NOMROBOTTASK;
emit StartTransite_NOMPHYSICALRESSOURCE;
end trap
handle T2 do
emit T2_NOMROBOTTASK;
emit StartTransite_NOMPHYSICALRESSOURCE;
emit NOMROBOTTASKTransite(?NOMROBOTTASK_Start);
end trap
end trap
end loop
handle T3 do
emit T3_NOMROBOTTASK
end trap
end module
-- Main.SorayaArias - 22 Mar 2010