og.pr 5.45 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
SYSTEM og;
    /* CIF TEXT (156, 190), (356, 248) */
    use dv comment 'dataview-uniq.asn';

signal telecommand(tc_type);
signal telemetry(tm_type);
    /* CIF ENDTEXT */
    CHANNEL c
        FROM ENV TO og WITH telecommand;
        FROM og TO ENV WITH telemetry;
    ENDCHANNEL;
    BLOCK og;
        SIGNALROUTE r
            FROM ENV TO og WITH telecommand;
            FROM og TO ENV WITH telemetry;
        CONNECT c AND r;
        /* CIF PROCESS (225, 49), (150, 75) */
        PROCESS og;
            STATE AGGREGATION wait;
            SUBSTRUCTURE
21
                    STATE memory_manager;
22
                    SUBSTRUCTURE
23
                            /* CIF START (259, 60), (70, 35) */
24
                            START;
25
                                /* CIF NEXTSTATE (231, 110), (126, 35) */
26
                                NEXTSTATE wait_for_tc;
27
                            /* CIF STATE (231, 110), (126, 35) */
28
                            STATE wait_for_tc;
29
30
31
32
33
                                /* CIF PROVIDED (64, 165), (459, 35) */
                                PROVIDED got_tc=true and present(tc!content)=patch_memory;
                                    /* CIF PROCEDURECALL (178, 215), (231, 35) */
                                    CALL writeln('Patch Memory');
                                    /* CIF TASK (218, 265), (151, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
34
                                    TASK got_tc := false
35
                                    /* CIF COMMENT (389, 265), (216, 48) */
Maxime Perrotin's avatar
Maxime Perrotin committed
36
37
                                    COMMENT 'Reset the flag to avoid
infinite loop';
38
                                    /* CIF NEXTSTATE (258, 315), (70, 35) */
39
40
41
42
43
44
45
                                    NEXTSTATE -;
                            ENDSTATE;
                    ENDSUBSTRUCTURE;
                    STATE tc_router;
                    SUBSTRUCTURE
                            /* CIF START (144, 56), (70, 35) */
                            START;
46
                                /* CIF NEXTSTATE (116, 106), (126, 35) */
47
                                NEXTSTATE wait_for_tc;
48
                            /* CIF STATE (116, 106), (126, 35) */
49
                            STATE wait_for_tc;
50
                                /* CIF INPUT (93, 161), (175, 35) */
51
                                INPUT telecommand(tc);
52
                                    /* CIF TASK (107, 211), (146, 35) */
53
                                    TASK got_tc := true;
54
                                    /* CIF NEXTSTATE (145, 261), (70, 35) */
55
56
57
                                    NEXTSTATE -;
                            ENDSTATE;
                    ENDSUBSTRUCTURE;
58
                    STATE mode_manager;
59
                    SUBSTRUCTURE
60
                            /* CIF START (359, 108), (70, 35) */
61
                            START;
62
                                /* CIF NEXTSTATE (331, 158), (126, 35) */
63
                                NEXTSTATE wait_for_tc;
64
                            /* CIF STATE (331, 158), (126, 35) */
65
                            STATE wait_for_tc;
66
67
68
69
70
                                /* CIF PROVIDED (68, 213), (360, 35) */
                                PROVIDED got_tc=true and present(tc!content)=change_mode;
                                    /* CIF PROCEDURECALL (135, 263), (226, 35) */
                                    CALL writeln('Change Mode');
                                    /* CIF TASK (173, 313), (151, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
71
                                    TASK got_tc := false
72
                                    /* CIF COMMENT (344, 313), (216, 48) */
Maxime Perrotin's avatar
Maxime Perrotin committed
73
74
                                    COMMENT 'Reset the flag to avoid
infinite loop';
75
76
77
78
79
                                    /* CIF NEXTSTATE (213, 363), (70, 35) */
                                    NEXTSTATE -;
                                /* CIF PROVIDED (570, 213), (110, 35) */
                                PROVIDED true = false;
                                    /* CIF NEXTSTATE (590, 263), (70, 35) */
80
81
82
                                    NEXTSTATE -;
                            ENDSTATE;
                    ENDSUBSTRUCTURE;
83
84
                    /* CIF STATE (314, 191), (161, 35) */
                    STATE mode_manager;
85
                    ENDSTATE;
86
                    /* CIF STATE (238, 111), (113, 35) */
87
88
                    STATE tc_router;
                    ENDSTATE;
89
90
                    /* CIF STATE (370, 97), (182, 35) */
                    STATE memory_manager;
91
92
                    ENDSTATE;
            ENDSUBSTRUCTURE;
93
            /* CIF TEXT (622, 310), (327, 208) */
94
95
96
97
98
99
100
101
            -- This system tests the provided clause
-- (continuous signal)

dcl tc TC_type;

dcl tm TM_type;

dcl got_tc Boolean_type;
102
103

dcl anything boolean_Type := true;
104
            /* CIF ENDTEXT */
Maxime Perrotin's avatar
Maxime Perrotin committed
105
            /* CIF START (351, 297), (70, 35) */
106
            START;
Maxime Perrotin's avatar
Maxime Perrotin committed
107
                /* CIF NEXTSTATE (336, 348), (99, 35) */
Maxime Perrotin's avatar
Maxime Perrotin committed
108
                NEXTSTATE starting;
109
110
111
            /* CIF STATE (333, 575), (70, 35) */
            STATE wait;
            ENDSTATE;
Maxime Perrotin's avatar
Maxime Perrotin committed
112
113
114
            /* CIF STATE (485, 344), (99, 35) */
            STATE starting;
                /* CIF PROVIDED (481, 399), (106, 35) */
115
                PROVIDED anything;
Maxime Perrotin's avatar
Maxime Perrotin committed
116
                    /* CIF TASK (450, 449), (168, 35) */
117
                    TASK anything := false;
Maxime Perrotin's avatar
Maxime Perrotin committed
118
                    /* CIF PROCEDURECALL (445, 499), (177, 35) */
119
                    CALL writeln('Lets go');
Maxime Perrotin's avatar
Maxime Perrotin committed
120
                    /* CIF NEXTSTATE (499, 549), (70, 35) */
121
                    NEXTSTATE wait;
122
123
124
            ENDSTATE;
        ENDPROCESS og;
    ENDBLOCK;
125
ENDSYSTEM;