Durk reminded me of this - when we're missing procedures data (the common case), synthesise a plausible (but possibly dangerously unrealistic) departure and approach. Will work fine for airports in gentle terrain, and likely kill you at challenging airports. You have been warned.
When a position is modified for an in-cache FGPositioned, we need to update the runtime information too, or the Octree code may (rightly) complain that it's seeing inconsistent data. Also make the Octree check an exception throw, and verbose, so this is easier to detect in the future.
Don't show invalid AI/MP models in the HUD (after they were removed from
the scene).
Also, when a radar is installed, consider radar/in-range for HUD display.
ASCII protocols consisting of a single chunk only (one variable per line)
would not work when no "separator" was defined.
Also add error message for protocols with more than one var per line which
are missing a separator...
Make landings and takeoffs look more correct; tweak climb-out and touchdown phases in particular, so the turn to destination heading occurs earlier on climb out, and touchdown occurs close the GS transmitter / some distance down the runway from the beginning.
Add missing ATIS elements (transition level, expected approach,
precipitation, runway surface warnings).
Minor phraseology fixes for US/Europe.
Adds "/sim/atis/concise-report" option to use abbreviations (CAVOK etc),
and omit "obvious" units (depends on airport).
Trigger ATIS updates for significant pressure changes.
so we can split ATIS voice files into separate files, i.e. for airport
names and phraseology, so we don't need to regenerate airport names when
extending/changing phraseology. Also allows to add custom airport names.
Enable switching voice files at run-time (different airports could have
different voices...).
puObject only provides float, not double, which causes precision/rounding
issues with some numerical values (try "114.2").
Work around: obtain string value, and manually convert with proper double
precision.
Error/offset induced by precession and yaw also depend on spin (no spin =>
no additional error/offset).
Error/offset induced by changing a/c orientation while gyro spin is
low (<<1) should apply to the "offset" (instead of "error") property.
Expand the performance DB logic to support aliases, and select based on aircraft type as well as class. This allows to introduce some variation into AI traffic performance. Change the initial climb-out waypoints to use pitch-hold until passing 3000', which looks much more convincing
Make traffic manager startup asynchronous, but also avoid frame-stutter due to file parsing on the main thread. Note only XML parsing happens on a thread - once that's complete, everything happens as normal on the main thread, as before.
Apparently most filters are only filtering on type - we weren't running the filter body for navaid or comm-station lookups, causing weird ATIS bugs. Ensure that we actually run the filter at the point we have an FGPositioned* result.
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.
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}));
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.
FGControls create/init/bind order was incorrect, causing initial property tree state to get over-written. Restructure the code so bind() sees correct values.
- 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)
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.
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.
- 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.
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.
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.
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.
New commands request-metar and clear-metar will bind metar reports to an arbitrary property tree path. E.g:
fgcommand("request-metar", var n = props.Node.new({ "path": "/foo/mymetar", "station":"LOWI"}));
- 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).
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.
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...).
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());
}
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.
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.
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).
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.
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.
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 :)
(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.
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.
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.)
- 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.
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...).
- Groups store property nodes for different styles and pass them
to child elements on creation (No dynamic updates yet)
- Use StyleSetter map instead of loads of if/else if statements
for setting element styles.
- Unify element style properties (Only use one property, instead
of multiple like it has been with colors)
- Fix: Create only one element per property node (Was two)
This might need to be back-ported to 2.8 (to make a 2.8.1), unless it's been exposed by some of my other changes. Which I think is unlikely but not impossible.
so package builders don't need local patches.
Also, instead of hardcoded firefox, use "xdg-open" or "sensible-browser"
launchers on Linux, to auto-detect user's preferred browser.
Override with cmake switch -DWEB_BROWSER=...
(Not affecting Mac/Win which are hard-coded anyway).
- Use bounding box intersections to determine which element is
hit.
- Transform mouse coordinates to local coordinates.
- Try to get osgText bounding box correct (or at least better)
- Refactor and unify common functionality of canvas::Window and
canvas::Image
- Make canvas::Image actually work
- Allow using canvases inside canvas::Image
* Use new canvas:// "protocol" to allow using canvases in
place of images
- Prepare for categorizing canvases:
* Move canvases to /canvas/by-index
* Later support linking to other nodes in subbranches of
/canvas
- Add platform independent clipboard layer for Nasal access
to clipboard (thanks to Hooray for basic code)
- Add Windows clipboard access
- Add partial X11 clipboard access (only reading from clipboard)
- Add fallback clipboard for application internal clipboard if
platform not supported
- Add some helper functions to FGNasalSys
This code is non-functional, but contains most of the stubs to show what's required to add property get/set access, convert to from ghost & C++ types, and manage ownership. Element derived classes & inheritance (e.g., methods on image/path/map elements) will follow, along with some actual functionality!
- Refactor CanvasMgr into PropertyBasedMgr to be also used
for the Canvas GUI system.
- Get rid of tied properties in the Canvas system.
- Add new placement type 'window' for placing canvases onto
windows
- Pass mouse events to Window class (only if cursor is over
window)
- Refactor canvas placement clean up
- Allow hiding objects
- Use UTF-8 encoding for text elements
- Add paramter max-width to text elements
- Support stroke-linecap for path elements
- Fix mouse coords
- Set better mipmap filter
- The new map element automatically transforms geo coordinates
(lat, lon) to the according screen coordinates.
- Currently one type of projection is supported
(Sanson-Flamsteed projection)
Adds serviceable/operable properties to comm radio.
Obey comm radio power source (no power => no radio => no ATIS).
Also further clean-up to stuff belonging to former ATCmgr module.
Add same property as for nav radio, to provide a property to cockpit models
whether the ADF is active (serviceable/switched on/power ok/...). Useful
to enable/disable displays (i.e. KR87).
- Add an update callback to calculate a bounding box for every
path to ensure correct culling of paths.
- Ensure OpenVG get's initialized even if elements are subject to
culling.
To keep the tutorial looking nice, switch off the panel extent outlines for the 2.8 release. Longer-term I should remove the code, or add a separate property if this feature is actually useful.
When inserting with an invalid index, ensure we return the leg based on the fixed-up index, not the original one. Thanks to Matthias Götz for the catch!
Restore previous behaviour where the 2D panel is automatically hidden when the current view is != 0. Also add two property controls to alter this behaviour, and the 'autohide' behaviour at runtime. (Requires an fgdata update to get matching preferences.xml)
https://code.google.com/p/flightgear-bugs/issues/detail?id=790
The glideslope station was only searched once whenever the NAV station
changed. However, sometimes a mismatching G/S station is found, since
another G/S station is still closer when the NAV station changes.
When this happened, the G/S station was never updated again (while the
NAV station stayed in range), resulting in the NAV receiver providing
correct localizer, but bad G/S data (data matching another, remote station).
Issue is fixed by alternating between searching NAV and G/S stations.
Make sure gs-inrange and deflection outputs have same behaviour, no matter
which out-of-range condition applies (i.e. aircraft moved out of range,
frequency changed, ...).
- Fix stupid memory corruption bug
- Fix bounding box calculations
- Fix docs
- Fix text size
- Expose setting background color
- Expose trigger for updating elements
- Untie nodes if deleting according element
- Allow deleting canvas, text and group elements
- Allow creating groups as children of groups
- Support text-enable condition on symbols
- support <limit>N</limit> on symbols to restrict
to closest N symbol instances.
- change search to hopefully be more stable at
larger ranges.
Sink the 2D panel logic into FGPanelNode, simplifying
renderer.cxx and a few other places. Also allows potential
for unloading / paging of 2.5D panels in the future.
The routing behaviour now happens entirely in Nasal,
using a delegate, and can be over-ridden or disable
by aircraft authors. Default behaviour should be
unchanged.
Convert the route-manager to use a flight-plan internally, and expose
flightplan, leg and procedure data to Nasal. Move the Level-D parser
into its own file.
Also adapt MP and traffic module to enable the AI module when required.
This makes /sim/ai/enabled an internal property: it can default to false
(in future), and can be enabled as soon as any user-level feature (traffic,
MP, local weather, ...) requires it.
Adapt FGPUIMenuBar to use new Locale module.
Adds support for separate "key" property for menu items, so keyboard hints
are no longer part of the item's label (and do not need to be part of the
translated text resources).
Copies HELVETICA_12 from PLIB to FG, adding some more chars needed for
Latin1/ISO-8859-1 (West European languages).
(SANS_12B and HELVETICA_14 also support Latin1, but not the other default
PLIB fonts).
SceneryPager singleton must not be removed while FGScenery is still alive,
so hold a reference to it in FGScenery, saving the pager from being
deleted first.
Aircraft could fall through the ground on scenery reload. Properly reset
the "sceneryloaded" flag to pause FDM processing while scenery is being
reloaded. Also stop processing some instruments while scenery is reloaded.
Not every xml-autopilot filter needs to run at the update rate
of the FDM. This only makes sense for the autpilot filters. Those,
who update instrument needles or environment properties for example
may run at frame rate.
This patch (thanks to ThorstenB, who is the author) forces those
filters defined in /sim/systems/autopilot into the FDM loop and those
defined in /sim/systems/property-rule into the default loop. They
show up as xml-autopilot and xml-proprules in the performance monitor