1
0
Fork 0
Commit graph

6025 commits

Author SHA1 Message Date
curt
1ae9849062 More reorg and refactoring of the code.
Added a convenience function to estimate the time to intercept the selected
radial give the current heading and speed.  This can be useful to a flight
directory to compute the point to switch from armed to coupled mode at just
the right time so the pilot can roll out onto the desired heading on the
desired radial.

Add a first whack at estimating a ground track heading error (difference
between aircraft heading and ground track directon.)  This needs more work
and testing.
2005-12-28 21:45:43 +00:00
curt
ce08000a96 Cache some property values locally to reduce unnecessary property system
calls.
2005-12-28 19:11:30 +00:00
curt
ccddc99e73 More naming cleanups. 2005-12-28 18:05:03 +00:00
curt
3bacacfb5c Clean up some of the member data naming. 2005-12-28 17:26:57 +00:00
curt
c694fe43ee 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.
2005-12-28 16:53:19 +00:00
ehofman
d11df8fcc8 Remove a debugging cout. 2005-12-27 14:30:56 +00:00
ehofman
7b1f1d73e6 Detect the hostname as early as possible to prevent a segmentation fault (and an unknown exception in the main loop situation. 2005-12-27 14:02:38 +00:00
mfranz
a67cb7d6fb no more "Aborting ...\nPossible cause: Success" 2005-12-22 23:32:23 +00:00
ehofman
faf91ae9e9 Revert to the previous version, this is just a glimps of the future. 2005-12-22 15:13:50 +00:00
ehofman
62c6063fa1 Only test for --fg-root and --aircraft in ~/.fgfsrc et all if it wasn't specified at the command line. 2005-12-22 14:14:08 +00:00
ehofman
b788a204c4 Add an option to enable or disable the save-on-exit option. Add a season commandline option. 2005-12-22 13:51:11 +00:00
ehofman
ffa92dfe4b 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. 2005-12-22 10:25:07 +00:00
fredb
653f063bcf Fix a typo and an unitialized variable 2005-12-22 06:42:00 +00:00
ehofman
49ba607726 Get the environment variables HOME and HOSTNAME only once. 2005-12-21 13:36:04 +00:00
ehofman
e0db27eb6f Vassilii Khachaturov:
clean up some build warnings caught with gcc-4.0.
2005-12-19 13:15:09 +00:00
ehofman
9090fb5bf4 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().
2005-12-19 13:03:19 +00:00
ehofman
2d4ffc0dce Vassilii Khachaturov:
clean up some build warnings caught with gcc-4.0.
2005-12-19 12:53:21 +00:00
ehofman
3986347f37 MSVC fix. 2005-12-18 09:35:01 +00:00
ehofman
f6174d2bf0 Stefan Seifert: implement persistent dialog options, so changes in rendering, static LOD and sound settings dialogs are made permanent. 2005-12-17 15:34:37 +00:00
mfranz
96c0a7bbc1 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().

Examples:  _setlistener("/sim/crashed", func {print("haha!")});
           _setlistener("/foo/bar", func { print(cmdarg().getPath() ~ " changed")})
2005-12-16 19:11:03 +00:00
curt
249a1264ff Remove the old hardcode fps display. This is now replaced with a nasal/gui
display that can be dragged around the screen to an unobtrusive location.
2005-12-15 22:18:06 +00:00
mfranz
f6225f5cb7 remove a few unused vars
menubar: cosmetics of the day
2005-12-15 20:07:14 +00:00
mfranz
98081d9243 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.
2005-12-14 07:45:47 +00:00
curt
7c0cf9dff9 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.
2005-12-12 22:22:28 +00:00
curt
bbb8b066eb 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.
2005-12-12 21:15:20 +00:00
ehofman
90a149ffa3 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
2005-12-11 13:37:06 +00:00
ehofman
04f7175fd0 The most important part is that it fixes possible
memory corruption with that iterator decrement past the erase call.
2005-12-11 13:17:20 +00:00
ehofman
6773bf9571 Additional checks to io arguments. This prevents fg from crashing on invalid
arguments.
2005-12-11 13:12:26 +00:00
ehofman
4c395bf7a6 MSVC8 fixes. 2005-12-11 12:53:54 +00:00
mfranz
688bcb579f final cosmetics (s/_entries/_objects/ and comments) 2005-12-09 10:43:09 +00:00
mfranz
1caefda2a0 - 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; ..."
2005-12-08 15:03:08 +00:00
curt
ec7f73a5bb Make UFO honor elevator trim so it will respond to autopilot. This allows
you to do altitude hold mode and fly automated ILS approaches.
2005-12-07 23:26:38 +00:00
mfranz
1990db9ca5 yet more cleanup; clearer warning messages 2005-12-06 21:03:15 +00:00
mfranz
c10f583c11 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.  :-)
2005-12-06 19:51:31 +00:00
ehofman
e35911e45a Vivian: downgrade log levels from ALERT to INFO, tidy up the code. 2005-12-06 18:48:56 +00:00
mfranz
eb68e9ad36 remove two checks that were only useful during development; fix typo 2005-12-06 18:46:39 +00:00
ehofman
5fa3420e36 Add files required by autotools. 2005-12-06 18:43:02 +00:00
ehofman
da08a84bc5 ignore some autogenerated files. 2005-12-06 18:34:03 +00:00
ehofman
5956ade90c Mathias: silence some valgrind warnings so that you can concentrate better on the real problems. 2005-12-06 18:32:07 +00:00
ehofman
0e242871bb Give Vivian some more credit. 2005-12-06 18:26:56 +00:00
mfranz
ac2c1fcd43 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.  :-)
2005-12-06 17:56:17 +00:00
mfranz
435d874e35 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

mf: typos
2005-12-04 10:43:49 +00:00
mfranz
72f46a4a6f 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.
2005-12-03 10:20:35 +00:00
daveluff
24e9bb6ce8 Alex Romosan: Pass strings by reference not value 2005-12-02 22:52:09 +00:00
daveluff
1de61c8afd Alex Romosan: Make GpsPage::GetId() pure virtual, and pass strings by reference not value 2005-12-02 22:50:10 +00:00
mfranz
00e0546cab 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.
2005-12-02 21:46:33 +00:00
mfranz
ca96f2b3a4 Mathias FROEHLICH: fix strange gcc 4.0.* strict aliasing problem 2005-12-02 16:43:50 +00:00
mfranz
b716c6d15b 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 ...
2005-12-02 00:10:25 +00:00
andy
d71a541837 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.
2005-12-01 21:06:25 +00:00
daveluff
c92bcb4126 Ignore generated files 2005-11-30 21:31:50 +00:00