Make --view-offset set /sim/view[0]/config/heading-offset-deg instead of
/sim/current-view/heading-offset-deg. Setting the latter has no effect
because of what flightgear::View::createFromProperties() does when it
initializes flightgear::View::View. This was discussed at [1].
[1] https://sourceforge.net/p/flightgear/mailman/message/37406317/
_simple_time_fdm was not being initialised, which was causing occasional hangs
on startup. So set to zero in constructor and TimeManager::init().
For simplicity, we also initialise all other basic type state in the
TimeManager class.
If _simple_time_fdm's starting value happens to be very large (e.g. 1e228),
_simple_time_fdm + fixed_dt would result in _simple_time_fdm, so we would end
up always setting simDt and realDt to zero.
This stops SGEventMgr from processing any events, which means that
initPosition()'s event to call finalizePosition() is never processed so
/sim/position-finalized is stuck on false, which results in the FDM never
setting /sim/fdm-initialized.
This will fix other uses of the APi blocking because the backend
failed to start. Enable debug logging in non-release builds so
it's obvious when the deploymenty is not configured right.
If specified we start video encoding when replay starts, and stop video
encoding when we reach recording end.
This is supported with --load-tape on the command line and from the 'Load tape'
dialogue.
src/Aircraft/continuous.cxx
src/Aircraft/continuous.hxx
If stopping replay with auto create video, then stop video encoding and
restore original /sim/time/fixed-dt if we changed it.
src/Aircraft/replay-internal.cxx
src/Aircraft/replay-internal.hxx
When starting replay, call view_mgr->video_start() and set
/sim/time/fixed-dt if specified.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
loadTape(): added bool create_video and double fixed_dt args.
src/Main/options.cxx
Added new command-line options --load-tape-create-video and
--load-tape-fixed-dt=<double> to allow auto create video and fixed-dt when
replaying.
The main FGReplay subsystem class now contains just the public API for
record/replay, plus a pointer to instance of new ReplayInternal implementation
class. Also moved some Continuous-specific code into new source file.
src/Aircraft/CMakeLists.txt
Updated for new files.
src/Aircraft/continuous.cxx
src/Aircraft/continuous.hxx
New, code specific to Continuous record/replay.
src/Aircraft/flightrecorder.hxx
Minor changes.
src/Aircraft/replay-internal.cxx
src/Aircraft/replay-internal.hxx
New, contains implementation of record/replay.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
Modified to be just concerned with public record/replay API. The
implementation now defers to the ReplayInternal instance. Added support for
auto create-video when loading Continuous recording.
src/Main/fg_init.cxx
resetStatisticsProperties() is now in FGReplay, not FGReplayData - the
latter is not in the replay.hxx header any more.
Uses simgear::VideoEncoder().
Added video-start and video-stop commands. We allow specification of container,
codec, quality, speed and bitrate.
src/Main/fg_commands.cxx
Added video-start and video-stop commands.
src/Viewer/viewmgr.cxx
src/Viewer/viewmgr.hxx
Added video_start() and video_stop().
If in simple-time mode and /sim/time/fixed-dt is non-zero, we always increment
FDM time by fixed amount each frame, regardless of frame rate. Allows creation
of high quality videos even on slow hardware.
src/AIModel/AICarrier.cxx
Avoid warning about unused angle_tdp variable.
src/AIModel/AIFlightPlanCreate.cxx
Increased a buffer size that was giving warning with snprintf(). Also
always use sizeof(buffer) instead of duplicating the explicit size.
- Fixed an error which prevented the equatorial and polar radii from <planet> to be propagated to the initial conditions.
- The planet radii in <planet> can now be specified by the tags <equatorial_radius> and <polar_radius> which are more self explanatory than <semimajor_axis> and <semiminor_axis> (which are still valid).
- Improved the error messages returned by FGTable: the file name and line number where the error occurred are now printed.
- Check the number of <input> tags for flight controls such as <pure_gain> (GitHub issue #497). This avoids a crash when some or all <input> elements are missing.
- JSBSim now accepts 2 sign conventions for the cross product inertia (xy, xz, yz) in <mass_balance> (GitHub Pull Request #502). The sign convention is specified by the parameter negated_crossproduct_inertia which defaults to true for backward compatibility.
- Turbine engines can now windmill even before they start (GitHub issue #494 and Pull Request #509).
- Fixed a sign error in the computation of aero/h_b-mac-ft (GitHub Pull Request #508 )
- Fixed a bug where FGTable instances were not untied from the property manager during their destruction. This could lead to segmentation faults when the property manager was later destroyed.
- Exceptions raised by FGTable are now instances of the TableException class.
src/AIModel/AIFlightPlan.cxx:
Clarify expression with extra round brackets.
src/AIModel/AIFlightPlanCreate.cxx:
Increased buffer size to match longest possible string.
src/FDM/JSBSim/input_output/FGOutputFG.cpp:
Use cast to avoid comparison of int with enum.
For performance replay, we need to ensure that replaying recordings will
replay changes to the view and main window size, if they are present in the
recording. [Replay of these changes can be disabled in the "File/Flight
Recorder Control" dialogue.]
scripts/python/performance_replay.py
New, script for replaying a recording in Flightgear and gathering
statistics.
scripts/python/recordreplay.py
Minor change.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
If /sim/replay/log-frame-times is true, populate
/sim/replay/log-frame-times/dt[] with frame times while replaying.