Commit 2cac86ed authored by Maxime Perrotin's avatar Maxime Perrotin

Fix demo - there was a mismatch with signed types

parent 10d93883
/* CIF PROCESS (250, 149), (150, 75) */
PROCESS orchestrator;
process orchestrator;
/* CIF TEXT (81, 252), (276, 283) */
-- You can manually declare an
-- external procedure:
-- procedure tototo;
-- fpar titi MyInteger;
-- external;
-- In that case you are responsible for
-- providing the body code.
-- toto is used to check that
-- the FPAR in myproc that also
-- has a param called toto does
-- not conflict.
dcl toto MySeqOf;
-- external procedure:
-- procedure tototo;
-- fpar titi MyInteger;
-- external;
-- In that case you are responsible for
-- providing the body code.
-- toto is used to check that
-- the FPAR in myproc that also
-- has a param called toto does
-- not conflict.
dcl toto MySeqOf;
/* CIF ENDTEXT */
/* CIF TEXT (59, 8), (366, 195) */
-- This demo shows the main features
-- and syntax currently supported by
-- OpenGEODE
-- The description of the signal and
-- external procedures is in the file called
-- "system_structure.pr".
-- To open this model you must load both
-- files from the command line:
-- and syntax currently supported by
-- OpenGEODE
-- The description of the signal and
-- external procedures is in the file called
-- "system_structure.pr".
-- To open this model you must load both
-- files from the command line:
-- $ opengeode system_structure.pr orchestrator.pr
/* CIF ENDTEXT */
/* CIF TEXT (437, 19), (319, 382) */
-- Some test data
-- Some test data
DCL a MyInteger := 4;
DCL b MySeqOf;
DCL c MySeq;
DCL e, g MyChoice;
DCL f MyEnum;
DCL h MyReal;
DCL i MyPossiblyEmptySeqOf;
DCL j MyComplexType;
DCL k MyComplexSeqOf;
DCL l MyComplexChoice;
DCL myCmd MyInteger;
DCL a MyInteger := 4;
DCL b MySeqOf;
DCL c MySeq;
DCL e, g MyChoice;
DCL f MyEnum;
DCL h MyReal;
DCL i MyPossiblyEmptySeqOf;
DCL j MyComplexType;
DCL k MyComplexSeqOf;
DCL l MyComplexChoice;
DCL myCmd MyInteger;
dcl m MyChoice2;
/* CIF ENDTEXT */
/* CIF ENDTEXT */
/* CIF PROCEDURE (146, 614), (91, 50) */
/* CIF procedure (146, 614), (91, 50) */
procedure myproc;
/* CIF TEXT (409, 0), (197, 140) */
-- A Local variable
-- A Local variable
DCL foo MyInteger;
-- Procedure interface
fpar
in toto MyInteger,
DCL foo MyInteger;
-- Procedure interface
fpar
in toto MyInteger,
in/out tutu MyInteger;
/* CIF ENDTEXT */
/* CIF START (617, 19), (100, 50) */
START;
START;
/* CIF TASK (617, 84), (100, 50) */
TASK a := 42;
/* CIF DECISION (617, 149), (100, 70) */
DECISION toto;
/* CIF ANSWER (422, 239), (100, 35) */
(<10):
/* CIF TASK (409, 289), (126, 50) */
TASK tutu := 128;
/* CIF ANSWER (548, 239), (100, 35) */
ELSE:
/* CIF TASK (543, 289), (110, 50) */
TASK tutu := 254;
ENDDECISION;
/* CIF TASK (617, 354), (100, 50) */
TASK foo := a;
/* CIF RETURN (642, 419), (50, 50) */
RETURN ;
/* CIF task (617, 84), (100, 50) */
task a := 42;
/* CIF decision (617, 149), (100, 70) */
decision toto;
/* CIF ANSWER (422, 239), (100, 35) */
(<10):
/* CIF task (409, 289), (126, 50) */
task tutu := 128;
/* CIF ANSWER (548, 239), (100, 35) */
ELSE:
/* CIF task (543, 289), (110, 50) */
task tutu := 254;
enddecision;
/* CIF task (617, 354), (100, 50) */
task foo := a;
/* CIF return (642, 419), (50, 50) */
return ;
endprocedure;
/* CIF START (953, 3), (100, 50) */
START;
START;
/* CIF TASK (796, 73), (413, 368) */
/* CIF task (796, 73), (413, 368) */
task a := 42 + 5 * 3 - 1,
b := { hello, world },
a := length(b),
c := {a 5, b taste},
......@@ -105,7 +105,7 @@ i := {},
i := { 1 },
a := length(i),
a := if e!a then 8 else if b(0) = hello then a else 9 fi fi,
j := { a { x if e!a then 5 else a fi, y 6 } },
j := { a { x if e!a then 5 else 9 fi, y 6 } },
k := { {x 4}, {x 5} },
l := a:{ x 5 },
a := if present(e)=b then 42 else 43 fi,
......@@ -114,112 +114,112 @@ h := abs(-42.5),
h := abs(h),
i := {1, 2},
m := B:C:TRUE
/* CIF COMMENT (1273, 237), (158, 40) */
COMMENT 'This is a comment
/* CIF comment (1273, 237), (160, 40) */
comment 'This is a comment
A multiline one, I mean';
/* CIF TASK (939, 456), (128, 53) */
TASK for x in i:
/* CIF task (939, 456), (128, 53) */
task for x in i:
call writeln(x);
endfor;
/* CIF PROCEDURECALL (875, 524), (255, 50) */
CALL writeln('Should show "5 42.5": ', a, h);
/* CIF DECISION (947, 589), (112, 70) */
DECISION present(e);
/* CIF ANSWER (953, 679), (100, 31) */
(a):
/* CIF TASK (949, 729), (108, 50) */
TASK a := 37;
/* CIF ANSWER (1106, 679), (100, 35) */
(b):
/* CIF TASK (1066, 729), (179, 50) */
TASK a := 38;
/* CIF ANSWER (1256, 679), (100, 35) */
ELSE:
ENDDECISION;
/* CIF DECISION (953, 794), (100, 70) */
DECISION e;
/* CIF ANSWER (840, 884), (100, 35) */
(a:TRUE):
/* CIF TASK (840, 939), (100, 50) */
TASK a := 41;
/* CIF ANSWER (646, 884), (100, 35) */
(g):
/* CIF TASK (646, 939), (100, 50) */
TASK a := 40;
/* CIF ANSWER (1077, 884), (100, 35) */
ELSE:
/* CIF TASK (1077, 939), (100, 50) */
TASK a := 42;
ENDDECISION;
call writeln('Should show "5 42.5": ', a, h);
/* CIF decision (947, 589), (112, 70) */
decision present(e);
/* CIF ANSWER (953, 679), (100, 31) */
(a):
/* CIF task (949, 729), (108, 50) */
task a := 37;
/* CIF ANSWER (1106, 679), (100, 35) */
(b):
/* CIF task (1066, 729), (179, 50) */
task a := 38;
/* CIF ANSWER (1256, 679), (100, 35) */
ELSE:
enddecision;
/* CIF decision (953, 794), (100, 70) */
decision e;
/* CIF ANSWER (840, 884), (100, 35) */
(a:TRUE):
/* CIF task (840, 939), (100, 50) */
task a := 41;
/* CIF ANSWER (646, 884), (100, 35) */
(g):
/* CIF task (646, 939), (100, 50) */
task a := 40;
/* CIF ANSWER (1077, 884), (100, 35) */
ELSE:
/* CIF task (1077, 939), (100, 50) */
task a := 42;
enddecision;
/* CIF NEXTSTATE (956, 1004), (94, 38) */
NEXTSTATE Stopped;
/* CIF LABEL (452, 491), (152, 50) */
CONNECTION Transition_to_Stop:
/* CIF OUTPUT (451, 556), (153, 50) */
OUTPUT housekeeping(31);
/* CIF label (452, 491), (152, 50) */
connection Transition_to_Stop:
/* CIF output (451, 556), (153, 50) */
output housekeeping(31);
/* CIF NEXTSTATE (478, 621), (100, 50) */
NEXTSTATE Stopped;
/* CIF End Label */
ENDCONNECTION;
/* CIF STATE (2396, 617), (100, 50) */
STATE Running;
/* CIF INPUT (2386, 687), (120, 50) */
INPUT run(myCmd);
/* CIF OUTPUT (2363, 752), (165, 50) */
OUTPUT housekeeping(42);
/* CIF JOIN (2421, 817), (50, 50) */
JOIN Transition_to_Stop;
ENDSTATE;
/* CIF STATE (2064, 20), (100, 50) */
STATE Stopped;
/* CIF INPUT (2396, 90), (100, 50) */
INPUT run(a)
/* CIF COMMENT (2368, 21), (167, 50) */
endconnection;
/* CIF state (2396, 617), (100, 50) */
state Running;
/* CIF input (2386, 687), (120, 50) */
input run(myCmd);
/* CIF output (2363, 752), (165, 50) */
output housekeeping(42);
/* CIF join (2421, 817), (50, 50) */
join Transition_to_Stop;
endstate;
/* CIF state (2064, 20), (100, 50) */
state Stopped;
/* CIF input (2396, 90), (100, 50) */
input run(a)
/* CIF comment (2368, 21), (167, 50) */
/* CIF Keep Specific Geode HyperLink 'http://www.esa.int' */
COMMENT 'My comment is rich';
/* CIF LABEL (2396, 155), (100, 50) */
comment 'My comment is rich';
/* CIF label (2396, 155), (100, 50) */
Here:
/* CIF DECISION (2396, 220), (100, 70) */
DECISION a>10;
/* CIF ANSWER (2304, 310), (100, 35) */
(TRUE):
/* CIF PROCEDURECALL (2209, 360), (290, 47) */
CALL writeln
/* CIF decision (2396, 220), (100, 70) */
decision a>10;
/* CIF ANSWER (2304, 310), (100, 35) */
(TRUE):
/* CIF PROCEDURECALL (2209, 360), (290, 47) */
call writeln
('a is too big! - decrementing :', a, a - 1);
/* CIF TASK (2298, 422), (112, 50) */
TASK a := a - 1;
/* CIF PROCEDURECALL (2296, 487), (116, 50) */
CALL myproc(5,a);
/* CIF JOIN (2329, 552), (50, 50) */
JOIN Here;
/* CIF ANSWER (2509, 310), (100, 35) */
(FALSE):
ENDDECISION;
/* CIF task (2298, 422), (112, 50) */
task a := a - 1;
/* CIF PROCEDURECALL (2296, 487), (116, 50) */
call myproc(5,a);
/* CIF join (2329, 552), (50, 50) */
join Here;
/* CIF ANSWER (2509, 310), (100, 35) */
(FALSE):
enddecision;
/* CIF NEXTSTATE (2396, 617), (100, 50) */
NEXTSTATE Running;
/* CIF INPUT (1746, 90), (100, 50) */
INPUT pulse;
/* CIF OUTPUT (1715, 155), (161, 50) */
OUTPUT housekeeping (1);
/* CIF input (1746, 90), (100, 50) */
input pulse;
/* CIF output (1715, 155), (161, 50) */
output housekeeping (1);
/* CIF NEXTSTATE (1750, 220), (91, 46) */
NEXTSTATE -
/* CIF COMMENT (1909, 213), (153, 50) */
COMMENT 'Stay in the same state';
ENDSTATE;
/* CIF STATE (1503, 29), (100, 50) */
STATE Running;
/* CIF INPUT (1503, 99), (100, 50) */
INPUT pulse;
/* CIF TASK (1456, 164), (193, 50) */
TASK a := (a+1) mod 10;
/* CIF comment (1909, 213), (153, 50) */
comment 'Stay in the same state';
endstate;
/* CIF state (1503, 29), (100, 50) */
state Running;
/* CIF input (1503, 99), (100, 50) */
input pulse;
/* CIF task (1456, 164), (193, 50) */
task a := (a+1) mod 10;
/* CIF PROCEDURECALL (1450, 229), (205, 50) */
CALL writeln
call writeln
('Calling GNC with value ', a);
/* CIF PROCEDURECALL (1474, 294), (158, 50) */
CALL computeGNC(a, a);
/* CIF OUTPUT (1479, 359), (148, 50) */
OUTPUT housekeeping(a);
call computeGNC(a, a);
/* CIF output (1479, 359), (148, 50) */
output housekeeping(a);
/* CIF NEXTSTATE (1503, 424), (100, 50) */
NEXTSTATE Running;
ENDSTATE;
ENDPROCESS orchestrator;
\ No newline at end of file
endstate;
endprocess orchestrator;
\ No newline at end of file
Markdown is supported
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