James Turner [Sat, 15 Dec 2012 15:25:45 +0000 (15:25 +0000)]
Restructure positional finalisation for sim-reset.
Make position finalisation happen in the same phase as scenery load, i.e as a task during the main loop, instead of during the init loop. This is compatible with the existing reset logic. Unfortunately more work is needed; the environment code doesn't update the local station quickly enough on reset. (Fixing that is next!)
Thomas Geymayer [Thu, 13 Dec 2012 12:52:53 +0000 (13:52 +0100)]
Allow Canvas Windows to be resized by dragging
- Setting 'resize' property to true on canvas::Window shows
resize icons and exposes requested size to the property
tree. This can be used eg. from Nasal to actually resize
the window and/or show a preview of the resized window
while resizing.
- Event handling now ignores events which have already
been handled. Before eg. clicking inside a window
also caused picking to be performed inside the
scene which is for sure not the expected behaviour.
- Also forwards scroll wheel events from canvas::Window.
James Turner [Mon, 10 Dec 2012 18:11:44 +0000 (18:11 +0000)]
Flight-path-history.
Record the historical flight-path (by default, since last takeoff). Optionally display the flight-path in the map; other visualisations (e.g., an 'in-world' view) could also be created. Nasal API to follow so Canvas-map or FMS can show the same data.
Altitude and attitude (Euler angles) are currently recorded but not used anywhere.
Thomas Geymayer [Sun, 9 Dec 2012 22:15:17 +0000 (23:15 +0100)]
CanvasWidget: Retrieve texture id every frame.
If the size of a Canvas changes also the texture id
changes. We now retrieve the texture id for the CanvasWidget
every frame to ensure it uses the latest texture instance.
James Turner [Sun, 9 Dec 2012 19:41:31 +0000 (19:41 +0000)]
Issue #809, restructure position init code.
Modify startup sequence, so position can be modified late in the startup process, right before the scenery load starts. This allows two ugly hacks to move to a permanent, less hacky location. If other position init modes required similar late evaluation in the future, this can be accommodated now.
This is a somewhat high-risk change - I've tested both carrier starts and runway-selection based on realwx METAR, but please look out for other position-init issues and test before / after this patch.
ThorstenB [Sat, 1 Dec 2012 10:01:25 +0000 (11:01 +0100)]
#946: some libraries not found on Ubuntu/Debian
Ubuntu/Debian introduced "multiarch" library directories, which is
unsupported by CMake <= 2.8.10. Add manual search paths as a workaround.
Currently it is only needed for libsvn, but it is needed for any lib
which is converted to the new directory standard.
James Turner [Wed, 28 Nov 2012 13:41:58 +0000 (13:41 +0000)]
Bug 926
Disable elevation mixup for naiads, since it is introducing inconsistencies between the navdata and the scenery. (Actually it's exposing inconsistencies between the airport and navaid data, but that can't be fixed right now)
James Turner [Tue, 27 Nov 2012 22:42:46 +0000 (22:42 +0000)]
Bug #927 - flightplan XML loading.
This bug was caused by the code not tolerating missing navaids / waypoints. Update logic so missing navaids degenerate to basic waypoints without problem. Also tolerate present, but empty, runway properties - don't throw an exception by looking up empty identifiers.
ThorstenB [Tue, 27 Nov 2012 20:02:32 +0000 (21:02 +0100)]
Fix FGAIFlightPlan waypoint issues
Iterator must be reset after clearing waypoint list.
Deleting "*waypoint.end()" doesn't delete the last waypoint (end()-1
does - it is never actually used though).
James Turner [Tue, 27 Nov 2012 18:17:59 +0000 (18:17 +0000)]
Add the scenery paths to the DB, and check them.
When the scenery paths change, we need to rebuild the nab-cache, since Airports/ data may have changed - e.g. someone installing custom scenery with updated ILS / thresholds.
James Turner [Tue, 27 Nov 2012 17:34:52 +0000 (17:34 +0000)]
Handle DB-locked errors.
When multiple processes (right now, multiple copies of fgfs, but potentially other users in the future) access the navcache, it can cause SQLite to return a 'locked' error, so the request should be re-tried. Add code to do this.
ThorstenB [Mon, 26 Nov 2012 23:02:28 +0000 (00:02 +0100)]
Base fullscreen detection on window decoration
rather than window size, since the size of full screen windows can change:
e.g. Xinerama mode automatically resizes fullscreen windows to cover the
area belonging to a single display only - so the
"(Xinerama) screen area == window size" check always failed - even in
fullscreen mode.
ThorstenB [Sun, 25 Nov 2012 23:23:10 +0000 (00:23 +0100)]
Fix a couple of 64-bit warnings identified by GCC.
PositionedID is of "int64_t", which depends on platform: apparently it is
"long long int" for Mac (requiring %lld format), but it is "long int" for
64bit Linux (requiring %ld). To avoid a "compiler warning fix commit
war" ;-) use a type cast to the longest common type (long long int).
James Turner [Sun, 25 Nov 2012 21:37:15 +0000 (21:37 +0000)]
Work on AIAircraft gear animation.
Inspired by Harald's patch, attempt to get AI models show realistic gear animations. Unfortunately AI models seem to be ignoring the gear properties, so keeping the code disabled until I can trace down why.
ThorstenB [Sun, 25 Nov 2012 15:41:10 +0000 (16:41 +0100)]
Traffic: preemptable flight scheduling
FGAISchedule::update can be time consuming. Preempt when necessary to
avoid simulation lags, and call it every sim iteration, until the flight
plan is complete.
James Turner [Sat, 24 Nov 2012 12:14:56 +0000 (12:14 +0000)]
Fix some groundnet cache issues.
ThorstenB identified some cases where mod-times changing could lead to corrupted ground-cache data in the DB - handle both of these. What's still unclear is why the mod-times changes; hopefully the additional debug info will reveal this.
ThorstenB [Sat, 24 Nov 2012 11:42:31 +0000 (12:42 +0100)]
Traffic performance: add airport memory cache
to avoid repeating identical NavCache/SQL queries. Also ensures we're
not using multiple FGAirport instances for an airport - each triggering
identical queries to pull in airport data.
Airports by ICAO ID are requested very frequently at run-time, so caching
significantly boosts performance.
ThorstenB [Sat, 24 Nov 2012 11:06:20 +0000 (12:06 +0100)]
Traffic performance: cache track length
Track length is calculate every iteration/for every aircraft. Since some
tracks have hundreds of waypoints, calculation is slow. Cache the
track length between the waypoints ahead, so it rarely needs to be
recalculated.
James Turner [Wed, 21 Nov 2012 14:49:34 +0000 (14:49 +0000)]
Break upwards dependency on Traffic in the AI code
AIManager had unfortunate code to pass some state to the traffic-manager; this is no longer required since traffic schedules hold onto their AI-Aircraft directly as needed.
James Turner [Tue, 20 Nov 2012 13:32:10 +0000 (13:32 +0000)]
Make PUI menu-bar reinit safe.
Was only cleaning up the PUI menubar, not old bindings / names. This led to duplicate bindings, each time the GUI was reset, which can happen for various reasons.
ThorstenB [Sun, 18 Nov 2012 15:35:54 +0000 (16:35 +0100)]
Remove static property dependencies
preventing us from wiping properties on reset/reinit/subsystem recreate.
(more work required for "native_gui" and "ATC-Outputs" protocols)
ThorstenB [Sat, 17 Nov 2012 19:01:19 +0000 (20:01 +0100)]
#600, for Curt... ;-) allow speed-up value to use fractions
"speed-up" can now also be used for slow-motion (i.e. 0.5 / 0.25 / ...)
or fractional speeds (3.141...). This was already working for instruments
(for replay) before, now it's also considered by FDM simulation.
James Turner [Sat, 17 Nov 2012 18:10:15 +0000 (18:10 +0000)]
Support request body on xmlhttprequest.
Allow XML property data to be submitted with a request; changes the request method from GET to POST. Supply nodes via the 'body' argument to the command.
James Turner [Fri, 16 Nov 2012 16:43:54 +0000 (16:43 +0000)]
Further work on bug 905.
Tolerate Octree leaf children which have been moved outside their leaf's BBox. This is necessary since lazy-loading of ILS and threshold files can cause re-locations even during child traversal, where updating the hierarchy is very complex. Instead, simply tolerate this case, and rely on the real position data (which is correct).