Wiki source code of Usage Hardware Controller
Version 8.1 by stu115775 on 2017/08/24 00:31
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | === 1st Step === | ||
2 | |||
3 | Import and build Controller_SCTx in KIELER. | ||
4 | |||
5 | === 2nd Step === | ||
6 | |||
7 | Run run_manual.sh in code/girlsday | ||
8 | |||
9 | In the simulation this command also loads the train configuration and starts the controller with those positions. | ||
10 | |||
11 | Note: this uses any Controller.c file it finds in code/Controller_SCTx/ as tick file and accesses files in code/interface/ | ||
12 | |||
13 | === 3rd Step === | ||
14 | |||
15 | Run RailController in code/girlsday | ||
16 | |||
17 | = Options and Commands: = | ||
18 | |||
19 | Notes: | ||
20 | |||
21 | (% style="list-style-type: square;" %) | ||
22 | * Train 10 has special ICE-handling, so the ICE should always be assigned to this number, other Trains with this number stop for a while before parking. | ||
23 | * The Controller tries to connect to a WebProvider on localhost:8089 | ||
24 | * The JSON kivis file is in the current execution folder: 'json_output.simin' | ||
25 | * The Controller uses ANSI-Escape sequences to color the output and overwrite recived contact messages. | ||
26 | * The entered characteres are most likely not all visible since there may be quite some output while typing, so these commands are typed blind in this case | ||
27 | |||
28 | === Commandline options (order matters): === | ||
29 | |||
30 | {{{RailController [+] [s<fast_speed> [s<slow_speed>]] [<train1_pos> [<train2_pos> [...] | DEFAULT] | DEFAULT]}}} | ||
31 | |||
32 | \\ | ||
33 | |||
34 | (% class="wrapped" %) | ||
35 | |=((( | ||
36 | + | ||
37 | )))|((( | ||
38 | if present then there will be no startup hardware check which turns on the lamps and | ||
39 | switches each point twice and cycles thrue signal colors with some delay | ||
40 | ))) | ||
41 | |=((( | ||
42 | fast_speed | ||
43 | )))|((( | ||
44 | pre-sets the global driving speed for the trains. Default: 70 | ||
45 | ))) | ||
46 | |=((( | ||
47 | slow_speed | ||
48 | )))|((( | ||
49 | pre-sets the global parking speed for the trains. Default: 59 | ||
50 | ))) | ||
51 | |=((( | ||
52 | trainX_pos | ||
53 | )))|((( | ||
54 | sets the position of the train X, caseinsensitive, prefixed with '-' for reversed on bidirectional tracks, | ||
55 | valid only for segments (not for ex.: IC_JCT_0) | ||
56 | examples: KH_ST_2, K2, 26, -KH_LN_3, IC_ST_3, I3, 10, OC_LN_4 | ||
57 | ))) | ||
58 | |=(% colspan="1" %)(% colspan="1" %) | ||
59 | ((( | ||
60 | DEFAULT | ||
61 | )))|(% colspan="1" %)(% colspan="1" %) | ||
62 | ((( | ||
63 | fillst the remaining positions with the home Positons of each train | ||
64 | ))) | ||
65 | |||
66 | \\ | ||
67 | |||
68 | Valid track identifyer are the Track names (IC_ST_2, OC_LN_4), their numbers (9, 38) and for stations the short versions (I1, I2, I3, O1, O2, O3, K1, K2, K3, K4, K5). | ||
69 | If reverse is a possible information then a preceeding '-' signals this. All Track inputs should be case insensitive. | ||
70 | |||
71 | The Program will ask for positions if there aren't enough positions provided. Invalid Positions count as "Not placed on the Track" | ||
72 | |||
73 | === Commands: === | ||
74 | |||
75 | There is a handful of debug and settings commands, each has to be submitted with enter, commands with spaces in them need exactly one space between their words. | ||
76 | |||
77 | (% class="relative-table wrapped" style="width: 69.6654%;" %) | ||
78 | |=(% colspan="1" %)(% colspan="1" %) | ||
79 | ((( | ||
80 | <train_num> <target> | ||
81 | )))|(% colspan="1" %)(% colspan="1" %) | ||
82 | ((( | ||
83 | sets the target of a train | ||
84 | ))) | ||
85 | |=((( | ||
86 | sc | schedule | ||
87 | )))|((( | ||
88 | print requested locks for each train | ||
89 | ))) | ||
90 | |=((( | ||
91 | c | ||
92 | )))|((( | ||
93 | set destination of each train to their starting position | ||
94 | ))) | ||
95 | |=((( | ||
96 | reset trains | ||
97 | )))|((( | ||
98 | set destinbation of each train to their home position (coded into the controller) | ||
99 | ))) | ||
100 | |=((( | ||
101 | toggle bell | ||
102 | )))|((( | ||
103 | toggles the crossings-gate-bell On and Off | ||
104 | ))) | ||
105 | |=((( | ||
106 | toggle lamp <range> | ||
107 | )))|((( | ||
108 | toggles selected lamps On and Off | ||
109 | ))) | ||
110 | |=((( | ||
111 | enable lamp <range> | ||
112 | )))|((( | ||
113 | turns selected lamps On | ||
114 | ))) | ||
115 | |=((( | ||
116 | disable lamp <range> | ||
117 | )))|((( | ||
118 | turns selected löamps Off | ||
119 | ))) | ||
120 | |=((( | ||
121 | print tick | ||
122 | )))|((( | ||
123 | toggles the output of the current tick number each tick On and Off | ||
124 | ))) | ||
125 | |=((( | ||
126 | r | ||
127 | )))|((( | ||
128 | toggles randommode | ||
129 | ))) | ||
130 | |=((( | ||
131 | x | ||
132 | )))|((( | ||
133 | reconnects to the hardware | ||
134 | ))) | ||
135 | |=((( | ||
136 | t | ||
137 | )))|((( | ||
138 | prints positions of each train | ||
139 | ))) | ||
140 | |=((( | ||
141 | s | speeds | ||
142 | )))|((( | ||
143 | prints the speeds for each track | ||
144 | ))) | ||
145 | |=((( | ||
146 | st | " " | ||
147 | )))|((( | ||
148 | (second option is only a space) toggles stop mode, which sets all hardware speeds to 0 | ||
149 | ))) | ||
150 | |=((( | ||
151 | pt <point_num> | ||
152 | )))|((( | ||
153 | toggles a Point, only works when the point isn't locked | ||
154 | ))) | ||
155 | |=((( | ||
156 | ts | ||
157 | )))|((( | ||
158 | prints the 4 speeds of each train (2nd and 4th number are the used slow and fast speeds) | ||
159 | ))) | ||
160 | |=((( | ||
161 | setspeed [t<train_num>] <fast_speed> [slowspeed] | ||
162 | )))|((( | ||
163 | sets the global or train specific speeds | ||
164 | ))) | ||
165 | |=((( | ||
166 | reach_t <track> | ||
167 | )))|((( | ||
168 | (DEBUG)sends a reached signal from this track | ||
169 | ))) | ||
170 | |=((( | ||
171 | reach <train_num> | ||
172 | )))|((( | ||
173 | (DEBUG) sends a reached signal for given train | ||
174 | ))) | ||
175 | |=((( | ||
176 | sim [s|e]<track> | ||
177 | )))|((( | ||
178 | (DEBUG) simulates the contacts on a track. s: only the first contact, e: only the second contact (no space after s or e) | ||
179 | ))) | ||
180 | |=((( | ||
181 | dest | ||
182 | )))|((( | ||
183 | prints entered destination for each train | ||
184 | ))) | ||
185 | |=(% colspan="1" %)(% colspan="1" %) | ||
186 | ((( | ||
187 | time | ||
188 | )))|(% colspan="1" %)(% colspan="1" %) | ||
189 | ((( | ||
190 | prints maximum and average time for different loop parts (stdin, input, tick, output), partition may not be fully accurate | ||
191 | ))) | ||
192 | |=(% colspan="1" %)(% colspan="1" %) | ||
193 | ((( | ||
194 | trains | ||
195 | )))|(% colspan="1" %)(% colspan="1" %) | ||
196 | ((( | ||
197 | prints for each track the train ontop | ||
198 | ))) | ||
199 | |=(% colspan="1" %)(% colspan="1" %) | ||
200 | ((( | ||
201 | move [on|off] | ||
202 | )))|(% colspan="1" %)(% colspan="1" %) | ||
203 | ((( | ||
204 | toggles or sets moveing mode, which sends some trains to two toggeling destinations, with some time waiting in a station | ||
205 | ))) | ||
206 | |=(% colspan="1" %)(% colspan="1" %) | ||
207 | ((( | ||
208 | move_time <time> | ||
209 | )))|(% colspan="1" %)(% colspan="1" %) | ||
210 | ((( | ||
211 | sets waiting time in stations for moveing mode in ms (1000 = 1s) | ||
212 | ))) | ||
213 | |=(% colspan="1" %)(% colspan="1" %) | ||
214 | ((( | ||
215 | clear | ||
216 | )))|(% colspan="1" %)(% colspan="1" %) | ||
217 | ((( | ||
218 | sets each destination to 0 (= IC_JCT_0 => Invalid, no Destination) | ||
219 | ))) | ||
220 | |=(% colspan="1" %)(% colspan="1" %) | ||
221 | ((( | ||
222 | deb | ||
223 | )))|(% colspan="1" %)(% colspan="1" %) | ||
224 | ((( | ||
225 | currently has no effect, may be used for requested debug output | ||
226 | ))) | ||
227 | |=(% colspan="1" %)(% colspan="1" %) | ||
228 | ((( | ||
229 | block <train_num> | ||
230 | )))|(% colspan="1" %)(% colspan="1" %) | ||
231 | ((( | ||
232 | toggles the 'dont_force_destination' input for the train. If enabled, this train would not start moveing to make space for another train | ||
233 | ))) | ||
234 | |=(% colspan="1" %)(% colspan="1" %) | ||
235 | ((( | ||
236 | webprovider debug | ||
237 | )))|(% colspan="1" %)(% colspan="1" %) | ||
238 | ((( | ||
239 | toggles webprovider communication debug outputs | ||
240 | ))) | ||
241 | |=(% colspan="1" %)(% colspan="1" %) | ||
242 | ((( | ||
243 | json output | ||
244 | )))|(% colspan="1" %)(% colspan="1" %) | ||
245 | ((( | ||
246 | toggles the creation of a '.simin' JSON file for kivis every 2s | ||
247 | ))) | ||
248 | |||
249 | \\ | ||
250 | |||
251 | Examples for ranges: | ||
252 | 3 | ||
253 | 3-7 | ||
254 | 2-9,11,13-9 | ||
255 | |||
256 | \\ | ||
257 | |||
258 | \\ |