1 #include <simgear/misc/sg_path.hxx>
6 #include "mkrbeacons.hxx"
9 const string FG_DATA_DIR("/usr/local/lib/FlightGear");
14 current_navlist = new FGNavList;
15 SGPath p_nav( FG_DATA_DIR + "/Navaids/default.nav" );
17 current_navlist->init( p_nav );
20 if ( current_navlist->query( -93.2 * SG_DEGREES_TO_RADIANS,
21 45.14 * SG_DEGREES_TO_RADIANS,
24 cout << "Found a vor station in range" << endl;
25 cout << " id = " << n.get_ident() << endl;
27 cout << "not picking up vor. :-(" << endl;
31 if (current_navlist->findByIdent("DCS", -3.3 * SG_DEGREES_TO_RADIANS,
32 55.9 * SG_DEGREES_TO_RADIANS, &dcs)) {
34 cout << "Found DCS by ident" << endl;
35 if (dcs.get_freq() != 11520)
36 cout << "Frequency for DCS VOR is wrong (should be 115.20), it's "
37 << dcs.get_freq() << endl;
39 cout << "couldn't locate DCS (Dean-Cross) VOR" << endl;
42 // we have to init the marker beacon storage before we parse the ILS file
43 current_beacons = new FGMarkerBeacons;
44 current_beacons->init();
46 current_ilslist = new FGILSList;
47 SGPath p_ils( FG_DATA_DIR + "/Navaids/default.ils" );
48 current_ilslist->init( p_ils );
50 if ( current_ilslist->query( -93.1 * SG_DEGREES_TO_RADIANS,
51 45.24 * SG_DEGREES_TO_RADIANS,
54 cout << "Found an ils station in range" << endl;
55 cout << " apt = " << i.get_aptcode() << endl;
56 cout << " rwy = " << i.get_rwyno() << endl;
58 cout << "not picking up ils. :-(" << endl;
61 current_fixlist = new FGFixList;
62 SGPath p_fix( FG_DATA_DIR + "/Navaids/default.fix" );
63 current_fixlist->init( p_fix );
66 // attempting to get the position relative to the OTR VOR; heading
67 // should be 108 degrees, distance 74nm (according to my SimCharts
69 if ( current_fixlist->query_and_offset( "DOGGA",
70 -0.103 * SG_DEGREES_TO_RADIANS,
71 53.698 * SG_DEGREES_TO_RADIANS,
72 3000, &fix, &heading, &dist) )
74 cout << "Found a matching fix" << endl;
75 cout << " id = " << fix.get_ident() << endl;
76 cout << " heading = " << heading << " dist = " << dist * SG_METER_TO_NM
79 cout << "did not find fix. :-(" << endl;