1. A canvas can be placed on dynamically created models.
Implemented by adding a new placement factory.
2. Added a "loaded" property in every "models/model[...]"
path to track when a model is finally loaded by OSG.
See https://forum.flightgear.org/viewtopic.php?f=30&t=38318
Avoid double-setting or conflicting aircraft arguments being passed:
when the user enters an aircraft related argument manually, disable
the launcher setting them.
Include command line / launcher options in the detailed report, and
pause the sim when showing an error dialog, in case the report
occurs at an unfortunate time.
Compute the local time value inside the TimeManager, so that the
UI doesn’t need to rely on the default clock instrument (which
might not exist) to show correct local time.
Also fix updating of time-offset/time-zone, to be based on distance
travelled instead of elapsed wall-clock time.
(needs an FGData update as well)
Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2514/
Since we’re not using target_link_libraries, we need to explicitly
define fgfsObjects (which contains main.cxx) as depending on the
embedded resources target.
Remove use of BUILDING_TESTSUITE from headers. Where possible, move
test APIs to their own file in the test_suite dir (testApis.cxx). For
some others, add them to a special list of ‘sources which depend on
the build mode’. This will hopefully go away with some further
refactoring.
The end time is updated in background when replaying from url, so we must not
set /sim/replay/end-time elsewhere. So we now only set /sim/replay/end-time in
FGReplay::get_end_time() if recording is not Continuous.
* 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.