curt [Wed, 28 Dec 2005 16:53:19 +0000 (16:53 +0000)]
Step #1 of some code refactoring and cleanups. The nav radio code was
written very early in the project and has grown and evolved and been added
onto many times. It is long overdue for a code cleanup/reorg pass.
ehofman [Thu, 22 Dec 2005 10:25:07 +0000 (10:25 +0000)]
Put the user configuration file sequence into it's own function. This will slightly tidy up the code but more importantly will make it consistant across the program.
ehofman [Mon, 19 Dec 2005 13:03:19 +0000 (13:03 +0000)]
Olaf Flebbe:
The prototype of update_metar_properties does not match overridden func.
trafficmgr: iterators below begin() and after end().
tower.cxx : iterator incrementing beyond end().
mfranz [Fri, 16 Dec 2005 19:11:03 +0000 (19:11 +0000)]
add _setlistener() function, so that slow property polling loops can be
replaced with efficient listener callbacks. One use is the new FPS display.
This is reviewed and OK'ed by Andy, relatively trivial and separated from
the rest of Nasal, so problems are quite unlikely and confined to users of
this function.
The callback is executed whenever the property is written to -- even if
the value didn't change. The triggering Node is available via cmdarg().
mfranz [Wed, 14 Dec 2005 07:45:47 +0000 (07:45 +0000)]
don't check for subsequent indices (n), but for child positions; This way
it's also possible to enable/disable menu/item entries with higher numbers.
This can be useful for adding entries from other config files (aircraft
specific or local). I'd say aircraft files can use indices starting with
[100] and local files starting with [1000]. Such high number will never
collide with an entry in menubar.xml, even if entries are added/removed
there.
curt [Mon, 12 Dec 2005 22:22:28 +0000 (22:22 +0000)]
Mathias Fröhlich's code, Curt Olson's comments:
Display the ground intersection point on mouse click (if click not consumed
by the gui or the panel.) This should eventually get stuffed into the
property tree.
curt [Mon, 12 Dec 2005 21:15:20 +0000 (21:15 +0000)]
Mathias Fröhlich:
Computes the pick direction and starting point. This is code that translates
a screen coordinate into a vector in the FlightGear world (between the eye and
the on-screen coordinate.) Armed with this vector in FG world coordinates,
you could call a scenery intersection routine and lookup the lon/lat/elev of
the point in the world that was clicked on.
ehofman [Sun, 11 Dec 2005 13:37:06 +0000 (13:37 +0000)]
Vassilii Khachaturov:
* in some cases more specific sg exception types were used in place
of the more generic one, e.g., sg_io_exception instead of sg_exception
when the context of the error was an IO error
* in some cases, the error message was made more specific
* minor style fix for exception rethrowing --- using throw; whenever
a re-throw is made; sometimes optimizing away the exception symbol name
in the catch handler at all
* more specific catch handlers added in some places -- e.g.,
an sg_io_exception caught ahead of sg_exception
mfranz [Thu, 8 Dec 2005 15:03:08 +0000 (15:03 +0000)]
- fix typos
- fix indentation (there were 2, 3, 4, 7(!) space indents as well as tab
indents, all mixed together)
- no code changes, except one "if (foo) {}" changed to "if (!foo) return; ..."
mfranz [Tue, 6 Dec 2005 19:51:31 +0000 (19:51 +0000)]
removal of yet more stuff, left over from development; further simplification;
requires to remove some constness, though (we are adding listeners!);
If I continue like that, nothing will be left. :-)
mfranz [Tue, 6 Dec 2005 17:56:17 +0000 (17:56 +0000)]
allow disabling/enabling of menu entries via "enabled" property;
Unfortunately, we don't have an easy way to access the puObjects
only by knowing the respective XML property node, because the
menu structure was built by plib from string lists. That's why
we walk the puMenuBar tree and store {property node}->{puObject*}
pairs in a map. With this infrastructure in place we can now
easily enable/disable entries, but we can also make other changes
to menu buttons as we see need. The structure of puMenuBar is
described in the pui documentation, so it's less of a hack than
it looks. :-)
mfranz [Sun, 4 Dec 2005 10:43:49 +0000 (10:43 +0000)]
Mathias FROEHLICH:
remove a hack and do it properly: if the requested elevation is for some
reason below the surface and the intersection test fails (as it appears
to be the case in EGLL), try again from 10000m ASL
mfranz [Sat, 3 Dec 2005 10:20:35 +0000 (10:20 +0000)]
globals.cxx -- FGGlobals::set_fg_scenery():
Insert empty string as marker between FG_SCENERY path elements.
FG_SCENERY=A:B expands to [A/Terrain, A/Objects, "", B/Terrain, B/Objects, ""]
(assuming that both A/ and B/ have Terrain/ and Objects/ subdirs).
tileentry.cxx -- FGTileEntry::load():
Check all tile dirs in FG_SCENERY from left to right: add all objects
to the scenery until a terrain tile was found: In this case read the
rest of that group (i.e. the Objects/ twin dir) and then stop scanning.
Better structuring of log messages & fix warnings.
mfranz [Fri, 2 Dec 2005 21:46:33 +0000 (21:46 +0000)]
FGTileEntry::load(): store objects in a vector, then generate terrain or
sea tile, and finally process the objects. This guarantees that all objects
are placed relative to a valid tile center, rather than to the origin (0/0/0).
This is important for objects in sea tiles, and allows to display objects
of *.stg files that came sooner in FG_SCENERY.
mfranz [Fri, 2 Dec 2005 00:10:25 +0000 (00:10 +0000)]
returning addresses of auto vars is *dangerous* (ask Vasilii! :-)
This was the reason why some people (especially SuSE10.0/gcc 4.0.2
users) couldn't see others in MP. I don't even know why I'm committing
that. It's less important than taxi lights ...
andy [Thu, 1 Dec 2005 21:06:25 +0000 (21:06 +0000)]
Swap signs of the twist and incidence values to match the
documentation and author expectations. Positive just wants to mean
"up", no matter what the axis conventions have to say.
daveluff [Wed, 30 Nov 2005 01:21:45 +0000 (01:21 +0000)]
Add support for a special-instrument xml attribute, which triggers loading of a know c++ hard-coded instrument. This has some ugliness that will need removing at some point. In particular, panel reload is broken for panels that include a special-instrument, since this triggers subsystem reload which is a fatal error. Note that this *only* affects panels that use a special-instrument - all other panels are unaffected
daveluff [Wed, 30 Nov 2005 00:47:41 +0000 (00:47 +0000)]
Code to extend FGs current GPS functionality to allow the simulation of a specific approach capable GPS. Eventually this file should be broken up and the code removed to other files, such as FGs current gps files
mfranz [Wed, 23 Nov 2005 12:48:09 +0000 (12:48 +0000)]
of course I should have known that it would only work in tests *before*
committing, and would instantly break afterwards. Causes endless loops.
Re-uglify. Sorry for the noise. :-/
curt [Tue, 22 Nov 2005 17:02:31 +0000 (17:02 +0000)]
A long, long time ago, a bug was inadvertently introduced into the threaded
metar fetcher. Effectively this caused the metar thread and the main
thread to both attempt to fetch weather data. This could lead to long pauses
when the main thread decided to fetch the weather, and introduced a race
condition that could cause a segfault/crash.
Investigating this issue, I discovered that even longer ago, someone confused
#defines and #ifdef symbols with C/C++ variables. If I #define XYZ 0 it is
defined so #ifdef XYZ is true, not false like a variable. Our thread
detection made this mistake and there were follow up patches to work around
it.
So I fixed the configure script (ahhh, reading the autoconf manual is highly
recommended excercise for people editing the configure.ac file.) I also
discovered that we were hardwiring with_threads=yes with no way via configure
options to disable threads from the build so I fixed that.
Then I patched up the #ifdef's scattered through the code to match the
configure script changes, oh and by the way, I stumbled upon a past typo
that led to the race condition in the metar fetching thread and fixed that.
curt [Tue, 22 Nov 2005 16:52:18 +0000 (16:52 +0000)]
"info -f autoconf" is a beautiful thing. Fixed the configure script so
we can actually configure the project without threads. Previously threads
were always forced on no matter what configuration options were passed in.
ehofman [Wed, 16 Nov 2005 15:23:18 +0000 (15:23 +0000)]
David Culp:
Here's a fix for a bug I introduced when I updated the AIStorm with
turbulence. The change I made to the FGAIEntity struct was overriding the
thermal <strength-fps> data.
curt [Tue, 15 Nov 2005 22:00:41 +0000 (22:00 +0000)]
Updates from Fred Bouvier:
You'll find attached the modified fgadmin that takes care of
'Objects' and 'Terrain' if they exist. I also implemented the
'Check all' / 'Check none' feature you suggested several months
ago.
mfranz [Mon, 14 Nov 2005 17:18:27 +0000 (17:18 +0000)]
Prevent download of thousands of METAR reports if all are for some reason
too old (wrong system time or broken proxy): stops after 10 stale reports
were fetched in a row. This should simply stop further fetching, but due
to a bug in the threading system(?) it does currently lead to abortion,
just like any other exception in the fetcher.
mfranz [Sat, 12 Nov 2005 10:51:58 +0000 (10:51 +0000)]
This is an ugly fix for an ugly problem. And no, the two uglies don't cancel
each other out. The problem is this: if we press, for example, "Ctrl-a", but
release the "Ctrl" modifier button *before* the "a" button (which nobody does
intentionally, but which happens all the time), then we don't get the RELEASE
signal on "Ctrl-a" (keycode 1), but on the "a" (79). But "a" hasn't been
pressed, so the signal is dropped. And who releases "Ctrl-a"? Nobody!
So the next PRESSED signal for "Ctrl-a" is ignored, too. It is still
"pressed" after all, isn't it? That's the reason for the occasional
non-functioning of keys.
Due to the nearing 0.9.9 release, I only commit a crude last-minute fix.
It's not as intrusive as it looks, and shouldn't be "dangerous" at all.
It only makes sure that when we get an unexpected RELEASE for one letter
key ("a") that the two twins "A" and "Ctrl-A" are released if they are
still in "pressed" state.
The proper fix will be to let fg_os{,_sdl}.cxx always report presses on the
same key ("a", "Shift-a", "Ctrl-a", "Alt-a", and other combinations of
modifiers) as the *same* key (97), only with modifiers appropriately set.