1
0
Fork 0
Commit graph

585 commits

Author SHA1 Message Date
James Turner
90f14626f5 Guard against a possible crash in TowerController 2021-09-02 11:29:02 +01:00
James Turner
e58a06465c AI ATC: only use audio if enabled in the dialog
Patch by Stefan Frank, check the dialog checkbox setting before sending
messages to audio rather than text output.
2021-08-04 09:08:32 +01:00
portree_kid
45ac50d2b7 Time moving 2021-07-13 10:49:06 +01:00
legoboyvdlp R
3ab4de1436 De-Yodify false == conditions throughout the code-base 2021-06-24 15:29:10 +01:00
James Turner
a17180f5b0 ATCMgr: cache the destination property node
Avoid a per-update fgGetString call
2021-06-10 14:39:15 +01:00
James Turner
691abf25c5 ATC: fix crashes on shutdown 2021-06-10 14:39:15 +01:00
James Turner
8085d1fa2c Clear ATC on the user aircraft as well
Avoids an assert/crash on exit, in some ATC configurations.
2021-04-26 11:14:06 +01:00
James Turner
6e42b9ae02 Attempting to fix AIAircraft/controller crash
Add an assertion that controller has been cleared before the AIAircraft
destructor is run. If it’s not, then we are too late, don’t try to
sign off since the controller is probably gone.

Sentry-Id: FLIGHTGEAR-15
2021-04-25 19:18:56 +01:00
James Turner
adae75821d CommRadio frequency updates from Sascha Reißner
Reject invalid frequencies from apt.dat in the loader, and fix
25Khz encoding to be the exact value (i.e round frequencies ending
in 20 and 70 to 25 and 75)

Fix ATCdialog to show 3 digits of comm radio frequency at all times,
and remove its rounding-conversion.

Finally, expand the tests to capture the new behaviour. Test for
EPLL is disabled for now because it contains an invalid frequency.
2021-04-01 14:46:21 +01:00
Scott Giese
edf766481d Modernize: genTransponderCode()
update to c++
2021-02-21 01:26:50 -06:00
James Turner
b915d02f55 Fix crash in AI/Traffic code
Sentry-Id: FLIGHTGEAR-139
2021-02-04 16:11:08 +00:00
James Turner
64b03b70a8 Clear ATCDialog instance on reset
Showed up as a variety of crashes on Sentry, due
to a stale instance of this object hanging around
after reset.

Sentry-Id:FLIGHTGEAR-T5
2021-02-04 10:38:26 +00:00
Julian Smith
63fe407d80 src/ATC/trafficcontrol.hxx: fixed warning about const return value with no affect. 2020-11-01 00:03:03 +00:00
Automatic Release Builder
d75f05d4c0 ATC_mgr fix: clear user aircraft ATC on reposition
Avoids a stale controller causing crashes after a reposition. Triggered
by C172 tutorials.
2020-10-29 16:24:41 +00:00
Automatic Release Builder
eb1d8a7dc8 Fix trafific crash that was reported.
Probably an edge case of and edge case, but let's guard for it anyway,
since it causes traffic to terminate.

Sentry-Id: FLIGHTGEAR-2Q
2020-10-29 14:49:53 +00:00
James Turner
423c754009 Reposition: tolerate more scenarios in ATC_mgr
When starting at an airport, but not at parking or a runway, create
an empty AIFlightPlan, and ensure the AIManager code doesn’t choke on
empty FPs.

Add a unit-test which simulates the C172 tutorial reposition logic,
which is a little gnarly.
2020-10-27 18:32:18 +00:00
James Turner
3b01aaf33f Fix crash with missing airport in ATC
Sentry-Id: FLIGHTGEAR-ER
2020-10-25 20:14:10 +00:00
Scott Giese
7b914bc5fb Removed unreachable code 2020-08-29 11:20:40 -05:00
James Turner
4fe8a118cc Traffic: Improve iterator robustness
Attempting to fix Sentry crash FLIGHTGEAR-B, crash on shutdown. Not
sure this is quite right, but the logic is clearer and we handle
invalid iterators better.
2020-08-24 10:23:50 +01:00
James Turner
21629402ce ATCManagers: Use modern subsystem retrieval 2020-08-11 18:43:14 +01:00
Julian Smith
6007327da9 src/ATC/trafficcontrol.cxx: fix some minor warnings. 2020-06-17 21:11:28 +01:00
James Turner
2574783656 ATC: Fix crash with missing traffic ID
https://sourceforge.net/p/flightgear/codetickets/2254/
2020-06-08 22:44:52 +01:00
James Turner
1eef7300be PosInit: fix a crash with invalid park-pos.
Add test-cases for this,
2020-05-21 23:19:39 +01:00
James Turner
63fe5237c6 Improve interaction of —parkpos and repositioning
Re-work how position-init and ATC-manager work together to do
parking assignment and fallback (when the parking is unavailable).
Improve the logic for the reposition case, and teach ATC-manager about
reposition explicitly.

When the parking is unavailable, explicitly fall back to best-runway
selection in finalizePosition.

Add many additional position-init tests, to cover all of this.
2020-05-19 18:00:34 +01:00
James Turner
100efeebab Quiet some noisy logging in ATC code 2020-04-30 16:22:59 +01:00
James Turner
e60d131a4e Ensure dtor is virtual 2020-04-30 16:22:59 +01:00
legoboyvdlp R
18c0613762 Replace activeTraffic iterations with a standard function 2020-04-30 16:22:59 +01:00
legoboyvdlp R
3e1dc4683b Keep revising ATC 2020-04-30 16:22:59 +01:00
legoboyvdlp R
64aa3927a7 Rename departure cue to departure queue, formatting, document ActiveRunway class 2020-04-30 16:22:59 +01:00
legoboyvdlp R
8268cdc5e0 Optimize slot checking routines so unneeded code is not run, document function 2020-04-30 16:22:59 +01:00
legoboyvdlp R
0132ddf7a1 A missing call to initializeAirports() restored; this now works. Add documentation to atcdialog. 2020-04-30 16:22:59 +01:00
legoboyvdlp R
c789687da0 Formatting, change single-use pointers to std::unique_ptr 2020-04-30 16:22:59 +01:00
legoboyvdlp R
86dae35b37 Document atc_mgr, remove method from SchedFlight 2020-04-30 16:22:59 +01:00
legoboyvdlp R
84c075a20f Make it bulk again - I don't know how it reverts 2020-04-30 16:22:59 +01:00
legoboyvdlp R
6c3828bf84 ATC/AI: SG_LOG will now use BULK for render message 2020-04-30 16:22:59 +01:00
legoboyvdlp R
4af75c4666 ATC / AI subsystem: replace iostream with SG_LOG() and make new function in SchedFlight that will create a new scheduled flight instance 2020-04-30 16:22:59 +01:00
gallaert
fb65f64342 Replace BOOST_FOREACH by C++ 11 for range loop. 2020-04-12 14:40:36 +01:00
Slawek Mikula
517cf19ec6 - ATC radio list - adding selectors to radio R1/R2 for corresponding frequencies 2020-02-25 13:08:06 +00:00
Edward d'Auvergne
34a6cb3c74 SGSubsystem classes: Registration of all subsystems. 2019-07-01 14:51:32 +02:00
Edward d'Auvergne
d259c70560 SGSubsystem classes: Addition of staticSubsystemClassId() to all subsystems. 2019-07-01 14:51:32 +02:00
Edward d'Auvergne
7a6e63ddb9 SGSubsystem classes: Subsystem and subsystem group API declaration standardisation.
This is a cleanup commit.
2019-07-01 14:27:30 +02:00
Edward d'Auvergne
60a2444766 SGSubsystem classes: Whitespace standardisation of the declarations.
This is a clean up commit prior to the subsystem API standardisation to simplify
the diffs.  It includes all SGSubsystem and SGSubsystemGroup derived classes.
2019-07-01 14:27:28 +02:00
Dan Wickstrom
1948304157 Fix problem where AI planes are placed on top of user aircraft when user either selects a specific spot or user selects parking to be an available spot. 2019-04-25 11:39:41 +01:00
James Turner
a9a49bc2e6 Unboosting files
Use simgear::strutils replacements in places, C++11 features in others
2019-02-04 15:20:22 +00:00
James Turner
2c48914630 One more ATC text formatting fix
As requested by Wkitty on the mailing list.
2018-04-09 09:33:28 +01:00
James Turner
227dda4df5 ATC spacing improvements by WKitty 2018-04-05 13:07:44 +01:00
James Turner
b4cdac238e remove_if clean-ups while auditing :) 2018-01-12 22:18:59 +00:00
James Turner
a8e1fd4fd0 Move the user aircraft proxy into the AIManger
This should ensure there is always a proxy for the user in the AI
world for parking and ATC purposes.
2017-09-26 16:52:48 +01:00
James Turner
66eb3d2690 Use a unique_ptr to manage FGAIFlightPlan 2017-09-21 18:37:14 +01:00
Richard Harrison
2c8aad12ba Model relative property tree root binding.
Change fgcommand to take an optional property tree root element.

This fixes the animation bindings to use the defined property tree root - to support multiplayer (or other) model that can bind to the correct part of the property tree.

Requires a corresponding fix in sg to allow the command methods to take an optional root parameter.

What this means is that when inside someone else's multiplayer model (e.g. backseat, or co-pilot), the multipalyer (AI) model will correctly modify properties inside the correct part of the property tree inside (/ai), rather than modifying the properties inside the same part of the tree as the non-ai model.

This means that a properly setup model will operate within it's own space in the property tree; and permit more generic multiplayer code to be written.

This is probably responsible for some of the pollution of the root property tree with MP aircraft properties.
2017-07-05 11:37:17 +02:00