James Turner [Sun, 30 Sep 2012 18:40:08 +0000 (19:40 +0100)]
Tolerate refactored SGSound headers.
An upcoming commit will make the sound headers standalone, and no longer include various other headers / using std:: declarations. Prepare for this by making includes and usage of namespaces explicit.
James Turner [Sun, 30 Sep 2012 15:34:51 +0000 (16:34 +0100)]
Initial work on dynamic subsystem creation.
Make subsystems create-able and removable from commands. Only some subsystems are supported so far, since many have non-default constructors or other complexities.
With this, change, it's possible to dynamically add and remove the traffic-manager at runtime, for example: fgcommand("add-subsystem", props.Node.new({ "subsystem": "traffic-manager", "name":"traffic-manager", "do-bind-init":1}));
James Turner [Sat, 29 Sep 2012 18:02:03 +0000 (19:02 +0100)]
Support a --no-default-config option.
For (future) easier testing of the sim, support a mode where only explicitly named config / option files are loaded, instead of the default ones. (Including, for example, preferences.xml). This currently produces a non-functional sim, but will soon be more useful :)
No behaviour should change unless you try the new option.
James Turner [Fri, 28 Sep 2012 14:32:31 +0000 (15:32 +0100)]
Make FGControls behave like normal subsystem.
FGControls create/init/bind order was incorrect, causing initial property tree state to get over-written. Restructure the code so bind() sees correct values.
Thomas Geymayer [Thu, 27 Sep 2012 10:21:22 +0000 (12:21 +0200)]
Fix some CommStation bugs
- kHz/mHz conversion needs factor 1000 not 100
- Correctly read name for CommStations from NavCache
- Fix parsing CommStation names from apt.dat (Name
can contain spaces)
James Turner [Thu, 27 Sep 2012 08:27:48 +0000 (09:27 +0100)]
#793 - invalid data on final FP leg.
The Flight-plan leg data computation was omitting certain data for the final waypoint, which in turn made some of the route-manager data bogus when flying the final leg. Fill in some sensible values which we can compute.
Thomas Geymayer [Wed, 26 Sep 2012 22:41:23 +0000 (00:41 +0200)]
Fix ATIS /environment/attention handling
Using a tied property works only for one single usage of the
property. In reality FGATIS is normally instantiated four
times (nav/comm/1/2) where only the first instantiation
works correctly. All subsequent instantions fail to tie
and show some error messages.
Also tied properties shouldn't be used anymore.
Thomas Geymayer [Tue, 25 Sep 2012 21:06:27 +0000 (23:06 +0200)]
Canvas: Proper fix for OpenVG init handling.
- Redraw all canvases in the frame OpenVG is initialized.
Otherwise if multiple canvases are created in the same frame
only one of them would get correctly updated.
Thomas Geymayer [Tue, 25 Sep 2012 19:34:37 +0000 (21:34 +0200)]
Canvas: Redraw if OpenVG has been initialized.
If OpenVG/ShivaVG is initialized nothing is drawn in the same
frame, therefore we need to draw another frame to ensure all
paths are rendered correctly.
James Turner [Tue, 25 Sep 2012 16:24:12 +0000 (17:24 +0100)]
Use a helper thread to rebuild the navcache.
Avoid the application becoming unresponsive during nav-cache rebuilds. We still have to wait for the rebuild, but perform it on a helper thread so the main GUI thread stays responsive and hence doesn't trigger a beach-ball / 'not responding' alert. Also ensures there's some feedback (the spinner) during the rebuild operation, so users don't think we've hung.
James Turner [Mon, 24 Sep 2012 23:31:17 +0000 (00:31 +0100)]
Make FGTaxiNode and FGParking inherit FGPositioned.
In preparation for caching the groundnet in the NavCache, make taxi-nodes and parkings inherit from FGPositioned. As part of this, make them heap (as opposed to value) classes, disable their copy-constructors, remove many mutating operations, and give them real constructors.
Fix compilation with enabled EVENT_INPUT
Need to move the definition to the toplevel cmake file, since sources
are no longer compiled on directory level (individual libs per dir).
Thomas Geymayer [Fri, 21 Sep 2012 19:20:35 +0000 (21:20 +0200)]
Canvas: Performance improvements.
- Only render the canvas if something has actually changed
(Currently checked by looking for modified properties).
- Only write bounding box to property tree if it has been
recalculated (until now this happened every frame).
gyro heading indicator: realism when spin is low
Low spin or switched off gyros result in the indicator being stuck.
When the gyros are repowered, the indication doesn't jump to the correct
indication, but keeps the current error.
Allow instruments/systems to reset on sim reset
so they can instantly adjust to the changed environment.
(Not fully working yet, since some environment settings, like environemnt
pressure/temperature, still changes slowly after a sim reset - instead of
immediately jumping to the new setting. Also, METAR sometimes arrives too
late...).
James Turner [Wed, 19 Sep 2012 17:40:34 +0000 (18:40 +0100)]
Expose the route-path of leg to Nasal.
In advance of converting the Map and NavDisplay to use the canvas, expose the full route-path vector for each flight plan leg, as a vector on the leg. Use leg.path() to get this.
E.g.:
var fp = flightplan();
for (var i=0; i<fp.getPlanSize(); i += 1)
{
var leg = fp.getWP(i);
debug.dump(leg.path());
}
James Turner [Wed, 19 Sep 2012 17:17:44 +0000 (18:17 +0100)]
Kill off some globals.
Break some subsystem dependencies, by explicitly using properties to read the primary position, orientation and velocities. (Instead of directly accessing the primary model placement). This means a couple more globals can die.
James Turner [Wed, 19 Sep 2012 13:28:25 +0000 (14:28 +0100)]
Allow use of the system's SQLite3 library.
Keep distro packagers happy by having the option to use the system's sqlite library instead of our bundled version. Set SYSTEM_SQLITE=1 when running cmake to use the system one.
James Turner [Mon, 27 Aug 2012 23:26:36 +0000 (00:26 +0100)]
Implement a persistent cache for navigation data.
Cache the parsed navigation and airport data in a binary file to reduce
startup times and memory consumption (since only referenced FGPositioned
elements are held in memory).
Data will be reimported when the mod-time of any input file is changed.
If a global file is changed (nav.dat, awy.dat, apt.dat, etc), the cache
will be completely rebuilt, which takes approximately 30 seconds on
moderate hardware. (Future work may reduce this).
James Turner [Wed, 19 Sep 2012 10:37:19 +0000 (11:37 +0100)]
Fix classes derived from SubsystemGroup.
Various classes derive from SubsystemGroup, but extend the init behaviour. Fix those for the incremental init scheme, generally by forcing their init to be atomic. Can convert them to be truly incremental in the future if it's needed, but probably not.
Thomas Geymayer [Tue, 18 Sep 2012 21:21:50 +0000 (23:21 +0200)]
Canvas: Don't crash on removing child hierarchie from map
Currently if a SGPropertyNode is removed from the property tree
only for this single node a childRemoved event is triggered. So
if we just check for a specific child to be removed, we will never
be notified. This commit manually triggers the event recursively
for all children but this should probably go directly into simgear.
James Turner [Tue, 18 Sep 2012 19:50:28 +0000 (20:50 +0100)]
Sink position-init code into its own file.
Separate other init functions from position init, since they are unrelated, and made fg_init.cxx very complex. Next step will be brining some sanity to the position init logic :)
James Turner [Tue, 18 Sep 2012 19:29:36 +0000 (20:29 +0100)]
Make subsystem init incremental.
(Requires latest SimGear!)
Break fgInitSubsystems into several phases - subsystem creation, then binding and then init. Run init over multiple main-loop iterations so the application stays responsive to GUI/OS events during init.
There should be no behaviour changes due to this, except that during init Windows and OS-X should no longer show the beach ball / 'application not responding feedback', hopefully.
James Turner [Mon, 17 Sep 2012 23:58:27 +0000 (00:58 +0100)]
Make magavr a regular subsystem.
Remove various hacks and make magvar work like a normal subsystem, as part of the environment manager. Fix the remaining users of the globals->get_mag accessor, and hence kill off the global pointer.
Correct ATIS pressure phraseology
Unit is spoken for all values <1000hPa (to avoid confusion with inHg).
Unit is not spoken for values >=1000hPa (but don't drop highest digit).
(And we should replace "millibars" with "hectopascal" - we're missing the
necessary voice sample though.)
Thomas Geymayer [Thu, 6 Sep 2012 12:05:57 +0000 (14:05 +0200)]
property-interpolate: support using rate instead of time.
- property-interpolate now supports specifying the
interpolation time by passing rate instead of the actual time,
similar to max-rate-of-change in the noise-spike filter.
#858: Fix loading issue with aircraft models in "--fg-aircraft" directories
Something after FG 2.8.0 has broken loading aircraft models from
--fg-aircraft directories. Issue is fixed by resolving the aircraft path
in FGAircraftModel (though this module itself hasn't changed and things
were working before...).
Fix libsvn detection for some Linux distros
Distros like Debian/Ubuntu use architecture-specific directory structures
(like /usr/lib/x86_64-linux-gnu) which we cannot hardcode/guess, so we
really need to search the default paths.