Skip to content

Commit 3661c72

Browse files
author
Olivier Butler
committed
add start with beacon
1 parent 0f5c332 commit 3661c72

File tree

3 files changed

+109
-37
lines changed

3 files changed

+109
-37
lines changed

data/po/strings.pot

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
msgid ""
88
msgstr "Project-Id-Version: PACKAGE VERSION\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2025-01-07 07:25+0200\n"
10+
"POT-Creation-Date: 2025-01-08 19:27+0200\n"
1111
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1212
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1313
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,52 +16,52 @@ msgstr "Project-Id-Version: PACKAGE VERSION\n"
1616
"Content-Type: text/plain; charset=UTF-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
1818

19-
#: src/bp.c:1103 src/bp.c:1104 src/bp.c:1105
19+
#: src/bp.c:1103 src/bp.c:1104 src/bp.c:1105 src/bp.c:1107 src/bp.c:1108
2020
#, c-format
2121
msgid "Pushback failure: X-Plane version too old. This plugin requires at "
2222
"least X-Plane %s to operate."
2323
msgstr ""
2424

25-
#: src/bp.c:1113 src/bp.c:1114 src/bp.c:1115
25+
#: src/bp.c:1113 src/bp.c:1114 src/bp.c:1115 src/bp.c:1117 src/bp.c:1118
2626
msgid "Pushback failure: error reading aircraft files from disk."
2727
msgstr ""
2828

29-
#: src/bp.c:1178 src/bp.c:1179 src/bp.c:1180
29+
#: src/bp.c:1178 src/bp.c:1179 src/bp.c:1180 src/bp.c:1182 src/bp.c:1183
3030
msgid "Pushback failure: error initialising audio messages. Please "
3131
"reinstall BetterPushback."
3232
msgstr ""
3333

34-
#: src/bp.c:1191 src/bp.c:1192 src/bp.c:1193
34+
#: src/bp.c:1191 src/bp.c:1192 src/bp.c:1193 src/bp.c:1195 src/bp.c:1196
3535
msgid "Pushback failure: aircraft not on ground."
3636
msgstr ""
3737

38-
#: src/bp.c:1199 src/bp.c:1200 src/bp.c:1201
38+
#: src/bp.c:1199 src/bp.c:1200 src/bp.c:1201 src/bp.c:1203 src/bp.c:1204
3939
msgid "Pushback failure: aircraft not stationary."
4040
msgstr ""
4141

42-
#: src/bp.c:1206 src/bp.c:1207 src/bp.c:1208
42+
#: src/bp.c:1206 src/bp.c:1207 src/bp.c:1208 src/bp.c:1210 src/bp.c:1211
4343
msgid "Pushback failure: gear not extended."
4444
msgstr ""
4545

46-
#: src/bp.c:1224 src/bp.c:1225 src/bp.c:1226
46+
#: src/bp.c:1224 src/bp.c:1225 src/bp.c:1226 src/bp.c:1228 src/bp.c:1229
4747
msgid "Disconnect tow + headset and switch to hand signals."
4848
msgstr ""
4949

50-
#: src/bp.c:1226 src/bp.c:1227 src/bp.c:1228
50+
#: src/bp.c:1226 src/bp.c:1227 src/bp.c:1228 src/bp.c:1230 src/bp.c:1231
5151
msgid "Reconnect tow and await further instructions."
5252
msgstr ""
5353

54-
#: src/bp.c:1321 src/bp.c:1322 src/bp.c:1323
54+
#: src/bp.c:1321 src/bp.c:1322 src/bp.c:1323 src/bp.c:1325 src/bp.c:1326
5555
msgid "Pushback advisory: you have your radio volume turned very low and "
5656
"may not be able to hear ground crew. Please increase your radio "
5757
"volume in the X-Plane sound preferences."
5858
msgstr ""
5959

60-
#: src/bp.c:1495 src/bp.c:1496 src/bp.c:1500
60+
#: src/bp.c:1495 src/bp.c:1496 src/bp.c:1500 src/bp.c:1502 src/bp.c:1503
6161
msgid "Pushback failure: aircraft is not compatible with BetterPushback."
6262
msgstr ""
6363

64-
#: src/bp.c:1505 src/bp.c:1506 src/bp.c:1510
64+
#: src/bp.c:1505 src/bp.c:1506 src/bp.c:1510 src/bp.c:1512 src/bp.c:1513
6565
msgid "Pushback failure: cannot push this aircraft with engines running. "
6666
"Shutdown engines first."
6767
msgstr ""
@@ -71,12 +71,13 @@ msgid "Some doors are still opened or the GPU or the ASU are still "
7171
"I will proceed."
7272
msgstr ""
7373

74-
#: src/bp.c:1517 src/bp.c:1518 src/bp.c:1522
74+
#: src/bp.c:1517 src/bp.c:1518 src/bp.c:1522 src/bp.c:1524 src/bp.c:1525
7575
msgid "Pushback failure: please first plan your pushback to tell me where "
7676
"you want to go."
7777
msgstr ""
7878

7979
#: src/bp.c:1863 src/bp.c:1864 src/bp.c:1866 src/bp.c:1867 src/bp.c:1871
80+
#: src/bp.c:1873 src/bp.c:1874
8081
#, c-format
8182
msgid "ERROR: master requested tug \"%s\", which we don't have in our in "
8283
"our library. Please sync your tug libraries before trying again."
@@ -99,7 +100,7 @@ msgid "Hey! Quit blinding me with your taxi light! Turn it off!"
99100
msgstr ""
100101

101102
#: src/bp.c:3160 src/bp.c:3161 src/bp.c:3187 src/bp.c:3189 src/bp.c:3188
102-
#: src/bp.c:3192 src/bp.c:3185
103+
#: src/bp.c:3192 src/bp.c:3185 src/bp.c:3201 src/bp.c:3202 src/bp.c:3209
103104
msgid "Pushback failure: your flight controls are preventing me from "
104105
"steering the aircraft. Unbind any buttons you have set to \"toggle "
105106
"nosewheel steering\"."
@@ -401,98 +402,119 @@ msgstr ""
401402
#: src/bp.c:2331 src/bp.c:3290 src/bp.c:2332 src/bp.c:3291 src/bp.c:2358
402403
#: src/bp.c:3317 src/bp.c:2360 src/bp.c:3319 src/bp.c:2359 src/bp.c:3318
403404
#: src/bp.c:2363 src/bp.c:3324 src/bp.c:3326 src/bp.c:2356 src/bp.c:3315
405+
#: src/bp.c:3335 src/bp.c:3336 src/bp.c:3341
404406
msgid "Waiting for the parking brakes set"
405407
msgstr ""
406408

407409
#: src/bp.c:3250 src/bp.c:3251 src/bp.c:3277 src/bp.c:3279 src/bp.c:3278
408-
#: src/bp.c:3284 src/bp.c:3285 src/bp.c:3275
410+
#: src/bp.c:3284 src/bp.c:3285 src/bp.c:3275 src/bp.c:3294 src/bp.c:3295
411+
#: src/bp.c:3300
409412
msgid "Push-back called"
410413
msgstr ""
411414

412415
#: src/bp.c:3254 src/bp.c:3255 src/bp.c:3281 src/bp.c:3283 src/bp.c:3282
413-
#: src/bp.c:3288 src/bp.c:3290 src/bp.c:3279
416+
#: src/bp.c:3288 src/bp.c:3290 src/bp.c:3279 src/bp.c:3299 src/bp.c:3300
417+
#: src/bp.c:3305
414418
msgid "Driving to the aircraft"
415419
msgstr ""
416420

417421
#: src/bp.c:3258 src/bp.c:3262 src/bp.c:3259 src/bp.c:3263 src/bp.c:3285
418422
#: src/bp.c:3289 src/bp.c:3287 src/bp.c:3291 src/bp.c:3286 src/bp.c:3290
419423
#: src/bp.c:3292 src/bp.c:3296 src/bp.c:3294 src/bp.c:3298 src/bp.c:3283
424+
#: src/bp.c:3303 src/bp.c:3307 src/bp.c:3304 src/bp.c:3308 src/bp.c:3309
425+
#: src/bp.c:3313
420426
msgid "Waiting for doors/GPU/ASU closed/disconnected"
421427
msgstr ""
422428

423429
#: src/bp.c:3264 src/bp.c:3265 src/bp.c:3291 src/bp.c:3293 src/bp.c:3292
424-
#: src/bp.c:3298 src/bp.c:3300 src/bp.c:3289
430+
#: src/bp.c:3298 src/bp.c:3300 src/bp.c:3289 src/bp.c:3309 src/bp.c:3310
431+
#: src/bp.c:3315
425432
msgid "Opening the cradle"
426433
msgstr ""
427434

428435
#: src/bp.c:3294 src/bp.c:3295 src/bp.c:3321 src/bp.c:3323 src/bp.c:3322
429-
#: src/bp.c:3328 src/bp.c:3330 src/bp.c:3319
436+
#: src/bp.c:3328 src/bp.c:3330 src/bp.c:3319 src/bp.c:3339 src/bp.c:3340
437+
#: src/bp.c:3345
430438
msgid "Connecting to the aircraft"
431439
msgstr ""
432440

433441
#: src/bp.c:3306 src/bp.c:3307 src/bp.c:3333 src/bp.c:3335 src/bp.c:3334
434-
#: src/bp.c:3340 src/bp.c:3342 src/bp.c:3331
442+
#: src/bp.c:3340 src/bp.c:3342 src/bp.c:3331 src/bp.c:3351 src/bp.c:3352
443+
#: src/bp.c:3357
435444
msgid "Connected to the aircraft"
436445
msgstr ""
437446

438447
#: src/bp.c:3310 src/bp.c:3311 src/bp.c:3337 src/bp.c:3339 src/bp.c:3338
439-
#: src/bp.c:3344 src/bp.c:3346 src/bp.c:3335
448+
#: src/bp.c:3344 src/bp.c:3346 src/bp.c:3335 src/bp.c:3355 src/bp.c:3356
449+
#: src/bp.c:3361
440450
msgid "Push-back started"
441451
msgstr ""
442452

443453
#: src/bp.c:3335 src/bp.c:3336 src/bp.c:3362 src/bp.c:3364 src/bp.c:3363
444-
#: src/bp.c:3369 src/bp.c:3371 src/bp.c:3360
454+
#: src/bp.c:3369 src/bp.c:3371 src/bp.c:3360 src/bp.c:3380 src/bp.c:3381
455+
#: src/bp.c:3386
445456
msgid "Push-back in progress"
446457
msgstr ""
447458

448459
#: src/bp.c:3339 src/bp.c:3340 src/bp.c:3366 src/bp.c:3368 src/bp.c:3367
449-
#: src/bp.c:3373 src/bp.c:3375 src/bp.c:3364
460+
#: src/bp.c:3373 src/bp.c:3375 src/bp.c:3364 src/bp.c:3384 src/bp.c:3385
461+
#: src/bp.c:3390
450462
msgid "Push-back stopping"
451463
msgstr ""
452464

453465
#: src/bp.c:3343 src/bp.c:3344 src/bp.c:3370 src/bp.c:3372 src/bp.c:3371
454-
#: src/bp.c:3377 src/bp.c:3379 src/bp.c:3368
466+
#: src/bp.c:3377 src/bp.c:3379 src/bp.c:3368 src/bp.c:3388 src/bp.c:3389
467+
#: src/bp.c:3394
455468
msgid "Push-back stopped"
456469
msgstr ""
457470

458471
#: src/bp.c:3347 src/bp.c:3348 src/bp.c:3374 src/bp.c:3376 src/bp.c:3375
459-
#: src/bp.c:3381 src/bp.c:3383 src/bp.c:3372
472+
#: src/bp.c:3381 src/bp.c:3383 src/bp.c:3372 src/bp.c:3392 src/bp.c:3393
473+
#: src/bp.c:3398
460474
msgid "Lowering the nose"
461475
msgstr ""
462476

463477
#: src/bp.c:3351 src/bp.c:3352 src/bp.c:3378 src/bp.c:3380 src/bp.c:3379
464-
#: src/bp.c:3385 src/bp.c:3387 src/bp.c:3376
478+
#: src/bp.c:3385 src/bp.c:3387 src/bp.c:3376 src/bp.c:3396 src/bp.c:3397
479+
#: src/bp.c:3402
465480
msgid "Ungrabbing the nose"
466481
msgstr ""
467482

468483
#: src/bp.c:3355 src/bp.c:3356 src/bp.c:3382 src/bp.c:3384 src/bp.c:3383
469-
#: src/bp.c:3389 src/bp.c:3391 src/bp.c:3380
484+
#: src/bp.c:3389 src/bp.c:3391 src/bp.c:3380 src/bp.c:3400 src/bp.c:3401
485+
#: src/bp.c:3406
470486
msgid "Waiting the OK to disconnect"
471487
msgstr ""
472488

473489
#: src/bp.c:3359 src/bp.c:3360 src/bp.c:3386 src/bp.c:3388 src/bp.c:3387
474-
#: src/bp.c:3393 src/bp.c:3395 src/bp.c:3384
490+
#: src/bp.c:3393 src/bp.c:3395 src/bp.c:3384 src/bp.c:3404 src/bp.c:3405
491+
#: src/bp.c:3410
475492
msgid "Disconnecting the tug away from the aircraft"
476493
msgstr ""
477494

478495
#: src/bp.c:3400 src/bp.c:3401 src/bp.c:3427 src/bp.c:3429 src/bp.c:3428
479-
#: src/bp.c:3434 src/bp.c:3436 src/bp.c:3425
496+
#: src/bp.c:3434 src/bp.c:3436 src/bp.c:3425 src/bp.c:3445 src/bp.c:3446
497+
#: src/bp.c:3451
480498
msgid "Closing the cradle"
481499
msgstr ""
482500

483501
#: src/bp.c:3404 src/bp.c:3408 src/bp.c:3405 src/bp.c:3409 src/bp.c:3431
484502
#: src/bp.c:3435 src/bp.c:3433 src/bp.c:3437 src/bp.c:3432 src/bp.c:3436
485503
#: src/bp.c:3438 src/bp.c:3442 src/bp.c:3440 src/bp.c:3444 src/bp.c:3429
504+
#: src/bp.c:3449 src/bp.c:3453 src/bp.c:3450 src/bp.c:3454 src/bp.c:3455
505+
#: src/bp.c:3459
486506
msgid "Moving to the side of the aircraft"
487507
msgstr ""
488508

489509
#: src/bp.c:3415 src/bp.c:3416 src/bp.c:3442 src/bp.c:3444 src/bp.c:3443
490-
#: src/bp.c:3449 src/bp.c:3451 src/bp.c:3440
510+
#: src/bp.c:3449 src/bp.c:3451 src/bp.c:3440 src/bp.c:3460 src/bp.c:3461
511+
#: src/bp.c:3466
491512
msgid "Showing the pin and the clear signal"
492513
msgstr ""
493514

494515
#: src/bp.c:3419 src/bp.c:3420 src/bp.c:3446 src/bp.c:3448 src/bp.c:3447
495-
#: src/bp.c:3453 src/bp.c:3455 src/bp.c:3444
516+
#: src/bp.c:3453 src/bp.c:3455 src/bp.c:3444 src/bp.c:3464 src/bp.c:3465
517+
#: src/bp.c:3470
496518
msgid "Driving the tug away back to his station"
497519
msgstr ""
498520

@@ -502,12 +524,14 @@ msgid "Connected to the aircraft, waiting for clearance"
502524
msgstr ""
503525

504526
#: src/bp.c:3302 src/bp.c:3303 src/bp.c:3329 src/bp.c:3331 src/bp.c:3330
505-
#: src/bp.c:3336 src/bp.c:3338 src/bp.c:3327
527+
#: src/bp.c:3336 src/bp.c:3338 src/bp.c:3327 src/bp.c:3347 src/bp.c:3348
528+
#: src/bp.c:3353
506529
msgid "Lifting the aircraft"
507530
msgstr ""
508531

509532
#: src/bp.c:3298 src/bp.c:3299 src/bp.c:3325 src/bp.c:3327 src/bp.c:3326
510-
#: src/bp.c:3332 src/bp.c:3334 src/bp.c:3323
533+
#: src/bp.c:3332 src/bp.c:3334 src/bp.c:3323 src/bp.c:3343 src/bp.c:3344
534+
#: src/bp.c:3349
511535
msgid "Grabbing the aircraft"
512536
msgstr ""
513537

src/bp.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ static XPWidgetID bp_hint_status = NULL;
190190
const char *bp_hint_status_str = NULL;
191191
const char *bp_hint_previous_status_str = NULL;
192192

193+
static int previous_beacon = 0;
194+
bool_t tug_pending_mode = B_FALSE;
195+
193196
static bool_t read_acf_file_info(void);
194197

195198
static float bp_run(float elapsed, float elapsed2, int counter, void *refcon);
@@ -2712,7 +2715,12 @@ main_win_click(XPLMWindowID inWindowID, int mx, int my, XPLMMouseStatus inMouse,
27122715
}
27132716

27142717
if (button_hit == 2) {
2715-
XPLMCommandOnce(start_pb);
2718+
if (tug_pending_mode) {
2719+
tug_pending_mode = B_FALSE;
2720+
}
2721+
else {
2722+
XPLMCommandOnce(start_pb);
2723+
}
27162724
return (1);
27172725
}
27182726

@@ -2803,6 +2811,22 @@ main_intf_show(void) {
28032811
bool_t always_connect_tug_first = B_FALSE;
28042812
(void) conf_get_b(bp_conf,"always_connect_tug_first", &always_connect_tug_first);
28052813

2814+
bool_t tug_starts_next_plane = B_FALSE;
2815+
(void) conf_get_b(bp_conf,"tug_starts_next_plane", &tug_starts_next_plane);
2816+
2817+
bool_t tug_auto_start = B_FALSE;
2818+
(void) conf_get_b(bp_conf,"tug_auto_start", &tug_auto_start);
2819+
2820+
if(start_pb_enable) {
2821+
int beacon_light = dr_geti(&drs.beacon_light);
2822+
if ( (previous_beacon == 0) && (beacon_light) ) {
2823+
previous_beacon = beacon_light;
2824+
tug_pending_mode = B_TRUE;
2825+
XPLMCommandOnce(conn_first);
2826+
}
2827+
previous_beacon = beacon_light;
2828+
}
2829+
28062830
if ((bp_ls.planner_win == NULL) && (bp_ls.start_pb_win == NULL) && (bp_ls.conn_tug_first == NULL) && (bp_ls.pb_status_win == NULL) ) {
28072831
initMonitorOrigin();
28082832
}
@@ -2865,7 +2889,7 @@ main_intf_show(void) {
28652889
}
28662890
magic_buttons[0].wind_id = (!bp_started && !always_connect_tug_first) ? bp_ls.planner_win : NULL;
28672891
magic_buttons[1].wind_id = (!bp_started && !always_connect_tug_first) ? bp_ls.conn_tug_first : NULL;
2868-
magic_buttons[2].wind_id = !bp_started || ( ( bp.step == PB_STEP_LIFTING) && late_plan_requested) ? bp_ls.start_pb_win : NULL;
2892+
magic_buttons[2].wind_id = tug_pending_mode || !bp_started || ( ( bp.step == PB_STEP_LIFTING) && late_plan_requested) ? bp_ls.start_pb_win : NULL;
28692893
magic_buttons[3].wind_id = bp_started ? bp_ls.pb_status_win : NULL;
28702894
}
28712895

@@ -3272,8 +3296,10 @@ bp_run(float elapsed, float elapsed2, int counter, void *refcon) {
32723296
return (0);
32733297
break;
32743298
case PB_STEP_START:
3299+
if (!tug_pending_mode) {
32753300
bp_hint_status_str = _("Push-back called");
32763301
pb_step_start();
3302+
}
32773303
break;
32783304
case PB_STEP_DRIVING_UP_CLOSE:
32793305
bp_hint_status_str = _("Driving to the aircraft");

src/cfg.cpp

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static bool_t gui_inited = B_FALSE;
5656
bool_t setup_view_callback_is_alive = B_FALSE;
5757

5858
#define MAIN_WINDOW_W 800
59-
#define MAIN_WINDOW_H 650
59+
#define MAIN_WINDOW_H 700
6060

6161
#define ROUNDED 8.0f
6262
#define TOOLTIP_BG_COLOR ImVec4(0.2f, 0.3f, 0.8f, 1.0f)
@@ -132,6 +132,8 @@ const char *always_connect_tug_first_tooltip =
132132
"command.";
133133
const char *tug_starts_next_plane_tooltip =
134134
"The tug appears next to the plane avoiding in certain case the tug travelling inside the buildings.";
135+
const char *tug_auto_start_tooltip =
136+
"The tug will appear once the beacon light is on.";
135137
const char *ignore_park_brake_tooltip =
136138
"Never check \"set parking brake\".\n"
137139
"Some aircraft stuck on this check.\n"
@@ -250,6 +252,7 @@ class SettingsWindow : public XPImgWindow {
250252
bool_t xp11_only;
251253
bool_t is_destroy;
252254
bool_t tug_starts_next_plane;
255+
bool_t tug_auto_start;
253256
int monitor_id;
254257
int for_credit;
255258
int magic_squares_height;
@@ -315,7 +318,10 @@ void SettingsWindow::LoadConfig(void) {
315318
&always_connect_tug_first);
316319

317320
tug_starts_next_plane = B_FALSE;
318-
(void) conf_get_b(bp_conf,"tug_starts_next_plane", &tug_starts_next_plane);
321+
(void) conf_get_b(bp_conf,"tug_starts_next_plane", &tug_starts_next_plane);
322+
323+
tug_auto_start = B_FALSE;
324+
(void) conf_get_b(bp_conf,"tug_auto_start", &tug_auto_start);
319325

320326
initMonitorOrigin();
321327

@@ -679,7 +685,7 @@ void SettingsWindow::buildInterface() {
679685
ImGui::TableNextRow();
680686
ImGui::TableNextColumn();
681687
ImGui::Text("%s", _("Tug starts near the aircraft"));
682-
Tooltip(_(always_connect_tug_first_tooltip));
688+
Tooltip(_(tug_starts_next_plane_tooltip));
683689

684690
ImGui::TableNextColumn();
685691
if (ImGui::Checkbox("##tug_starts_next_plane",
@@ -688,6 +694,22 @@ void SettingsWindow::buildInterface() {
688694
tug_starts_next_plane);
689695
}
690696

697+
ImGui::TableNextRow();
698+
ImGui::TableNextColumn();
699+
ImGui::Text("%s", _("Tug auto start"));
700+
Tooltip(_(tug_auto_start_tooltip));
701+
702+
ImGui::TableNextColumn();
703+
if (ImGui::Checkbox("##tug_auto_start",
704+
(bool *)&tug_auto_start)) {
705+
(void)conf_set_b(bp_conf, "tug_auto_start",
706+
tug_auto_start);
707+
}
708+
709+
tug_auto_start = B_FALSE;
710+
(void) conf_get_b(bp_conf,"tug_auto_start", &tug_auto_start);
711+
712+
691713
ImGui::TableNextRow();
692714
ImGui::TableNextColumn();
693715
ImGui::Text("%s", _("Eye Tracker Plugin Exclusion"));

0 commit comments

Comments
 (0)