-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleverframe.cxx
391 lines (354 loc) · 24.2 KB
/
leverframe.cxx
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
#include "leverframe.hxx"
EWRB::LeverFrame::LeverFrame(QWidget* parent)
{
_parent = parent;
_frame_svg = new QSvgWidget(QString(":/svgs/svgs/EWRBFrame.svg"), _parent);
const Scaler* scaler_ = new Scaler;
_frame_svg->setFixedSize(scaler_->screen_width(), scaler_->screen_height());
track_circuits_ = TrackCircuits(parent);
for(int i{1}; i < 13; ++i)
{
_levers[i] = new EWRB::HomeLever(i, _parent);
_levers[i]->PlaceAt(scaler_->scale_width(22+(i-1)*24.1), 0.7*scaler_->screen_height());
_levers[i]->showSVG();
}
for(int i{13}; i < 28; ++i)
{
if(i == 16)
{
_levers[i] = new EWRB::SpareLever(i, _parent);
}
else if(i == 24 || i == 25)
{
_levers[i] = new EWRB::EmergencySignalReleaseLever(i, _parent);
}
else
{
_levers[i] = new EWRB::PointsLever(i, _parent);
}
if(i != 16 && i != 18)
{ _indicators[i] = new EWRB::PointsIndicator((EWRB::PointsLever*)_levers[i], _parent);
_indicators[i]->PlaceAt(scaler_->scale_width(291+(i-12)*24.05), scaler_->scale_height(367));
}
_levers[i]->PlaceAt(scaler_->scale_width(22+(i-1)*24.1), 0.7*scaler_->screen_height());
_levers[i]->showSVG();
}
for(int i{28}; i < 39; ++i)
{
_levers[i] = new EWRB::HomeLever(i, _parent);
_levers[i]->PlaceAt(scaler_->scale_width(22+(i-1)*24.1), 0.7*scaler_->screen_height());
_levers[i]->showSVG();
}
for(int i{1}; i < 8; ++i)
{
_lever_sounds.append(new QSoundEffect);
_lever_sounds[i-1]->setSource(QUrl::fromLocalFile(":/audio/audio/lever_move_"+QString::number(i)+".wav"));
}
_lever_failed->setSource(QUrl::fromLocalFile(":/audio/audio/lever_fail.wav"));
connect(_levers[13], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd13(EWRB::LeverState)));
connect(_levers[14], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd14(EWRB::LeverState)));
connect(_levers[15], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd15(EWRB::LeverState)));
connect(_levers[17], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd17(EWRB::LeverState)));
connect(_levers[19], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd19(EWRB::LeverState)));
connect(_levers[20], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd20(EWRB::LeverState)));
connect(_levers[21], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd21(EWRB::LeverState)));
connect(_levers[22], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd22(EWRB::LeverState)));
connect(_levers[23], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd23(EWRB::LeverState)));
connect(_levers[26], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd26(EWRB::LeverState)));
connect(_levers[27], SIGNAL(sendCurrentLeverDestination(EWRB::LeverState)), this, SLOT(updatePointsInd27(EWRB::LeverState)));
}
void EWRB::LeverFrame::_play_random_lever_sound()
{
QSoundEffect* sound = _lever_sounds.at(qrand() % _lever_sounds.size());
sound->play();
}
void EWRB::LeverFrame::updatePointsInd13(EWRB::LeverState state)
{
_indicators[13]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[13]->update();
}
void EWRB::LeverFrame::updatePointsInd14(EWRB::LeverState state)
{
_indicators[14]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[14]->update();
}
void EWRB::LeverFrame::updatePointsInd15(EWRB::LeverState state)
{
_indicators[15]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[15]->update();
}
void EWRB::LeverFrame::updatePointsInd17(EWRB::LeverState state)
{
_indicators[17]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[17]->update();
}
void EWRB::LeverFrame::updatePointsInd19(EWRB::LeverState state)
{
_indicators[19]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[19]->update();
}
void EWRB::LeverFrame::updatePointsInd20(EWRB::LeverState state)
{
_indicators[20]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[20]->update();
}
void EWRB::LeverFrame::updatePointsInd21(EWRB::LeverState state)
{
_indicators[21]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[21]->update();
}
void EWRB::LeverFrame::updatePointsInd22(EWRB::LeverState state)
{
_indicators[22]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[22]->update();
}
void EWRB::LeverFrame::updatePointsInd23(EWRB::LeverState state)
{
_indicators[23]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[23]->update();
}
void EWRB::LeverFrame::updatePointsInd26(EWRB::LeverState state)
{
_indicators[26]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[26]->update();
}
void EWRB::LeverFrame::updatePointsInd27(EWRB::LeverState state)
{
_indicators[27]->setState((state == EWRB::LeverState::Off) ? EWRB::PointsState::Normal : EWRB::PointsState::Reverse);
_indicators[27]->update();
}
void EWRB::LeverFrame::placeSigIndicators()
{
const Scaler* scaler_ = new Scaler;
for(int i{1}; i < 13; ++i)
{
if(i == 9) continue;
_sig_indicators[i]->PlaceAt(scaler_->scale_width(24+(i-1)*24), scaler_->scale_height(363));
}
for(int i{28}; i < 39; ++i)
{
_sig_indicators[i]->PlaceAt(scaler_->scale_width(24+(i-1)*24), scaler_->scale_height(363));
}
}
void EWRB::LeverFrame::placeTrackCircuitIndicators()
{
track_circuits_["UF"]->SetSize(scaler_->scale_width(39), scaler_->scale_height(39));
track_circuits_["UF"]->PlaceAt(scaler_->scale_width(157), scaler_->scale_height(159));
track_circuits_["UH"]->SetSize(scaler_->scale_width(39), scaler_->scale_height(39));
track_circuits_["UH"]->PlaceAt(scaler_->scale_width(177), scaler_->scale_height(160));
track_circuits_["UJ"]->SetSize(scaler_->scale_width(34), scaler_->scale_height(37));
track_circuits_["UJ"]->PlaceAt(scaler_->scale_width(204), scaler_->scale_height(157));
track_circuits_["UK"]->SetSize(scaler_->scale_width(39), scaler_->scale_height(39));
track_circuits_["UK"]->PlaceAt(scaler_->scale_width(227), scaler_->scale_height(159));
track_circuits_["UL"]->SetSize(scaler_->scale_width(75), scaler_->scale_height(37));
track_circuits_["UL"]->PlaceAt(scaler_->scale_width(256), scaler_->scale_height(160));
track_circuits_["AA"]->SetSize(scaler_->scale_width(76), scaler_->scale_height(38));
track_circuits_["AA"]->PlaceAt(scaler_->scale_width(318), scaler_->scale_height(152));
track_circuits_["AB"]->SetSize(scaler_->scale_width(76), scaler_->scale_height(39));
track_circuits_["AB"]->PlaceAt(scaler_->scale_width(390), scaler_->scale_height(136));
track_circuits_["AC"]->SetSize(scaler_->scale_width(112), scaler_->scale_height(40));
track_circuits_["AC"]->PlaceAt(scaler_->scale_width(441), scaler_->scale_height(136));
track_circuits_["AD"]->SetSize(scaler_->scale_width(39), scaler_->scale_height(39));
track_circuits_["AD"]->PlaceAt(scaler_->scale_width(531), scaler_->scale_height(135));
track_circuits_["AL"]->SetSize(scaler_->scale_width(74), scaler_->scale_height(57));
track_circuits_["AL"]->PlaceAt(scaler_->scale_width(543), scaler_->scale_height(122.5));
track_circuits_["AM"]->SetSize(scaler_->scale_width(39), scaler_->scale_height(40));
track_circuits_["AM"]->PlaceAt(scaler_->scale_width(604), scaler_->scale_height(157));
track_circuits_["AK"]->SetSize(scaler_->scale_width(55), scaler_->scale_height(42));
track_circuits_["AK"]->PlaceAt(scaler_->scale_width(552), scaler_->scale_height(160));
track_circuits_["AJ"]->SetSize(scaler_->scale_width(57), scaler_->scale_height(43));
track_circuits_["AJ"]->PlaceAt(scaler_->scale_width(505), scaler_->scale_height(157));
track_circuits_["CA"]->SetSize(scaler_->scale_width(152), scaler_->scale_height(39));
track_circuits_["CA"]->PlaceAt(scaler_->scale_width(421), scaler_->scale_height(114));
track_circuits_["UL"]->SetState(TrackCircuitStatus::Occupied);
track_circuits_["AO"]->SetSize(scaler_->scale_width(75), scaler_->scale_height(39));
track_circuits_["AO"]->PlaceAt(scaler_->scale_width(637), scaler_->scale_height(160));
track_circuits_["AP"]->SetSize(scaler_->scale_width(38), scaler_->scale_height(39));
track_circuits_["AP"]->PlaceAt(scaler_->scale_width(704), scaler_->scale_height(160));
track_circuits_["AQ_AS"]->SetSize(scaler_->scale_width(77), scaler_->scale_height(76));
track_circuits_["AQ_AS"]->PlaceAt(scaler_->scale_width(720), scaler_->scale_height(116));
track_circuits_["AE"]->SetSize(scaler_->scale_width(79), scaler_->scale_height(41));
track_circuits_["AE"]->PlaceAt(scaler_->scale_width(368), scaler_->scale_height(160));
track_circuits_["AF"]->SetSize(scaler_->scale_width(39), scaler_->scale_height(40));
track_circuits_["AF"]->PlaceAt(scaler_->scale_width(434), scaler_->scale_height(157));
track_circuits_["AG"]->SetSize(scaler_->scale_width(75), scaler_->scale_height(41));
track_circuits_["AG"]->PlaceAt(scaler_->scale_width(454), scaler_->scale_height(158));
track_circuits_["AV"]->SetSize(scaler_->scale_width(38), scaler_->scale_height(39));
track_circuits_["AV"]->PlaceAt(scaler_->scale_width(723), scaler_->scale_height(168));
track_circuits_["177_B"]->SetSize(scaler_->scale_width(37), scaler_->scale_height(38));
track_circuits_["177_B"]->PlaceAt(scaler_->scale_width(739), scaler_->scale_height(157));
track_circuits_["177_A_175_B"]->SetSize(scaler_->scale_width(38), scaler_->scale_height(39));
track_circuits_["177_A_175_B"]->PlaceAt(scaler_->scale_width(756), scaler_->scale_height(141));
track_circuits_["175_A_173"]->SetSize(scaler_->scale_width(72), scaler_->scale_height(39));
track_circuits_["175_A_173"]->PlaceAt(scaler_->scale_width(775), scaler_->scale_height(135));
track_circuits_["AX_AY_AZ"]->SetSize(scaler_->scale_width(75), scaler_->scale_height(37));
track_circuits_["AX_AY_AZ"]->PlaceAt(scaler_->scale_width(735 ), scaler_->scale_height(188));
track_circuits_["133"]->SetSize(scaler_->scale_width(35), scaler_->scale_height(37));
track_circuits_["133"]->PlaceAt(scaler_->scale_width(725), scaler_->scale_height(190));
track_circuits_["129_A"]->SetSize(scaler_->scale_width(39), scaler_->scale_height(38));
track_circuits_["129_A"]->PlaceAt(scaler_->scale_width(795), scaler_->scale_height(218));
track_circuits_["131_A_129_B"]->SetSize(scaler_->scale_width(37), scaler_->scale_height(39));
track_circuits_["131_A_129_B"]->PlaceAt(scaler_->scale_width(765), scaler_->scale_height(216));
track_circuits_["131_BC"]->SetSize(scaler_->scale_width(39), scaler_->scale_height(39));
track_circuits_["131_BC"]->PlaceAt(scaler_->scale_width(738), scaler_->scale_height(203));
track_circuits_["BA"]->SetSize(scaler_->scale_width(38), scaler_->scale_height(38));
track_circuits_["BA"]->PlaceAt(scaler_->scale_width(702), scaler_->scale_height(177));
track_circuits_["BB"]->SetSize(scaler_->scale_width(36), scaler_->scale_height(37));
track_circuits_["BB"]->PlaceAt(scaler_->scale_width(678), scaler_->scale_height(177));
track_circuits_["BC"]->SetSize(scaler_->scale_width(39), scaler_->scale_height(36));
track_circuits_["BC"]->PlaceAt(scaler_->scale_width(653), scaler_->scale_height(180));
track_circuits_["BD"]->SetSize(scaler_->scale_width(112), scaler_->scale_height(38));
track_circuits_["BD"]->PlaceAt(scaler_->scale_width(559), scaler_->scale_height(184));
track_circuits_["BL"]->SetSize(scaler_->scale_width(77), scaler_->scale_height(38));
track_circuits_["BL"]->PlaceAt(scaler_->scale_width(544), scaler_->scale_height(171));
track_circuits_["BM"]->SetSize(scaler_->scale_width(75), scaler_->scale_height(40));
track_circuits_["BM"]->PlaceAt(scaler_->scale_width(485), scaler_->scale_height(176));
track_circuits_["BN"]->SetSize(scaler_->scale_width(75), scaler_->scale_height(40));
track_circuits_["BN"]->PlaceAt(scaler_->scale_width(429), scaler_->scale_height(176));
track_circuits_["BP"]->SetSize(scaler_->scale_width(76), scaler_->scale_height(41));
track_circuits_["BP"]->PlaceAt(scaler_->scale_width(372), scaler_->scale_height(176));
track_circuits_["BQ"]->SetSize(scaler_->scale_width(75), scaler_->scale_height(38));
track_circuits_["BQ"]->PlaceAt(scaler_->scale_width(320), scaler_->scale_height(178));
track_circuits_["BV_BT_BR"]->SetSize(scaler_->scale_width(152), scaler_->scale_height(38));
track_circuits_["BV_BT_BR"]->PlaceAt(scaler_->scale_width(196), scaler_->scale_height(175));
track_circuits_["BJ"]->SetSize(scaler_->scale_width(77), scaler_->scale_height(37));
track_circuits_["BJ"]->PlaceAt(scaler_->scale_width(370), scaler_->scale_height(195));
track_circuits_["BH"]->SetSize(scaler_->scale_width(75), scaler_->scale_height(37));
track_circuits_["BH"]->PlaceAt(scaler_->scale_width(427), scaler_->scale_height(200));
track_circuits_["BE"]->SetSize(scaler_->scale_width(94), scaler_->scale_height(38));
track_circuits_["BE"]->PlaceAt(scaler_->scale_width(479), scaler_->scale_height(199));
}
void EWRB::LeverFrame::placeMapIndicators()
{
_map_indicators[1]->PlaceAt(scaler_->scale_width(243), scaler_->scale_height(159));
_map_indicators[2]->PlaceAt(scaler_->scale_width(302), scaler_->scale_height(159));
_map_indicators[4]->PlaceAt(scaler_->scale_width(359), scaler_->scale_height(154));
_map_indicators[5]->PlaceAt(scaler_->scale_width(548), scaler_->scale_height(196));
_map_indicators[6]->PlaceAt(scaler_->scale_width(548), scaler_->scale_height(160));
_map_indicators[7]->PlaceAt(scaler_->scale_width(548), scaler_->scale_height(137));
_map_indicators[8]->PlaceAt(scaler_->scale_width(302), scaler_->scale_height(201));
_map_indicators[10]->PlaceAt(scaler_->scale_width(542), scaler_->scale_height(120));
_map_indicators[11]->PlaceAt(scaler_->scale_width(695), scaler_->scale_height(161));
_map_indicators[28]->PlaceAt(scaler_->scale_width(413), scaler_->scale_height(160));
_map_indicators[29]->PlaceAt(scaler_->scale_width(413), scaler_->scale_height(196));
_map_indicators[30]->PlaceAt(scaler_->scale_width(413), scaler_->scale_height(218));
_map_indicators[31]->PlaceAt(scaler_->scale_width(585), scaler_->scale_height(205));
_map_indicators[32]->PlaceAt(scaler_->scale_width(645), scaler_->scale_height(164));
_map_indicators[33]->PlaceAt(scaler_->scale_width(633), scaler_->scale_height(196));
_map_indicators[36]->PlaceAt(scaler_->scale_width(685), scaler_->scale_height(196));
_map_indicators[37]->PlaceAt(scaler_->scale_width(739), scaler_->scale_height(196));
_map_indicators[38]->PlaceAt(scaler_->scale_width(754), scaler_->scale_height(169));
_map_indicators[39]->PlaceAt(scaler_->scale_width(789), scaler_->scale_height(238));
_map_indicators[40]->PlaceAt(scaler_->scale_width(791), scaler_->scale_height(155));
}
void EWRB::LeverFrame::placeDescribers()
{
const int start_x = 36;
const int start_y = 97;
addTrainDescriber(3, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+0*6));
addTrainDescriber(6, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+0*6));
addTrainDescriber(7, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+1*6));
addTrainDescriber(8, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+1*6));
addTrainDescriber(9, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+1*6));
addTrainDescriber(10, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+1*6));
addTrainDescriber(13, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+5*6));
addTrainDescriber(14, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+5*6));
addTrainDescriber(15, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+5*6));
addTrainDescriber(16, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+5*6));
addTrainDescriber(17, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+5*6));
addTrainDescriber(18, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+5*6));
addTrainDescriber(19, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+6*6));
addTrainDescriber(20, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+6*6));
addTrainDescriber(21, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+6*6));
addTrainDescriber(22, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+6*6));
addTrainDescriber(23, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+6*6));
addTrainDescriber(24, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+6*6));
addTrainDescriber(25, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+7*6));
addTrainDescriber(26, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+7*6));
addTrainDescriber(27, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+7*6));
addTrainDescriber(28, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+7*6));
addTrainDescriber(29, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+7*6));
addTrainDescriber(30, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+7*6));
addTrainDescriber(31, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+11*6));
addTrainDescriber(32, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+11*6));
addTrainDescriber(33, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+11*6));
addTrainDescriber(34, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+11*6));
addTrainDescriber(35, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+11*6));
addTrainDescriber(36, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+11*6));
addTrainDescriber(37, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+12*6));
addTrainDescriber(38, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+12*6));
addTrainDescriber(39, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+12*6));
addTrainDescriber(40, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+12*6));
addTrainDescriber(41, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+12*6));
addTrainDescriber(42, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+12*6));
addTrainDescriber(43, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+13*6));
addTrainDescriber(44, "C", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+13*6));
addTrainDescriber(45, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+13*6));
addTrainDescriber(46, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+13*6));
addTrainDescriber(47, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+13*6));
addTrainDescriber(48, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+13*6));
addTrainDescriber(49, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+17*6));
addTrainDescriber(50, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+17*6));
addTrainDescriber(51, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+17*6));
addTrainDescriber(52, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+17*6));
addTrainDescriber(53, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+17*6));
addTrainDescriber(54, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+17*6));
addTrainDescriber(55, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+18*6));
addTrainDescriber(56, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+18*6));
addTrainDescriber(57, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+18*6));
addTrainDescriber(58, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+18*6));
addTrainDescriber(59, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+18*6));
addTrainDescriber(60, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+18*6));
addTrainDescriber(61, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+19*6));
addTrainDescriber(62, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+19*6));
addTrainDescriber(64, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+19*6));
addTrainDescriber(65, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+19*6));
addTrainDescriber(66, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+19*6));
addTrainDescriber(67, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+23*6));
addTrainDescriber(68, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+23*6));
addTrainDescriber(69, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+23*6));
addTrainDescriber(70, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+23*6));
addTrainDescriber(71, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+23*6));
addTrainDescriber(72, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+23*6));
addTrainDescriber(73, "W", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+24*6));
addTrainDescriber(74, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+24*6));
addTrainDescriber(75, "W", scaler_->scale_width(start_x+2* 13), scaler_->scale_height(start_y+24*6));
addTrainDescriber(76, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+24*6));
addTrainDescriber(77, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+24*6));
addTrainDescriber(78, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+24*6));
addTrainDescriber(79, "HM", scaler_->scale_width(start_x+0* 13), scaler_->scale_height(start_y+25*6));
addTrainDescriber(80, "W", scaler_->scale_width(start_x+1* 13), scaler_->scale_height(start_y+25*6));
addTrainDescriber(82, "W", scaler_->scale_width(start_x+3* 13), scaler_->scale_height(start_y+25*6));
addTrainDescriber(83, "W", scaler_->scale_width(start_x+4* 13), scaler_->scale_height(start_y+25*6));
addTrainDescriber(84, "W", scaler_->scale_width(start_x+5* 13), scaler_->scale_height(start_y+25*6));
}
void EWRB::LeverFrame::update(const int& i)
{
qDebug() << "Running Frame Update...";
int signal_id = i;
if(i == 3) signal_id = 2;
else if (i == 34 || i == 35) signal_id = 33;
else if (i == 12) signal_id = 11;
if(i == -1)
{
for(auto si : _sig_indicators)
{
si->update();
}
for(auto mi : _map_indicators)
{
mi->update();
}
}
else
{
if(_map_indicators.contains(signal_id))
{
_map_indicators[signal_id]->update();
}
if(_sig_indicators.contains(i))_sig_indicators[i]->update();
}
for(const auto& tc : track_circuits_) {
tc->update();
}
}