1 // radiostack.cxx -- class to manage an instance of the radio stack
3 // Written by Curtis Olson, started April 2000.
5 // Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <Navaids/ilslist.hxx>
25 #include <Navaids/navlist.hxx>
27 #include "radiostack.hxx"
31 FGRadioStack::FGRadioStack() {
37 FGRadioStack::~FGRadioStack() {
41 // Update nav/adf radios based on current postition
42 void FGRadioStack::update( double lon, double lat, double elev ) {
48 if ( current_navlist->query( lon, lat, elev, nav1_freq,
49 &n, &nav1_heading, &nav1_dist) ) {
51 nav1_lon = n.get_lon();
52 nav1_lat = n.get_lat();
53 nav1_elev = n.get_elev();
54 cout << "Found a vor station in range" << endl;
55 cout << " id = " << n.get_ident() << endl;
56 cout << " heading = " << nav1_heading
57 << " dist = " << nav1_dist << endl;
60 cout << "not picking up vor. :-(" << endl;
64 if ( current_navlist->query( lon, lat, elev, nav2_freq,
65 &n, &nav2_heading, &nav2_dist) ) {
67 nav2_lon = n.get_lon();
68 nav2_lat = n.get_lat();
69 nav2_elev = n.get_elev();
70 cout << "Found a vor station in range" << endl;
71 cout << " id = " << n.get_ident() << endl;
72 cout << " heading = " << nav2_heading
73 << " dist = " << nav2_dist << endl;
76 cout << "not picking up vor. :-(" << endl;
81 if ( current_navlist->query( lon, lat, elev, adf_freq,
82 &n, &adf_heading, &junk) ) {
84 adf_lon = n.get_lon();
85 adf_lat = n.get_lat();
86 adf_elev = n.get_elev();
87 cout << "Found an adf station in range" << endl;
88 cout << " id = " << n.get_ident() << endl;
89 cout << " heading = " << adf_heading
90 << " dist = " << junk << endl;
93 cout << "not picking up adf. :-(" << endl;