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.
Allow mis-match of STAR and approach, which is necessary for EDDF
operations. When there’s a mismatch, just route the common section
and don’t try to build a STAR -> approach transition.
Fix by Tobias Dammers.
When reachedEndOfCruise fails, return true, so we trigger the next
phase of the flight. Without this we get stuck logging the error
message, but not progressing the flight.
- Use a range-based for loop instead of an iterator.
- Don't bother checking if the previously-visited directory was the
same: the potential saving that the previous code was hoping should be
null because FGGlobals::append_fg_scenery() doesn't add a path to
FGGlobals::fg_scenery if it's already there---this assumes that all
paths added to FGGlobals::fg_scenery go through
FGGlobals::append_fg_scenery(), of course.
This should have no effect on FG's behavior.
If a menu-bar item is missing a <name>, we can end up building a string
from nullptr, which is a SEGV.
Reported as Sentry issue FLIGHTGEAR-1D
Will back-port to LTS once verified.
Use the ‘file name copying’ version of log(), to avoid an ASan use-
after-free. Note this requires SG change
908496d43dd7c3a7ca1de42b0e0c21aa0498c7df
to work correctly.
When there are installed the same aircrafts from different sources
(fgdata + fgaddon + git) with identical descriptions, use the URI to
provide stable sorting.
Handle the standard windows-3rd-party setup (used by fgmeta) with no
extra options, and also handle the slightly odd setup we use on Jenkins.
Try to tolerate all permutations of setting MSVC_3RDPARTY_ROOT to
different places in the hierarchy.
We no longer try to guess Boost_INCLUDEDIR by looking at parent dirs of
MSVC_3RDPARTY_ROOT, since this seemed kind of bad to me. Let’s try
it and see.
Fire the release bindings for active pick callbacks, even for a ‘handled’
mouse release. This means knobs, etc will fire their release binding
if the mouse is over a PUI dialog.
https://sourceforge.net/p/flightgear/codetickets/2347/
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.
Add a number of properties set by both AI Traffic and Swift aircraft:
gear/gear[0..5]/position-norm
surface-positions/flap-pos-norm
surface-positions/spoiler-pos-norm
surface-positions/speedbrake-pos-norm
controls/lighting/beacon
controls/lighting/cabin-lights
controls/lighting/landing-lights
controls/lighting/nav-lights
controls/lighting/strobe
controls/lighting/taxi-lights
Also improve take-off behaviour
Fix various places Valgrind identified as read-of-un-inited. Also
fix use of frequencies are integers: always use a double type explicitly,
which will make MSVC happier.
FGFX isA SGSampleGroup, but owns some SGXmlSounds, which also take an
owning ref to their sample group. Clear out the XMLSounds on unbind(),
to break the circular reference.
- fgfs --language=fr-FR now works as expected for the launcher (also with
--language=fr_FR as before): the value added by option --language to
the _languages member of FGLocale is normalized in "underscore" style
(e.g., fr_FR).
- Add-on translations must now use a hyphen in their property node names
in addon-metadata.xml (talking about children of <localized>): i.e.,
use for instance <fr-FR> there, not <fr_FR>. An exception
(addons::errors::error_loading_metadata_file) is thrown if one of
these nodes has a name containing an underscore.
Helipads were not being shown for convention airports, only for
heliports. Fix this up so helipads work alongside runways at
conventional airports, when the selected aircraft is a helicopter.
Set the menu action roles to avoid the text heuristic, which erroneously
confuses our configuration menu items with preferences and moves them.
Fixes bug:
https://sourceforge.net/p/flightgear/codetickets/2253/
Will pick to 2018.3, 2020.1 and 2020.2 since it’s nicely self-contained
and rather annoying.
Allow add-ons to define an FGData subdir, and support multiple —data=
command line arguments, to avoid the need to modify FG_ROOT (which might
be read-only). Allow additional data paths to be either higher or lower
priority than FG_ROOT, so that add-ons cannot replace files in FG_ROOT.
Suggested on the tracker, keep log files around longer. Currently we
keep the previous ten files.
Note we still don’t log for secondary running copies, since this would
violate the ‘only one copy can write to FGHome’ principle.
https://sourceforge.net/p/flightgear/codetickets/2243/
This avoids crashing when using Qt : we cannot call exit() safely since
QGuiApplication won’t shut down correctly. Instead throw a special
marker object and catch this in boostrap.
For an instance of this, see:
https://sourceforge.net/p/flightgear/codetickets/2070/
-D shows speed and drag values at fixed altitude.
--aD shows best speed at different altitudes.
Example:
yasim fgaddon-git/Harrier-GR3/Harrier-GR3.xml --aD
Results in tooltips for instrument needles, and control surfaces.
Enabled with /sim/rendering/automatic-animation-tooltips/enabled.
The max number of auto-created tooltips can be specified in
/sim/rendering/automatic-animation-tooltips/max-count (too many can cause
problems, e.g. on 777 i had to set max to 45).
src/Model/acmodel.cxx:fgLoad3DModelPanel(): pass new property values to
simgear::SGModelLib::loadModel(), so we can have auto-created tooltips for
animations in the user's aircraft.
[This all requires matching changes to simgear.]
We get away with things without these includes because
the build concats lots of C++ files together into
build/flightgear/src/GUI/fglauncher_autogen/mocs_compilation.cpp and luckily
earlier ones had the right includes.
Continuous replay:
If the user replays a continuous recording from file and then end replay
with the 'My controls' or 'End replay' buttons, we now forget about the
continuous recording. This enables the usual in-memory record/replay to be
used subsequently. Also added a '-continuous' suffix to continuous fgtape
filenames.
New recovery system:
If /sim/replay/recovery-period is set and greater than zero, we
periodically save a single-item continuous recording to a recovery file
called <aircraft-type>-recovery.fgtape (with no date or time in the name),
doing so in such a way as to ensure that there is always a valid recovery
file even if flightgear crashes. One can then resume the flight from the
most recently-saved point by loading this from within flightgear or with
the --load-tape=... option.
Also did a fair amount of refactoring and tried to clarify the different
property nodes that we embed within recordings.
This background recording keeps the user aircraft stationary while recording
all movements of multiplayer aircraft. Allows one to look at replay without,
for example, disturbing continuous record to file.
This allows full-fidelity recordings of arbitrary length (limited only by disc
space) to be created and replayed. These recordings always contain multiplayer
information, regardless of /sim/replay/multiplayer.
When an uncompressed recording is loaded, it is not copied into memory. Instead
we extract individual frame information as required when replaying.
Recording to file is activated by setting /sim/replay/record-continuous to
true. We use the same filename pattern as ordinary fgtapes. The file format
is similar except for being uncompressed (so that replaying can seek within
the recording; gzip etc don't seem to support seeking within the uncompressed
stream.)
Lars T identified some cases where the launcher would fail to include
local aircraft due to them using weird ways to include additional
XML into their -set.xml. Add a temporary resource provider while the
launcher is scanning, to make this work.
Will pick to LTS branch once verified.
Was being shown before locale was selected, so always using default
translation. Fixed by deferring the dialog, and also added an assert
for debug builds, if trying to access translated string too early.
With this change, “Reload Input” will discover newly attached devices
on macOS, which previously did not work.
Also add correct detection of disconnected devices, which previously
was not handled well, especially with the new ‘keep trying to open
devices’ behaviour of FGJoystickInput.
Should fix:
https://sourceforge.net/p/flightgear/codetickets/2259/
Overlay menus work better than native popups for most use-cases, and
simplify integration (no window focus changes). Switch the remaining
menus to always use the overlay system
As part of this, fix how Overlay positions are adjusted, to avoid
the ugly zero-interval timer.
Fgtape:
If multipayer replay is active we write multiplayer packet information to
fgtape files. We also add /sim/replay/multiplayer to the properties written
to fgtape file so at load time we knows whether to expect multiplayer
packets.
New builds of fg can load and replay old recordings.
It is expected (but has not been tested) that old builds of fg will be able
to read new fgtape recordings where /sim/replay/multiplayer was unset or
false (currently the default).
Old builds of fg will not be able to load fgtape recordings that include
multiplayer data.
Avoid incorrect removal of multiplayer aircraft when replaying:
We now clear multiplayer motion history when we jump forwards or backwards
during replay. This ensures that multiplayer code doesn't remove
multiplayer aircraft because of inconsistent-looking time stamps.
We preserve some multiplay information when purging recorded information
to save space. This ensures that when replaying we get frequent enough
packets to avoid the multiplayer code thinking that multiplayer aircraft
have disappeared.
At the moment this only works for live replays - we don't (yet) write the
multiplayer information to fgtape files.
Enable with:
--prop:bool:/sim/replay/multiplayer=true
This works by copying all raw multiplayer packets into a buffer in
FGMultiplayMgr. Each time it is called, FGFlightRecorder::capture() moves all
the available packet from this buffer into its FGReplayData. Thus we store
roughly syncronised multiplayer packets along with the user aircraft's detailed
replay properties.
When replaying, FGFlightRecorder pushes packets into a buffer in
FGMultiplayMgr, which are used instead of live multiplayer packets. [Actually
when replaying FGMultiplayMgr still reads live packets in order to handle live
chat messages, and ignores chat messages from FGFlightRecorder.]
Ensure /orientation/heading-magnetic-deg, etc have a type of double
immediately. Showed up as a bug in the SenecaII, since the property
is created but has NIL value until the first update() call.
Both the route-path cade and the RNAV code were using some bad logic
to compute the intersection point. All fixed now, but requires a
new helper in Simgear.
Remove the non-functional turn-anticipation code from the GPS, and
enable fly-by mode in (some of the) RNAV controllers: initially the
leg controller.
The new config property is gps/config/enable-fly-by, defaults to off
for compatibility.
Previously, the Nasal files in fgdata/Nasal/*.nas were loaded in
file-name order. This created a particular problem file files
beginning with "a" which might want to use props.nas.
This adds support for an ordered list of files to be defined
in the property tree that will be loaded before the rest of the
Nasal files.
Avoid encoding test-data as strings, since this exceeds MSVC limits
on string literals, and tests don’t need to be relocatable anyway,
so we can just hard-code the source location into config.h
Overhaul how transitions are stored in FlightPlan XML, and how
they’re exposed to Nasal. Simplify the Nasal access by making
‘sid_trans’ and ‘star_trans’ writeable.
Extend the unit-tests a lot to cover this, both from C++ and also
from Nasal
As part of this, overhaul the ownership of FlightPlan delegate
factories, to make it safer (use ref-counting of the factories,
and allow the factory to customise delegate clean-up behaviour)
Make FlightPlan::findIndexOfWp use the correct ::matches() method,
and special case this for basic waypoints. This fixes the behaviour
when loaded routes / procedures store a navaid-waypoint as basic.
Where the plan does not contain departure / arrival WPs, fire the
corresponding delegate methods after load, to run the selection logic.
Also, add a ‘loaded’ delegate callback, to give delegates a chance to
perform validation and fix-up after all flight-plan loads.
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.
This avoids an issue where the dialog doesn’t update on macOS, if it’s
shown immediately after a native message box, such as the migration
warning dialog.
Previously /sim/current-view/viewer-[lon|lat]-deg were set to
(0,0) when a view was bind() for the first time by the view
manager. This cause the scenery tile cache to immediately clear
and all scenery to be reloaded.
Now these values are set correctly the first time the view
bind() is called, so the cache behaves correctly.
Also fixed what looks like a possible bug on code read where
the tiles of the current view had a very short expiry time
set. Seems wrong.
Add translation macros for the text of the lock-file warning dialog,
and update the default text after some discussion on the devel list.
Also allow quiting the app, as an alternative option.
Speculative fix for a reposition assert which Huntley is seeing:
https://sourceforge.net/p/flightgear/codetickets/2229/
Unclear why it’s not happening for me other some other folks, but this
should logically be the correct fix. Let’s find out.
Only the in-sim version works for now, the test-suite mode is not
implemented yet. Also the test API will evolve, but should stay close
to what CppUnit defines.
Run a test file by specifying a path to nasal-test : examples will be
added to FGData shortly.
See ticket:
https://sourceforge.net/p/flightgear/codetickets/2133/
Give the user a chance to intervene, if we select read-only mode.
Offer a button to clear the lock file if it’s stale, and start in
read-write mode.
This is still evolving, but want to get some feedback on it.
Fix for: https://sourceforge.net/p/flightgear/codetickets/2059/
When copying addon-config into the main property tree, skip props
which already exist and which are marked ARCHIVE, on the assumption
they came from autosave.xml.
When load a GPX route, run normal departure/arrival airport callbacks
on the delegates. (They are blocked for ‘native’ XML routes to avoid
losing SIDs and STARs)
https://sourceforge.net/p/flightgear/codetickets/2227/
Similar to enable-velocity-vector, but indicates velocity relative to ground,
rather than velocity relative to air. E.g. useful for crosswind landings.