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

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
Topic attachments
I Attachment Action Size Date Who Comment
JoystickDrv.strlstrl JoystickDrv.strl manage 1 K 24 Mar 2010 - 17:34 SorayaArias Exemple de Code Esterel de Tache Robot
NoStabTraking.strlstrl NoStabTraking.strl manage 2 K 22 Mar 2010 - 11:48 SorayaArias Exemple de Code Esterel de Tache Robot
Topic revision: r4 - 08 Apr 2010, SorayaArias
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding SedWiki? Send feedback