* Support the native fdm, gui and ctrl protocols over DDS
* Add fgfdm_log as an fdm over DDS command line logging utility
Usage:
--native-fdm=dds,out,60
--native-ctrls=dds,in,60
etc.
FGFlightRecorder::replay():
Fixed behaviour when going back in time while replaying - we were not
replaying initial property changes correctly because we deliberately
don't load signals data for some frames when we are only interested in
multiplayer or extra properties.
Removed incorrect code that tried to avoid replaying the same frame twice
in succession.
FGReplay::update(double dt):
Improved how we figure out which frames we need to replay just for multiplayer
or extra property changes.
FGReplay::makeTapePath():
New fn containing the code for converting tape name into path by prepending
tape dir and appending .fgtape as necessary. Called when loading tape at
startup or at runtime.
Cached some more property nodes in SGPropertyNode_ptr's.
Don't recordCHAT_MSG_ID messages; unfortunately it looks like most (all?)
chat message text is received as part of POS_DATA_ID messages tied to
sim/multiplay/chat, so this doesn't actually avoid recording chat messages.
We used to modify the --aircraft and --airport options when handling
--load-tape, which invalidated iterators and for example could cause later
options to be ignored.
The solution here is rather crude - we store the new options in globals to
ensure that they are used in preference later on.
We now put local file inside directory specified in /sim/replay/tape-directory,
and also use 'url-' prefix on leafname.
E.g. with
--prop:/sim/replay/tape-directory=.../fgtapes and
--load-tape=http://foo.com/harrier-gr3-continuous.fgtape
- the local file is:
.../fgtapes/url_foo.com_harrier-gr3-continuous.fgtape
Add timestamp to saved reports, and the file name, and print the
time-stamp for occurences in a saved report. Add de-duplication
support to avoid generating huge reports for recurring errors.
Not complete yet, but add the ability to pass context in from the
AIBase to the loader thread. Also add error context to more places
in AI / scenario loading.
A few versions of the Windows Intel drivers seem to crash while
performing the OpenGL check; re-order the code to try and prevent
this.
Sentry-Id: FLIGHTGEAR-K7R
Don’t fail to select the language, when the UI language includes
a ‘script’ value, as happens for Chinese on macOS.
Thanks to Sidi Liang for reporting.
Fix a bug where we would copy-assign a PropertyObject, when we
actually wanted to copy the value.
Thanks to Sascha Reißner for tracking the problem down.
Need to use simgear::HTTP::FileRequestRef shared pointer, otherwise
HTTPFileRequest will delete it after the transfer.
Also changed callback to a lambda to match reinstated simgear API.
The fgfs executable is the unit within which it makes sense to check
preconditions with assert. We are not in control of aircraft code in the same
way.
This allows debug build of test-suite to check handling of out-of-range view
numbers.
E.g. for --load-tape=http[s]://foo.com/foo/bar/wibble.fgtape, we download in
the background to a file called foo.com_[MD5]_wibble.fgtape, where [MD5] is an
8-character hash of /foo/bar.
We assume any existing file contains valid data and only download any remaining
data (by specifying an http Range header).
Also, when loading/downloading and replaying continuous recordings at startup,
we set the aircraft and airport from the recording.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
FGReplay::loadContinuousHeader()
Loads properties from Continuous recording's header, distinguishing
between failure due to incorrect header, or due to a truncated file.
FGReplay::indexContinuousRecording()
Contains Continuous recording indexing code, in a form that can be used
in background while we are downloading.
Added a mutex to protect m_continuous_in_time_to_frameinfo, which can now
be modified in background as Continuous recording is downloaded.
src/Main/fg_init.cxx
src/Main/options.cxx
fgOptLoadTape():
Modified to handle --load-tape=<url>. We start download, and read
the header before returning, so that we can force the FDM to use the
recording's aircraft instead of the user's default. Limit recording
download rate if /sim/replay/download-max-bytes-per-sec is set, by
calling new filerequest->setMaxBytesPerSec().
Recording of extra properties is only supported in Continuous recordings.
Modified Continuous recording format to allow future forwards
compatibility. See docs-mini/README-recordings.md for details. This breaks
compatibility with previously-generated Continuous recordings, but this only
affects next.
To reduce overhead we record all extra property values in the first frame and
then later frames contain only extra property changes. When replaying, if the
user jumps backwards we replay all extra property changes since the start of
the recording. Similarly if the user jumps forwards, we replay any intervening
extra property changes.
Recording extra properties:
This is enabled by:
/sim/replay/record-extra-properties
The extra properties that are recorded are identified by the property
paths in the values of /sim/replay/record-extra-properties-paths/path[]
properties. We record the entire tree for each specified path.
Recording of main window position size:
We have specific support for record and replay of main window position/size.
This is enabled by:
/sim/replay/record-main-window
Recording of main window view:
We have specific support for recording the view type and direction/zoom
settings.
This is enabled by:
/sim/replay/record-main-view
We record the /sim/current-view/ property tree, excluding some subtrees
that continuously vary but are not required for replaying of the view.
When replaying, we allow separate control of what extra property changes are
replayed, with:
/sim/replay/replay-extra-property-changes
/sim/replay/replay-extra-property-removal
/sim/replay/replay-main-window-position
/sim/replay/replay-main-window-size
/sim/replay/replay-main-view
We work around some problems caused by the use of tied properties when
replaying changes to view-number.
Window position issue:
When replaying window position and size changes, things get a little tricky
because osgViewer::GraphicsWindow::setWindowRectangle() takes a position
for the entire window, but osgGA::GUIEventAdapter::RESIZE events contain
the position of the interior of the window; for example the y values will
differ by the height of the window's titlebar. This can cause windows to
move progressively further down each time they are positioned or resized.
There doesn't seem to be a way of finding the size of a window's
furniture directly. So instead this commit adds a new method
osgGA::GUIEventAdapter::setWindowRectangleInteriorWithCorrection() which
wraps osgViewer::GraphicsWindow::setWindowRectangle(). We listen for the
following osgGA::GUIEventAdapter::RESIZE event and calculate corrections
for x and y position that are used for subsequent calls.
docs-mini/README-recordings.md:
Updated to document new Continuous format.
scripts/python/recordreplay.py:
New script to test various aspects of record/replay.
Other:
We now create convenience softlink to most recent continuous recording, using
SGPath::makeLink(). Note that SGPath::makeLink() currently does nothing on
Windows.
Changed format of Continuous recordings to contain a single property tree
in header. This is much simpler than having separate Config and Meta trees.
It was supposed to be in ft/min, but everything except AIAircraft was
using it as ft/sec. Change the name to AIBase::vs_fps and ensure the
same unit is used everywhere.
QML implementation of getting started tips, with a nice styled
background box. Tips are defined+positioned inline, and displayed
when their enclosing scope is active.
Translocation forces us to rebuild the nav-cache each launch, and might
mess up some other details, so let’s warn the user they should copy
the app to Applications or similar.
If the user double-clicks, and their system is slow, the action can
fire twice, which then breaks because we add options twice.
Sentry-Id: FLIGHTGEAR-HKV
Move forward 1 metre in tower view look from, to slightly improve view of
ground near tower.
Removed incorrect attempt to move towards target in other tower views, that
didn't work.
This means that the image on screen moves by the same distance as the mouse
(for small movements), regardless of window size or zoom level. Current mouse
drag handling in extra view windows is poor though - mouse is constrained by
screen size.
Would be good to do this for standard views as well, but the code in view.cxx
is more complex so haven't been able to figure out how.
Allow the option to have the marker beacon instrument use either the
correct timing, or ‘always on’ when the beacon is in range. Try to
ensure the audio is synchronised with the visual property. by using
the same timing values.
Also avoids losing sync when using the ‘audio-btn’ toggle, and increases
the update rate to allow accurate timing. Finally, switch from tied
properties to regular ones, so listeners on the beacon properties are
updated directly.
Configure the VPB elevation mesh via properties:
/scenery/elevation-mesh/sample-ratio controls the elevation
mesh sampling, allowing reduction in mesh size
/scenery/elevation-mesh/vertical-scale is just for fun and
scales the mesh vertically making mountains taller.
/scenery/elevation-mesh/constraint-gap-m controls how much below
airports etc. elevation vertices are forced to be.
[Marked as 'Partial' because, for me, reset eventually runs out of memory with
both composite-viewer and non-composite-viewer.]
fgStartNewReset(): pass existing composite_viewer to FGRenderer constructor so
that it is used after reset instead of us creating a new instance. Also reuse
existing osgViewer::View.
In FGRenderer::init(), don't create new osgViewer::CompositeViewer if
this->composite_viewer is already set.
- Summary.qml - new row with Flight Plan info
- LauncherController.hxx, Launcher.qml - signals to show flightPlan &
exposing flight plan object
- FlightPlan.qml - add red color to information about airport mismatch
- FlightPlanController.cxx, FlightPlanController.hxx - description
handling, support to loading flight-plan from command line argument
'flight-plan', saving last used dir when loading/saving flightplans
Fixes https://sourceforge.net/p/flightgear/codetickets/2521/
For submodels with rotation offsets, the rotation was applied to the
translation offset.
This is incorrect: translation offsets should be in the aircraft local
frame, and thus are not affected by submodel rotation offsets.
This scales all LOD ranges and was added in an attempt
to control WS3.0 LOD ranges. However it badly impacts
WS2.0 draw distances, and is not the right solution
for WS3.0. So removing.
Elevation constraints are now added by the ReaderWriterSTG
for all OBJECT entries, so aren't explicitly required for
the .icao loader. This also allows us to clean up the BVH
generation, as the constraint is added after the model loading
is completed and the BVH policy applied.
Previously WS3.0 airports could be placed via .stg
file.
Now they are OBJECT entries rather than OBJECT_STATIC
and the placement information is taken from the apt.dat file.
Also added as elevation constraint for WS3.0 terrain.
Setting useDefault to true is equivalent to using unitialized variables we are getting whatever is currently in the memory whether it is relevant or not.
avoids an exception throw when the controller fails to init, which
avoids us breaking the stack when called via setMode, etc. Showed
up as error reports on Sentry.
Make this exception inherit std::runtime_exception, so that it’s
caught by the ‘normal’ exception cases in FG boostrap.cxx
This is the only exception I can find in the codebase, which does not
inherit from either std::exception or std::string, so this is to fix
‘unknown exception’ errors reported in the wild.
Sentry-Id: FLIGHTGEAR-1C
It seems that some aircraft sometimes incorrectly pass view indices rather
than numbers resulting in out-of-range access to FGViewMgr::views[]; See
flightgear-devel thread with subject "View crash (after loading errors)".
With this commit, if we are given an incorrect view number, we output a
diagnostic with SG_ALERT, assert fail, and cope with the problem. Arguably we
could do something more serious such as opening a popup or throw an exception.
We now attach global event handler to extra view windows so key presses are
handled as normal.
And the main event handler for mouse movements now calls new SviewMouseMotion()
which pans/tilts extra view windows in response to right-button mouse-drag.
Check for NaNs after each FDM iteration, and freeze the sim if found.
Report this condition to the user and to the reporting backend, along
with the last valid position.
Probably needs some refinement, this is just a first guess.
Sentry-Id: FLIGHTGEAR-AM
When in LEG mode, and within the intercept cone, but further away from
the leg waypoint than the leg origin, we were computing a bogus
abeam point and hence a bogus desired track.
Detect this situation, and invert the computed along-track-distance,
so the computed abeam point is actually near where we are, and not ahead
of us.
- exclude POIs and some other types from the ident match, to avoid
confusing results
- improve how the search vicinity is computed when inserting a leg,
which is the common case for a route with a destination set. Use
the midpoint of the leg ending at the insert position, as the optimal
search vicinity
- move the waypointFromString code into route.cxx, since it is mostly
independent of a FlightPlan instance
- extend the tests to cover the bug which flagged these issues
Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2372/
Prevent errors from property code when leading / trailing whitespace
occurs in the autopilot XML, in a property path. Use strutils::strip
to remove whitespace.
Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2445/
SviewCreate() now takes a SGPropertyNode* config which contains all information
needed to specify the view, including window size and position.
By default views are defined using a series of <step>...</step> nodes which map
to SviewStep* classes internally.
Alternatively, existing extra-view functionality is supported using
type='current', 'last_pair' or 'last_pair_double', plus one can use old-style
<view>...<view> nodes with type='legacy'.
See src/Viewer/sview.hxx for details and examples.
The extra-view commands view-clone, view-last-pair and view-last-pair-double
now pass the supplied SGPropertyNode* through the underlying FGViewMgr to
SviewCreate().
Improved handling of +/- heading and pitch values. For example some legacy
views have inverse relationship between heading-offset-deg and the actual
heading offset, so we now only multiply by -1 early on when handling these
legacy views, and SviewStepRotate does not negate.
Fixed Helicopter view direction bug with multiplayer aircraft - need to use
global /sim/current-view/heading-offset-deg, even for multiplayer aircraft.
Fixed incorrect handling of roll in pilot view - when adding in extra changes
of heading, pitch and roll to things like Helicopter view, simply adding to
heading, pitch and roll doesn't work if aircraft roll is not zero. Instead we
need to do the calculation with SGQuatd, so have added optional rotation params
to SviewStepFinal.
Added support for legacy Tower view look from.
Details:
src/Main/fg_commands.cxx
src/Viewer/viewmgr.cxx
src/Viewer/viewmgr.hxx
Added 'view-new' command.
All recently-added view commands now pass the SGPropertyNode* arg to
globals->get_viewmgr() and from there to SviewCreate().
src/Viewer/sview.cxx
src/Viewer/sview.hxx
SviewStepAircraft and SviewStepNearestTower uses new Callsign
class for tracking multiplayer aircraft by callsign instead of
/ai/models/multiplayer[] number, so we cope when multiplayer aircraft
are renumbered by network outages.
Double views are now implemented as a final view step, instead of
in a separate class derived from SviewView. So all views are
implemented using SviewViewEyeTarget, and there is arguably no
need for the separate SviewView base class.
SviewViewEyeTarget now has a single list of steps, instead of separate
lists for eye and target, because the use of SviewStepCopyToTarget makes
separate lists unnecessary.
Chase distances are supposed to be negative. Otherwise in external views
vertical mouse moves have reversed behaviour when changing view angle. E.g.
see:
https://sourceforge.net/p/flightgear/codetickets/2454
src/MultiPlayer/multiplaymgr.cxx
Fix +ve chase-distance-m for multiplayer aircraft.
src/Viewer/viewmgr.cxx
Fix +ve chase-distance-m for user aircraft.