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

Fix demo - there was a mismatch with signed types

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