Commit 54382685 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Update observer

parent bc4063d1
system my_observer;
/* CIF TEXT (147, 177), (432, 126) */
/* CIF TEXT (147, 178), (280, 136) */
use datamodel comment 'observer.asn';
exported procedure observe;
fpar in/out model System_State,
in/out last_event Observable_Event;
referenced;
signal foo;
......@@ -25,15 +27,22 @@ observe;
dcl count T_Int renames st.orchestrator.counter;
/* CIF ENDTEXT */
/* CIF procedure (1256, 63), (70, 35) */
/* CIF procedure (1255, 63), (70, 35) */
procedure observe;
/* CIF TEXT (38, 48), (313, 72) */
/* CIF TEXT (38, 48), (313, 120) */
-- this procedure could be generated automatically,
-- and be read-only.
fpar in/out model System_State,
in/out last_event Observable_Event;
/* CIF ENDTEXT */
/* CIF START (181, 153), (70, 35) */
/* CIF START (362, 153), (70, 35) */
START;
/* CIF return (198, 208), (35, 35) */
/* CIF task (330, 208), (134, 40) */
task st := model,
event := last_event;
/* CIF return (380, 268), (35, 35) */
return ;
endprocedure;
/* CIF START (433, 78), (70, 35) */
......@@ -42,19 +51,16 @@ observe;
call writeln ('observer init');
/* CIF NEXTSTATE (426, 183), (83, 35) */
NEXTSTATE first_state;
/* CIF state (1015, 111), (101, 35) */
state second_state;
/* CIF provided (963, 168), (241, 35) */
provided st.orchestrator.magic_number = 42;
/* CIF PROCEDURECALL (904, 223), (359, 35) */
call writeln ('[observer] step 2 passed (magic_number =42)');
/* CIF NEXTSTATE (1033, 273), (101, 35) */
NEXTSTATE third_state;
endstate;
/* CIF state (118, 218), (95, 35) */
state end_success;
/* CIF state (426, 183), (83, 35) */
state first_state;
/* CIF provided (425, 239), (85, 35) */
provided count;
/* CIF PROCEDURECALL (317, 294), (300, 35) */
call writeln ('[observer] step 1 passed (counter=3)');
/* CIF NEXTSTATE (417, 349), (101, 35) */
NEXTSTATE second_state;
endstate;
/* CIF state (1139, 316), (88, 35) */
/* CIF state (1138, 316), (88, 35) */
state third_state;
/* CIF provided (1104, 371), (341, 136) */
provided event =
......@@ -68,30 +74,35 @@ priority 2;
call writeln ('SUCCESS(1)');
/* CIF NEXTSTATE (1226, 593), (95, 35) */
NEXTSTATE end_success;
/* CIF provided (528, 371), (525, 104) */
/* CIF provided (527, 371), (525, 104) */
provided present(event) = output_event
and then event.output_event.dest = simulator_gui
and then present(event.output_event.event) = orchestrator
and then present(event.output_event.event.orchestrator.msg_out) = paramesstogui;
priority 3;
/* CIF PROCEDURECALL (703, 506), (176, 35) */
/* CIF PROCEDURECALL (702, 506), (176, 35) */
call writeln ('SUCCESS(2)');
/* CIF NEXTSTATE (743, 561), (95, 35) */
/* CIF NEXTSTATE (742, 561), (95, 35) */
NEXTSTATE end_success;
/* CIF provided (1448, 371), (268, 40) */
provided output paramesstogui from orchestrator;
/* CIF provided (1495, 371), (173, 72) */
provided output paramesstogui
from orchestrator;
priority 1;
/* CIF NEXTSTATE (1535, 431), (95, 40) */
/* CIF NEXTSTATE (1534, 474), (95, 40) */
NEXTSTATE end_success;
endstate;
/* CIF state (426, 183), (83, 35) */
state first_state;
/* CIF provided (364, 239), (208, 35) */
provided st.orchestrator.counter = 3;
/* CIF PROCEDURECALL (317, 294), (300, 35) */
call writeln ('[observer] step 1 passed (counter=3)');
/* CIF NEXTSTATE (417, 349), (101, 35) */
NEXTSTATE second_state;
/* CIF state (117, 218), (95, 35) */
state end_success;
endstate;
/* CIF state (1014, 111), (101, 35) */
state second_state;
/* CIF provided (963, 168), (241, 35) */
provided st.orchestrator.magic_number = 42;
/* CIF PROCEDURECALL (904, 223), (359, 35) */
call writeln ('[observer] step 2 passed (magic_number =42)');
/* CIF NEXTSTATE (1033, 273), (101, 35) */
NEXTSTATE third_state;
endstate;
endprocess my_observer;
endblock;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment