]> git.mxchange.org Git - flightgear.git/blob - src/Navaids/testnavs.cxx
Overhaul of the navaid system to increase efficiency, reduce redundancy, and
[flightgear.git] / src / Navaids / testnavs.cxx
1 #include <simgear/misc/fgpath.hxx>
2
3 #include "fixlist.hxx"
4 #include "ilslist.hxx"
5 #include "navlist.hxx"
6
7 int main() {
8     double heading, dist;
9
10     current_navlist = new FGNavList;
11     FGPath p_nav( "/home/curt/FlightGear/Navaids/default.nav" );
12     current_navlist->init( p_nav );
13     FGNav n;
14     if ( current_navlist->query( -93.2, 45.14, 3000, 117.30, &n) ) {
15         cout << "Found a vor station in range" << endl;
16         cout << " id = " << n.get_ident() << endl;
17     } else {
18         cout << "not picking up vor. :-(" << endl;
19     }
20
21     current_ilslist = new FGILSList;
22     FGPath p_ils( "/home/curt/FlightGear/Navaids/default.ils" );
23     current_ilslist->init( p_ils );
24     FGILS i;
25     if ( current_ilslist->query( -93.1, 45.24, 3000, 110.30, &i) ) {
26         cout << "Found an ils station in range" << endl;
27         cout << " apt = " << i.get_aptcode() << endl;
28         cout << " rwy = " << i.get_rwyno() << endl;
29     } else {
30         cout << "not picking up ils. :-(" << endl;
31     }
32
33     current_fixlist = new FGFixList;
34     FGPath p_fix( "/home/curt/FlightGear/Navaids/default.fix" );
35     current_fixlist->init( p_fix );
36     FGFix fix;
37     if ( current_fixlist->query( "GONER", -82, 41, 3000,
38                                  &fix, &heading, &dist) ) {
39         cout << "Found a matching fix" << endl;
40         cout << " id = " << fix.get_ident() << endl;
41         cout << " heading = " << heading << " dist = " << dist << endl;
42     } else {
43         cout << "did not find fix. :-(" << endl;
44     }
45 }