orchestrator.pr 3.14 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
SYSTEM orchestrator;
    /* CIF TEXT (880, 108), (315, 128) */
    use datatypes comment  'dataview-uniq.asn';

signal pulse (t_int);

signal arr (t_seqof);

signal paramless;
    /* CIF ENDTEXT */
    CHANNEL c
        FROM ENV TO orchestrator WITH pulse,
arr,
paramless;
    ENDCHANNEL;
    BLOCK orchestrator;
        SIGNALROUTE r
            FROM ENV TO orchestrator WITH pulse,
arr,
paramless;
        CONNECT c AND r;
        /* CIF PROCESS (465, 158), (265, 176) */
        PROCESS orchestrator;
            /* CIF TEXT (920, 71), (268, 140) */
            -- Text area for declarations and comments

dcl t t_int := 0;

dcl counter t_int := 0;

dcl seqof t_seqof;
            /* CIF ENDTEXT */
            /* CIF START (444, 48), (70, 34) */
            START;
                /* CIF PROCEDURECALL (373, 102), (211, 35) */
                CALL writeln( 'Orchestrator startup');
                /* CIF NEXTSTATE (445, 152), (67, 35) */
                NEXTSTATE wait;
39
            /* CIF STATE (733, 94), (70, 35) */
40
            STATE running;
41
                /* CIF INPUT (733, 149), (70, 35) */
42
                INPUT *;
43
                    /* CIF NEXTSTATE (733, 204), (70, 35) */
44
45
46
47
                    NEXTSTATE wait;
            ENDSTATE;
            /* CIF STATE (445, 152), (67, 35) */
            STATE wait;
48
                /* CIF INPUT (120, 207), (70, 35) */
49
                INPUT pulse(t);
50
                    /* CIF DECISION (120, 262), (70, 50) */
51
                    DECISION t;
52
                        /* CIF ANSWER (75, 332), (70, 23) */
53
                        (0):
54
                            /* CIF NEXTSTATE (75, 375), (70, 35) */
55
                            NEXTSTATE wait;
56
                        /* CIF ANSWER (165, 332), (70, 23) */
57
                        else:
58
                            /* CIF NEXTSTATE (165, 375), (70, 35) */
59
60
                            NEXTSTATE running;
                    ENDDECISION;
61
                /* CIF INPUT (371, 207), (83, 35) */
62
                INPUT arr(seqof);
63
                    /* CIF TASK (312, 262), (202, 35) */
64
                    TASK counter := (counter + 1) mod 4;
65
                    /* CIF DECISION (353, 317), (121, 50) */
66
67
68
69
                    DECISION seqof = {4,4,4,4}
and counter = 0;
                        /* CIF ANSWER (336, 387), (70, 23) */
                        (true):
70
71
72
                            /* CIF PROCEDURECALL (245, 430), (250, 35) */
                            CALL writeln( 'Property should be checked');
                        /* CIF ANSWER (522, 387), (70, 23) */
73
                        (false):
74
                            /* CIF TASK (506, 430), (103, 35) */
75
76
                            TASK seqof(1) := 1;
                    ENDDECISION;
77
                    /* CIF NEXTSTATE (378, 480), (70, 35) */
78
                    NEXTSTATE -;
79
                /* CIF INPUT (629, 207), (83, 35) */
80
                INPUT paramless;
81
82
                    /* CIF TASK (619, 262), (104, 38) */
                    TASK counter := 4,
83
t := 1;
84
                    /* CIF NEXTSTATE (636, 320), (70, 35) */
85
86
87
88
89
                    NEXTSTATE running;
            ENDSTATE;
        ENDPROCESS orchestrator;
    ENDBLOCK;
ENDSYSTEM;