]> git.mxchange.org Git - flightgear.git/blob - src/Navaids/testnavs.cxx
1a2e3dcfd808cb24092c13187f4e35755056fe11
[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     FGNavList navs;
11     FGPath p_nav( "/home/curt/FlightGear/Navaids/default.nav" );
12     navs.init( p_nav );
13     FGNav n;
14     if ( navs.query( -93.2, 45.14, 3000, 117.30,
15                      &n, &heading, &dist) ) {
16         cout << "Found a vor station in range" << endl;
17         cout << " id = " << n.get_ident() << endl;
18         cout << " heading = " << heading << " dist = " << dist << endl;
19     } else {
20         cout << "not picking up vor. :-(" << endl;
21     }
22
23     FGILSList ilslist;
24     FGPath p_ils( "/home/curt/FlightGear/Navaids/default.ils" );
25     ilslist.init( p_ils );
26     FGILS i;
27     if ( ilslist.query( -93.1, 45.24, 3000, 110.30,
28                         &i, &heading, &dist) ) {
29         cout << "Found an ils station in range" << endl;
30         cout << " apt = " << i.get_aptcode() << endl;
31         cout << " rwy = " << i.get_rwyno() << endl;
32         cout << " heading = " << heading << " dist = " << dist << endl;
33     } else {
34         cout << "not picking up ils. :-(" << endl;
35     }
36
37     FGFixList fixlist;
38     FGPath p_fix( "/home/curt/FlightGear/Navaids/default.fix" );
39     fixlist.init( p_fix );
40     FGFix fix;
41     if ( fixlist.query( "GONER", -82, 41, 3000,
42                         &fix, &heading, &dist) ) {
43         cout << "Found a matching fix" << endl;
44         cout << " id = " << fix.get_ident() << endl;
45         cout << " heading = " << heading << " dist = " << dist << endl;
46     } else {
47         cout << "did not find fix. :-(" << endl;
48     }
49 }