1
0
Fork 0
Commit graph

61 commits

Author SHA1 Message Date
James Turner
dd2eec7bd8 Airways/procedures code - add new data structures to store waypoints and
procedures, and routing algorithms, and modify the GPS, route manager and
WaypointList to use the new objects.
2010-10-20 09:02:02 +01:00
James Turner
cc7a9d4727 Make even more implict includes explicit. 2010-08-07 13:00:33 +01:00
jmt
e9a9ad6478 Fix displaced threshold handling when using in-scenery definitions of runways. 2009-12-07 00:13:57 +01:00
jmt
d4d1d827d0 Make FGRunway track reciprocal runways. 2009-09-17 22:51:44 +02:00
jmt
2dee4ef14f Update FGRunway to process information from threshold.xml files. 2009-09-03 00:02:47 +02:00
torsten
b1e2b7ee20 missing declaration of SGPropertyNode 2009-09-03 00:02:47 +02:00
jmt
1c015387ba Initial framing for reading in-scenery airport data. 2009-09-03 00:02:47 +02:00
jmt
86d1e4ea9d Directly associate runways objects with their ILS navrecord (if one exists) 2009-06-15 10:29:44 +02:00
jmt
e39373cb6a Clean up naming of the 'point on runway' helpers, to get rid of the confusing
notion of a 'displacedThreshold'. Now there's just a real threshold,
displaced or otherwise, and people who care about the paved area can use
'begin' and 'end'. Thanks to John Denker for pointing out the confusion this
leads to. Using 'end' also gets rid of the 'reverseThreshold' name, which was
clearly a bad choice of mine.
2009-01-07 10:22:53 +01:00
jmt
7345a044e0 Split runway and taxiway into separate classes, with a (new) common base.
This makes taxiways smaller (important since at present there are so many).
Restructure the apt.dat parsing code to use a helper class instead of one long
function, and to do less work when parsing the file.

Some of these ideas come from Yon Uriarte's patches - thanks Yon.
2009-01-04 00:08:12 +01:00
jmt
02d1b14c1a Finish conversion of FGRunway to a real class - all public members are gone. 2008-12-24 15:45:35 +00:00
jmt
7d5d756095 FGPositioned clean-ups - apply some desirable changes (such as making members
const) which were previously tricky but now easy. Make it possible not to
index certain types (used for taxiways) and exclude anonymous items from
the name index. Related to this, clean up FGRunway further - remove some public
members, and fix a dumb bug of mine, where we create reciprocal entries for
taxiways.

This should make startup (slightly) quicker, and shrinks FGRunway somewhat.
2008-12-24 14:48:30 +00:00
ehofman
aa78341698 James Turner:
Convert FGRunway to be heap-based, and inherit FGPositioned. This is a large, ugly change, since FGRunway was essentially a plain struct, with no accessors or abstraction. This change adds various helpers and accessors to FGRunway, but doesn't change many places to use them - that will be a follow up series of patches. It's still a large patch, but outside of FGAirport and FGRunway, mostly mechanical search-and-replace.

An interesting part of this change is that reciprocal runways now exist as independent objects, rather than being created on the fly by the search methods. This simplifies some pieces of code that search for and iterate runways. For users who only want one 'end' of a runway, the new 'isReciprocal' predicate allows them to ignore the 'other' end. Current the only user of this is the 'ground-radar' ATC feature. If we had data on which runways are truly 'single-ended', it would now be trivial to use this in the airport loader to *not* create the reciprocal.
2008-09-11 08:38:09 +00:00
durk
554dba0f3f James Turner: Here's a trivial patch, when you have a moment:
- removes various members from FGRunway which no-one was using
- any of these can be trivially re-instated if and when someone
actually wants to use them - but right now they're simply bloating up
FGRunway, which we have lots of, because it currently includes all the
taxiways in Robin's data.
- that's it.
2008-08-21 16:34:33 +00:00
durk
301054204e James Turner: Improved runway management code:
- Runways are now part of an airport, instead of a separate list
 - Runways are no longer represented as a boring struct, but as a class
   of their own.
 -Improved runway access to unify various runway access methods.
2008-08-14 18:13:39 +00:00
ehofman
667e64e1eb - remove the SG_GLxxxx_H #defines, since OSG provides its own versions
- this exposed a bizarre issue on Mac where dragging in <AGL/agl.h> in
   extensions.hxx was pulling in all of Carbon to the global namespace
   - very scary. As a result, I now need to explicitly include CoreFoundation
   in fg_init.cxx.
 - change SG_USING_STD(x) to using std::x
2008-07-27 16:25:13 +00:00
ehofman
d9bfd5a425 This should apply, and everything should build cleanly, in isolation from the
SimGear change. It changes all the SG_xxxx to be the 'real' includes, and gets
rid of many #ifdef SG_HAVE_STD_INCLUDES. As an added bonus, rather than
replacing 'SG_USING_NAMESPACE(std)' with 'using namespace std', I just fixed
the small number of places to use std:: explicitly. So we're no longer polluting
the global namespace with the entire contents of std, in many cases.

There is one more 'mechanical' change to come - getting rid of SG_USING_STD(X),
but I want to keep that separate from everything else. (There's another
mechnical change, replacing <math.h> with <cmath> and so on *everywhere*, but
one step at a time)
2008-07-25 18:38:29 +00:00
timoore
ebf2e996e9 Fixes for compiling with gcc 4.3
Include standard header files and qualify with std:: where needed.

Qualify various char parameters and variables with const.
2008-04-13 21:12:36 +00:00
mfranz
73bec9e1f8 - make weighting factors for search function with target heading permanent
- add "good" offset as suggested by Thomas FOERSTER
- minor tweaks
2007-10-12 20:53:46 +00:00
mfranz
75383a3996 better check all runways, not just the first one :-) 2007-10-07 17:45:58 +00:00
mfranz
37cc06e335 minor fix to please (other) pedants :-) 2007-10-04 20:16:27 +00:00
mfranz
70de6eac24 never add an untested "harmless" one-liner before committing ... 2007-10-04 17:23:10 +00:00
mfranz
d20db83c86 when searching for the runway best matching a target heading, also consider
the runway length/width/surface material, so that fgfs doesn't drop one on
the ridiculous grass stripe parallel to the grown up concrete runway
(LOWL, LOXZ, ...). The weighting factors are for now made configurable,
so that they are easier to adjust. This can later be made static.
(will soon get forward ported to fg/osg)
2007-10-04 17:11:19 +00:00
timoore
428acda9e8 Fix for runway search glitch
Suggested by K.Hoercher <wbhoer@gmail.com>
2007-09-23 20:55:55 +00:00
timoore
78228d2734 Change tower location to an SGGeod. Include taxiways too.
This has been split from Csaba's ATC ground radar contribution.
2007-09-09 23:21:48 +00:00
frohlich
654cc64659 Modified Files:
Airports/runways.cxx: Correct termination condition.
2007-02-09 05:34:34 +00:00
daveluff
771fbd680a Helipads don't have a number per end, so don't attempt to return a (broken) reverse rwy number 2006-03-12 21:10:34 +00:00
mfranz
c9813d1b5d new FSF address 2006-02-21 01:16:04 +00:00
ehofman
62a359cc4a Alex Romosan:
* Use "const string&" rather than "string" in function calls when appropriate.
* Use "const Point3D&" instead of "Pint3D" in function calls when appropriate.
* Improved course calculation in calc_gc_course_dist()
* Safer thread handling code.

Vassilii Khachaturov:

Dont use "const Point3D&" for return types unless you're absolutely sure.

Erik Hofman:

* Use SGD_(2)PI(_[24]) as defined in simgear/constants.h rather than
  calculating it by hand every time.
2005-10-25 13:49:55 +00:00
curt
5e81b331e1 David Luff:
Attached is a patched runways.cxx.  This fixes the find runway nearest to a given heading code.  This was returning the last runway loaded at a given airport, not the nearest runway to the heading requested (which seems to always be 270deg by default).  I have no idea how this has survived unnoticed for so long - I think it might be because you need to start at an airport with a runway near to 27 and one much greater than 27 eg. 36 to really tickle it, otherwise the runway nearest to 27 tends to be the final one loaded anyway.  Try starting at KARR with and without the patch and note the surface wind.  This should go in before the release.
2004-12-26 23:31:35 +00:00
curt
222446df29 Replace the data/Airports/basic.dat.gz and data/Airports/runways.dat.gz with
a single apt.dat.gz file which is in the native X-Plane format.

To do this I wrote a front end loader than builds the airport and runway
list.  Some of the changes I needed to make had a cascading effect, so there
are minor naming changes scattered throughout the code.
2004-12-22 23:57:07 +00:00
ehofman
c537267f96 Durk Talsma:
Okay, here's the latest update to the tarffic manager/AI Manager. AITraffic
can now fly multiple routes and be initialized while sitting statically at
airports.
2004-11-29 09:41:43 +00:00
curt
d05121ef46 Fix my mailing address by replacing it with my web page. 2004-11-19 22:10:41 +00:00
curt
a3cde21637 Curt Olson:
These change add some code that at initialization time will snap all
localizers into perfect alignment with their runways.  It's my experience
that the DAFIF/FAA data reports runway and localizer headings to a level
of precision that is great for making charts, or adjusting your OBS, etc.
But the level of precision of this data can be far enough off to make you
visibly *un*aligned with the runway when the CDI needle is centered.

There are probably cases where the localizer isn't really perfectly
aligned with the runway, or intentionally misaligned to avoid obstacles
or terrain.  So I have made this configurable for those that trust the
data more than I do.  Just set "/sim/navdb/auto-align-localizers" to
true/false in the preferences file to turn this feature on or off in the
code.
2004-05-28 16:24:43 +00:00
curt
4fca15fa1d Avoid a possible segfault crash if a nonexistant airport is specified. 2004-02-25 02:16:36 +00:00
ehofman
0e370e6e28 Fix a problem where older IRIX compilers needed a typecast for certain opperations 2003-10-16 14:14:03 +00:00
curt
c81fbb937a David Luff:
Firstly, the search of a given runway number was coming out wrong if the
reverse of the one actually in the database was given, resulting in the AI
plane going to the wrong runway.  This was caused by the fact that if the
reverse runway number to the one wanted was matched then revrwyno was
assigned to rwy.rwy_no, whereas actually it was the original runwayno that
should have been assigned.

Secondly, whilst instrumenting the search with couts to see what was going
wrong, I noticed that one runway would come up loads of times.  It turns
out that this is because taxiways and the next airport line were loaded in
as the last runway, with only the type changed, in the constructor.  Thus
the total number of runway entries for all except the last airport equalled
(no-of-runways + no-of-taxiways +  1).  I've changed a couple of lines to
fix this.

[Curt: this was partially fixed last week, but now it should be completely
fixed.  Thanks Dave!]
2003-09-02 19:12:11 +00:00
curt
1cbcd89e5e I had to make a small mod to the runways.dat format, code changes to handle
that.
2003-08-29 20:27:48 +00:00
curt
e6859e4fe0 Redo the runway database scheme to use a flat/ascii file and load the entire
database into memory at the start.  This should completely eliminate any
dependencies we have on metakit.
2003-08-29 04:11:23 +00:00
ehofman
f39e079b75 Duh! Remove some debug messages 2003-06-03 14:36:56 +00:00
ehofman
32bb2af2af Fix a bug where FlightGear would crach when an aiport id was geven in lower
case. It turned out that MetaKit is case insensitive, so I adden an extra
check to see if we got what we were asking for.
2003-06-03 14:34:02 +00:00
ehofman
df2ce45ab7 Change cout and cerr in SG_LOG() where appropriate, otherwise comment it out 2003-03-20 10:43:02 +00:00
ehofman
f2e2101264 David Luff writes:
I've fixed a bug in FGRunways::search(aptid, tgt_hdg) which wasn't working properly for airports with multiple parallel runways. I've also firmed up and pulled out into it's own function the GetReverseRunwayNo code, and done some input checking.

As a result of fixing the above in runways.cxx, I've pulled out the
parallel implementation in the functions that set position by airport and
heading/runway number in fg_init.cxx and called the runways functions
instead.
2003-03-20 09:38:06 +00:00
curt
9b24a37180 David Luff:
// search for the specified apt id and runway no
bool FGRunways::search( const string& aptid, const string& rwyno, FGRunway*
r )

there was a bug, in that each runway corresponds to *two* runway numbers
(eg 01/19, 10L/28R) but the function was only checking one.  I've modified
it to check the supplied number against both possible numbers for each
runway.


Secondly, I sent in the function:

// Return the runway closest to a given heading
bool FGRunways::search( const string& aptid, const int tgt_hdg,
                        FGRunway* runway )

a year or two ago now when I first did the ATIS.  I'm not sure what I was
doing at the time (copied most of it out of fg_init.cxx) but I don't think
it's ever worked, so here's a brutal modification that does!
2003-03-05 18:02:24 +00:00
david
71f08e795d Patches from Erik Hofman for SGI compatibility:
Some more cmall changes to the SimGear header files and removed the
SG_HAVE_NATIVE_SGI_COMPILERS dependancies from FlightGear.

I've added a seperate JSBSim patch for the JSBSim source tree.
2002-12-31 18:26:02 +00:00
david
56473dc28d Mac OS X fixes and MSVC warning fixes from Jonathan Polley. 2002-05-10 23:35:06 +00:00
curt
6a399b24a3 Re-arranged include files to reduce external dependencies for a slight
improvement in compilation speed.
2002-04-04 06:05:51 +00:00
david
b3d5d24d81 Patch from Melchior Franz:
It seems that the airport database was changed some day and the End?Flags
changed from floats to strings. The database definition, though, was not
adapted and still created number entries. Reading out these flags led to
access to memory, that was never initialized. While it didn't cause crashes
during normal use, it actually caused one when I ran fgfs in ddd. Seems,
that the concerned memory region wasn't zeroed out then and hence uncovered
the bug.

Of course, the runways.mk4 database has to be re-created with the new
definitions.
2002-03-25 20:05:34 +00:00
curt
56db201e52 Cleaned up a few stray cout's 2002-02-13 18:17:04 +00:00
curt
8ff6965f98 Add #include <math.h> for fabs() 2001-11-08 16:52:51 +00:00