<
From version < 4.1 >
edited by aas2
on 2017/05/30 16:50
To version < 5.1 >
edited by aas2
on 2017/05/30 16:52
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -176,4 +176,62 @@
176 176  )))
177 177  )))
178 178  
179 -\\
179 +{{code language="sct" title="Controller-Environment Interface"}}
180 +scchart environment {
181 +
182 + //------------------------------------------------------------\\
183 + //-- INPUTS --\\
184 + //------------------------------------------------------------\\
185 + // Initial track of the trains
186 + input int train_setup[NUM_TRAINS];
187 + // Speed of all tracks
188 + input int track_speeds[TRACK_SEGMENTS];
189 + // State of all switches
190 + input bool points[NUM_POINTS];
191 + // State of all signals
192 + input int signals[TRACK_SEGMENTS][2];
193 +
194 + //------------------------------------------------------------\\
195 + //-- OUTPUTS --\\
196 + //------------------------------------------------------------\\
197 + // State of all contacts of the railway
198 + output int track_contacts[TRACK_SEGMENTS][2];
199 +
200 + //------------------------------------------------------------\\
201 + //-- RAILWAY CONSTANTS --\\
202 + //------------------------------------------------------------\\
203 + const int TRACK_SEGMENTS = 48;
204 + const int NUM_TRAINS = 11;
205 + const int NUM_POINTS = 28;
206 + const int NO_TRACK = -1;
207 +
208 + //------------------------------------------------------------\\
209 + //-- RAILWAY INTERFACE --\\
210 + //------------------------------------------------------------\\
211 + const int OFF = 0, RED = 1, YELLOW = 2, GREEN = 4;
212 + const int ON = 1, OFF = 0, FWD = 1, REV = 2, BRAKE = 3;
213 +
214 + const int DOWN = 0, UP = 1;
215 + const int NONE = 0, UNI = 3;
216 +
217 + const int STRAIGHT = 0, BRANCH = 1;
218 +
219 + const int IC_JCT_0 = 0 , IC_LN_0 = 1 , IC_LN_1 = 2 , IC_LN_2 = 3;
220 + const int IC_LN_3 = 4 , IC_LN_4 = 5 , IC_LN_5 = 6 , IC_ST_0 = 7;
221 + const int IC_ST_1 = 8 , IC_ST_2 = 9 , IC_ST_3 = 10, IC_ST_4 = 11;
222 + const int IO_LN_0 = 12, IO_LN_1 = 13, IO_LN_2 = 14;
223 +
224 + const int KH_LN_0 = 15, KH_LN_1 = 16, KH_LN_2 = 17, KH_LN_3 = 18;
225 + const int KH_LN_4 = 19, KH_LN_5 = 20, KH_LN_6 = 21, KH_LN_7 = 22;
226 + const int KH_LN_8 = 23, KH_ST_0 = 24, KH_ST_1 = 25, KH_ST_2 = 26;
227 + const int KH_ST_3 = 27, KH_ST_4 = 28, KH_ST_5 = 29, KH_ST_6 = 30;
228 + const int KIO_LN_0 = 31, KIO_LN_1 = 32;
229 +
230 + const int OC_JCT_0 = 33, OC_LN_0 = 34, OC_LN_1 = 35, OC_LN_2 = 36;
231 + const int OC_LN_3 = 37, OC_LN_4 = 38, OC_LN_5 = 39, OC_ST_0 = 40;
232 + const int OC_ST_1 = 41, OC_ST_2 = 42, OC_ST_3 = 43, OC_ST_4 = 44;
233 + const int OI_LN_0 = 45, OI_LN_1 = 46, OI_LN_2 = 47;
234 +
235 + initial state init;
236 +}
237 +{{/code}}
Confluence.Code.ConfluencePageClass[0]
Id
... ... @@ -1,1 +1,1 @@
1 -28672120
1 +28672122
URL
... ... @@ -1,1 +1,1 @@
1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/RP2/pages/28672120/Interface
1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/RP2/pages/28672122/Interface