1
0
Fork 0
Commit graph

170 commits

Author SHA1 Message Date
Tim Moore
13ff5da4be Merge branch 'jmt/reciprocal' 2009-09-23 07:44:02 +02:00
jmt
29f84492a2 Different approach to handling the paired-ILS-on-opposite-runways situation. This uses additional information we now store (in FGRunway) to be more explicit about the behaviour (i.e only look at paired navids), and crucially, does not misbehave near either threshold. Instead it always switches about the runway midpoint (so back-course/missed-approaches are broken as before), leading to stable behaviour when touching down.
I am pretty confident this is (was, from FS2004) also the 'solution' taken by MSFS.
2009-09-17 22:51:44 +02:00
jmt
44bc440d32 Associate non-ILS localisers with their runway. 2009-09-17 22:51:44 +02:00
jmt
971e87bb49 Logging: less verbose about navaids we didn't align. 2009-09-17 22:45:30 +02:00
jmt
80e67b17c2 Set runway elevation to the airport elevation, and don't reset ILS/LOC elevation when aligning with runways. 2009-09-09 08:56:31 +02:00
jmt
25c55f67bf More precise matching of ILS records to navaids. 2009-09-03 00:02:48 +02:00
jmt
294a7b675a Add support for processing the ICAO.ils.xml scenery data into ILS/LOC nav records. 2009-09-03 00:02:48 +02:00
fredb
862f59aded Reserve a special FGPositionned type for pavements 2009-06-15 10:29:45 +02:00
jmt
21a8522160 Whoops, type codes for localizers and ILSs were swapped in the nav.dat reader 2009-06-15 10:29:44 +02:00
jmt
86d1e4ea9d Directly associate runways objects with their ILS navrecord (if one exists) 2009-06-15 10:29:44 +02:00
jmt
83c29b4f43 Fix a bad copy-and-paste bug in namedFindClosest, which broke things in the
multiple-matches case.
2009-06-11 16:05:21 +02:00
jmt
a29e5ce666 Remove some remaining non-route-related uses of SGWayPoint. 2009-06-11 16:05:20 +02:00
jmt
6e42458a55 Convert waypoint::CourseAndDistance users to use SGGeodesy helper functions. 2009-06-11 16:05:20 +02:00
jmt
031f9bb33b Dave Luff's patch to fix findNextWithPartialId 2009-06-11 16:05:19 +02:00
mfranz
b07ad149ae turn a few #include paths from the "foo" form to <foo>
The quotes form is normally only used for headers with path relative
to the including file's path, though the standard doesn't strictly
mandate this. This is consistent with the rest of sg/fg, it makes the
code's intent clearer and helps to find headers. (And it's a few
milliseconds faster, too.)
2009-05-18 12:24:17 +02:00
fredb
1d4aaa2f0d Compile with VS2005 in debug mode 2009-02-22 23:52:17 +01:00
jmt
9e945e3408 Fix Torsten's crash. A completely cross-platform issue, no idea why it didn't show up in local testing. 2009-01-10 00:07:44 +01:00
jmt
c9e8112a81 Add various helper filters, to make use of type-ranges, and reduce the need
to down-cast in filter implementations.
2009-01-10 00:07:01 +01:00
jmt
2d852024c6 Basic infrastructure to expose type ranges from filters, and hence reduce
how many candidates need to be submitted to the pass() hook.
2009-01-10 00:06:47 +01:00
jmt
e171f0ecdb Rename FGMarkerBeacon to FGMarkerBeacon record, to avoid a clash with the
instrument of the same name. In the future I'd prefer to rename the
instrument class instead (FGMarkerBeaconReciever?) but this is the safest
change for now.

Thanks (again) to Yon Uriarte for pointing out the problem (which seems to
affect MSVC more than gcc)
2009-01-07 10:33:02 +01:00
jmt
b0b6a0d998 Fix a bug resulting from my marker-beacon refactoring. Thanks to Yon Uriarte
for spotting the problem.
2009-01-07 10:27:18 +01:00
jmt
d756f913ec Refactor marker-beacons to be distinct from FGNavRecord. This is a big space
saving for beacons, but since they're surprisingly few (in nav.dat), not a
an enormous saving in real terms. The major motivation is that marker beacons
don't behave like other NavRecords for radio interaction - they have no ident,
frequency or range (in the sense that NavRecord means them).
2009-01-07 10:17:35 +01:00
jmt
f1b10eddfa FGAirportList is gone. Everything should work as before, especially the
AirportList dialog. (It would now be possible to trivially implement a
VOR or NDB named search, if anyone wants such a thing).
2008-12-27 13:20:08 +00:00
jmt
b58c8b6f19 Further work (still not enabled) on a fast + correct implementation of the
airportList search function. At least for me (with a mutex-based SGAtomic),
large vectors of referenced-pointers is a Bad Thing - copying on vector
resize is thrashing the locks.
2008-12-27 10:08:12 +00:00
jmt
660d59a098 Another clean-up iteration: FGAirportList::search is gone, replaced by two
static FGAirport helpers. As a result, another global index goes away. Use
the helpers to avoid ugly FGPositioned down-casts in various places.

Also converts the environment/METAR code to deal with FGAirport pointers,
instead of string identifiers, and contains work-in-progress code to implement
the AirportList dialog using FGPositioned. This isn't enabled yet for various
reasons, but is the final piece to allow FGAirportList to be removed.
2008-12-26 15:26:42 +00:00
jmt
988de9dbca Remove all name and spatial queries from FGNavList. All remaining queries are
by frequency (which makes sense), and use the FGPositioned spatial data if
required. As a result, the marker beacon list is gone (since beacons are only
searched spatially). In the process, clean up various minor things - most
notably, all the 'airport-related' navaids (ILS, GS, LOC, and the beacons) now
store a FGRunway* instead of an airport id string. This is more precise, and
saves string allocations.
2008-12-25 23:11:43 +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
jmt
059f2e6a8e Convert the only remaining user of FGFixList to use an FGPositioned query,
and hence remove the query code from fix-list. The only remaining code deals
with parsing fix.dat.
2008-12-23 14:41:58 +00:00
fredb
e2bf85e67e James Turner : this patch
- updates how filtering is done on the various FGPositioned query functions - both spatial and ident-based.
- updates the KLN-89b / DCLGPS code to use FGPositioned for all Navaid/Airport queries.

me:
Add few include directives in globals.cxx to avoid such MSVC warning messages :
deletion of pointer to incomplete type 'FGAirportList'; no destructor called
deletion of pointer to incomplete type 'FGNavList'; no destructor called
deletion of pointer to incomplete type 'FGTACANList'; no destructor called
deletion of pointer to incomplete type 'FGFixList'; no destructor called
2008-12-09 07:58:46 +00:00
fredb
812485d623 James Turner : a trivial patch to remove a now obsolete default ctor from FGPositioned 2008-12-04 08:15:36 +00:00
fredb
f3b110e565 James Turner:
Attached patch updates the route-manager to use FGPositioned to search
for waypoints, instead of a manual airport / fix / navaid search. This
is good because it's now using the 'strictly closest' match, rather
than arbitrarily picking a distant fix over a nearby navaid. In my
case, the TLA VOR is significant to several EGPH procedures, but also
happens to be the ident of a fix a long, long way away.

Also updates the FGPositioned class to stop using Point3D, partly
because it's deprecated and partly because I had misunderstood the
interface and was using it wrong. For now, all FGPositioned distance
checks use SGGeodesy::inverse, which is accurate but inefficient. Once
FGPositioned queries are used for something on a hot path, I'll
probably store the cartesian position as well as the geodetic, to make
these checks fast.
2008-12-03 20:03:46 +00:00
ehofman
6bd7967e36 fix a typo 2008-09-13 09:20:47 +00:00
ehofman
bb2b03c7e3 James Turner:
Convert FGNavRecord to inherit FGPositioned. This is much more self-contained than the FGRunway change, since FGNavRecord already had good encapsulation of its state. However, it's a large diff due to moving around two nasty pieces of code - the 'align navaid with extended runway centerline' logic and the 'penalise transmitters at the opposite runway end' logic.

In general things are more readable because I've replaced the Navaid type enum, and the use of Robin's integer type codes, with   switches on the FGPositioned::Type code - no more trying to recall that '6' is an outer marker in Robin's data. The creation code path is also pushed down from navdb into navrecord itself.
2008-09-12 08:46:15 +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
ehofman
3b486e1aee James Turner:
Here's part 2 - converting FGFix (the simplest one) to be both heap-based and inherit FGPositioned. One minor benefit from this is replacing some dangerous code in FGFixList which used to return the address of an iterator member ('&it->second'). To keep the diff a sensible size, I'm not updating the callers to use the richer FGPositioned types - i.e replacing separate lat/lon handling with SGGeod. I will make those cleanups, but in future patches.
2008-09-10 08:54:49 +00:00
fredb
9751b25216 Add required include for lower_bound 2008-09-08 19:25:45 +00:00
ehofman
a727e69585 James Turner:
Here's the very first FGPositioned patch - adding the files, and building them, but nothing else.
2008-09-08 17:50:06 +00:00
fredb
b53badf201 Stefan C. Müller :
Small patch fixing bugs I've encountered while getting the current CVS to build in MSVC.
* std::lower_bound was used with the key-type of a map, but lower_bound expects the value-type of the collection it works on, with is std::pair. MSVC seems to be more strict about this.
* Added an missing include statement.
* Replaced an rint() call with floor() (MSVC does not offer rint).
2008-08-31 18:32:43 +00:00
ehofman
d8f5529d21 remove redundant semi-colon 2008-08-23 13:09:24 +00:00
ehofman
341216e56a Fix a compile problem for lower_bound() 2008-08-22 19:49:03 +00:00
ehofman
289f2f5f0d James Turner:
This is a little intrusive on the KLN89 code, but avoids the wasteful cloning of the airports, runways and navaids which current happens, and also combines the ugly string ordering code.
2008-08-22 11:22:22 +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
c4a38e10ec James Turner:
Attached patch + new file make FGNavRecord have a .cxx file, and a constructor w
hich allows all the parameters to be supplied. Along the way I also cleaned up t
he navrecord.hxx header, lots more header pollution has been killed.

Some long methods are no longer inline, but were all suspiciously long to meet c
ompiler inlining criteria (I'm not clear if the 'inline' keyword is advisory or
mandatory in this situation) - I don't expect this to affect performance in any
way whatsoever.

The constructor addition is to support some hacking I'm doing improving the star
tup performance of the navDB by lazily loading the data, and caching it in a mor
e efficient format than text. I'm submitting this change (and probably some othe
r small tweaks in the future) since they are worthwhile as cleanups regardless o
f how my current experiments work out.
2008-08-03 14:34:42 +00:00
ehofman
429f2530de James Turner:
* experimental clean-up / reduction on two of the FG headers:
   (I'm going to await feedback on the developers list before doing more of
    these, to avoiding going over files multiple times, but in principle it
    seems pretty straightforward.)

 * final fixes for SG_USING_STD removal
2008-07-29 08:27:48 +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
ehofman
eccddb3dfd Attached patches remove BORLANDC, and hence SG_MATH_EXCEPTION_CLASH and SG_INCOM
PLETE_FUNCTIONAL from SimGear and FlightGear.

As a result, SG_HAVE_STD_INCLUDES is now *always* set, so I will get the boring
fixes for that done, but separately. I'm still auditing the other things in comp
ilers.h - there's a lot that can die now BORLAND is gone.
2008-07-25 10:39:53 +00:00
ehofman
6c4061bdc5 Remove the remaining macintosh (not MacOS-X) and MWERKS workarounds. 2008-07-25 07:29:20 +00:00
timoore
32e9505eed Clean up header file use of iostream and "using" declarations
Replace include <iostream> with istream, ostream and/or iosfwd as
appropriate.

Remove using namespace std and using std::foo from header files.
2008-06-02 21:09:51 +00:00
timoore
a251fd35cb Include <iostream> and using declarations as needed.
SimGear no longer includes iostream and avoids using declarations in
header files, so various fixups are needed.
2008-06-02 21:07:35 +00:00