function2.pr 2.77 KB
Newer Older
1
2
/* CIF PROCESS (250, 150), (150, 75) */
process Function2;
Maxime Perrotin's avatar
Maxime Perrotin committed
3
    /* CIF TEXT (508, 352), (267, 140) */
4
    dcl val MyInteger := 0;
5
6
    
    dcl dataHasChanged T_Boolean := False;
7
    /* CIF ENDTEXT */
Maxime Perrotin's avatar
Maxime Perrotin committed
8
    /* CIF procedure (622, 214), (75, 35) */
9
    procedure getData;
Maxime Perrotin's avatar
Maxime Perrotin committed
10
        /* CIF TEXT (446, 134), (267, 148) */
11
12
13
        fpar
            in/out P1 MyInteger;
        /* CIF ENDTEXT */
Maxime Perrotin's avatar
Maxime Perrotin committed
14
        /* CIF START (112, 72), (70, 35) */
15
        START;
Maxime Perrotin's avatar
Maxime Perrotin committed
16
            /* CIF task (112, 127), (71, 35) */
17
            task p1 := val;
Maxime Perrotin's avatar
Maxime Perrotin committed
18
19
20
            /* CIF PROCEDURECALL (0, 182), (295, 35) */
            call writeln('function2] procedure getData called');
            /* CIF return (130, 232), (35, 35) */
21
22
            return ;
    endprocedure;
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
    /* CIF procedure (874, 361), (77, 35) */
    procedure setData;
        /* CIF TEXT (412, 134), (267, 148) */
        fpar
            in P1 MyInteger,
            in P2 T_Boolean;
        /* CIF ENDTEXT */
        /* CIF START (157, 86), (70, 35) */
        START;
            /* CIF PROCEDURECALL (2, 141), (378, 35) */
            call writeln('procedure setData called with params:  ', p1, ' - ', p2);
            /* CIF task (156, 196), (71, 35) */
            task val := p1;
            /* CIF task (108, 251), (167, 35) */
            task dataHasChanged := True;
            /* CIF return (174, 301), (35, 35) */
            return ;
    endprocedure;
Maxime Perrotin's avatar
Maxime Perrotin committed
41
    /* CIF START (167, 10), (70, 35) */
42
    START;
Maxime Perrotin's avatar
Maxime Perrotin committed
43
        /* CIF NEXTSTATE (167, 60), (70, 35) */
44
        NEXTSTATE Wait;
45
46
47
48
49
50
51
52
53
54
55
56
    /* CIF state (770, 50), (85, 40) */
    state wait, 
otherstate;
        /* CIF provided (753, 110), (119, 35) */
        provided datahaschanged;
            /* CIF PROCEDURECALL (679, 165), (266, 35) */
            call writeln('[Function2] Data has changed!!!');
            /* CIF task (728, 220), (170, 35) */
            task dataHaschanged := False;
            /* CIF NEXTSTATE (778, 275), (70, 35) */
            NEXTSTATE -;
    endstate;
Maxime Perrotin's avatar
Maxime Perrotin committed
57
58
    /* CIF state (520, 10), (88, 35) */
    state Otherstate;
59
        /* CIF input (527, 65), (70, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
60
        input getData;
61
            /* CIF PROCEDURECALL (415, 120), (296, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
62
            call writeln('[function2] Transition after getData');
63
            /* CIF NEXTSTATE (528, 175), (70, 40) */
Maxime Perrotin's avatar
Maxime Perrotin committed
64
65
66
            NEXTSTATE -;
    endstate;
    /* CIF state (167, 60), (70, 35) */
67
    state Wait;
Maxime Perrotin's avatar
Maxime Perrotin committed
68
69
70
71
        /* CIF input (0, 115), (102, 35) */
        input doSomething;
            /* CIF NEXTSTATE (6, 170), (89, 35) */
            NEXTSTATE OtherState;
72
        /* CIF input (223, 115), (70, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
73
        input getData;
74
            /* CIF PROCEDURECALL (111, 170), (296, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
75
            call writeln('[function2] Transition after getData');
76
            /* CIF NEXTSTATE (224, 225), (70, 40) */
Maxime Perrotin's avatar
Maxime Perrotin committed
77
            NEXTSTATE -;
78
79
    endstate;
endprocess Function2;