]> git.mxchange.org Git - flightgear.git/blob - src/Navaids/testnavs.cxx
af502376c0976a3f97895ed061458bcef9d61e68
[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,
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     current_ilslist = new FGILSList;
24     FGPath p_ils( "/home/curt/FlightGear/Navaids/default.ils" );
25     current_ilslist->init( p_ils );
26     FGILS i;
27     if ( current_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     current_fixlist = new FGFixList;
38     FGPath p_fix( "/home/curt/FlightGear/Navaids/default.fix" );
39     current_fixlist->init( p_fix );
40     FGFix fix;
41     if ( current_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 }