test_motion() now sets /sim/time/simple-time/enabled=true.
Also show any description items - these are generate by related changes to
src/AIModel/AIMultiplayer.cxx.
Also, when moving MP packets around, medium_term buffer can become empty. Have
added checks for empty short, medium and long term buffers when moving packets.
Simple-time mode is enabled by /sim/time/simple-time/enabled.
Simple-time is implemented by new TimeManager::computeTimeDeltasSimple()
method. This uses a plain UTC clock (e.g. with CLOCK_REALTIME /
gettimeofday()) for basic timing, and sets _mpProtocolClock (as returned by
getMPProtocolClockSec()) to the calculated FDM time.
We use our own fns to get UTC time and for sleeping, because
TimeManager doesn't work for us, e.g. SGTimeStamp::SGTimeStamp() uses
_POSIX_MONOTONIC_CLOCK if available so doesn't return UTC.
So getMPProtocolClockSec() now serves as a consistent time for both the
user aircraft and MP aircraft, avoiding problems where different Flightgear
instances could show aircraft in different relative positions.
For example it can be put into outgoing MP packets (which are about
the time/position of the user aircraft), and used as the target
time when calculating the position of multiplayer aircraft using
interpolation/extrapolation of incoming MP packets.
And getMPProtocolClockSec() can also be written into recordings, ensuring
that multiplayer replay will also show all aircraft with the correct relative
positions, regardless of varying frame rates at record or replay time. This is
tested by 'scripts/python/recordreplay.py --test-motion-mp'.
This is just for code clarity.
It changes the order of construction/registration of subsystems to match the
order in which subsystem groups are called when Flightgear is running.
JSBSim fails on startup if some properties are not already created; some of
these are created by FGReplay, and this is going wrong now that FGReplay is
being run after the FDM.
So have added a hack where we call FGReplay::init() as soone as FGReplay has
been created.
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.
Still need to add SVG support, but this improves feedback (eg hover)
for many icons in the launcher. Will remove the redundant PNGs in
another commit once other pieces are done.
This is in addition to mp speed in mp packets. Looks like this final mp speed
is very uneven.
Have changed the test slightly to move both UFOs at the same speed so replaying
e.g. with Helicopter View shows them incorrectly moving relative to each other.