public:
- inline FGILS(void) {}
+ inline FGILS(void);
inline ~FGILS(void) {}
inline char get_ilstype() const { return ilstype; }
};
+inline
+FGILS::FGILS(void)
+ : ilstype(0),
+ locfreq(0),
+ locheading(0.0),
+ loclat(0.0),
+ loclon(0.0),
+ x(0.0), y(0.0), z(0.0),
+ has_gs(false),
+ gselev(0.0),
+ gsangle(0.0),
+ gslat(0.0),
+ gslon(0.0),
+ gs_x(0.0), gs_y(0.0), gs_z(0.0),
+ has_dme(false),
+ dmelat(0.0),
+ dmelon(0.0),
+ dme_x(0.0), dme_y(0.0), dme_z(0.0),
+ omlat(0.0),
+ omlon(0.0),
+ mmlat(0.0),
+ mmlon(0.0),
+ imlat(0.0),
+ imlon(0.0),
+ trans_ident(""),
+ loc_failed(false),
+ gs_failed(false),
+ dme_failed(false)
+{
+ ilstypename[0] = '\0';
+ aptcode[0] = '\0';
+ rwyno[0] = '\0';
+ locident[0] = '\0';
+}
+
+
inline istream&
operator >> ( istream& in, FGILS& i )
{
// load the navaids and build the map
bool FGILSList::init( SGPath path ) {
- FGILS ils;
ilslist.erase( ilslist.begin(), ilslist.end() );
in >> skipeol;
in >> skipcomment;
-#ifdef __MWERKS__
+ // double min = 1000000.0;
+ // double max = 0.0;
+#ifdef __MWERKS__
char c = 0;
- while ( in.get(c) && c != '\0' && ils.get_ilstype() != '[' ) {
+ while ( in.get(c) && c != '\0' ) {
in.putback(c);
- in >> ils;
- if ( ils.get_ilstype() != '[' ) {
- ilslist[ils.get_locfreq()].push_back(ils);
- }
- in >> skipcomment;
- }
-
#else
-
- double min = 1000000.0;
- double max = 0.0;
-
while ( ! in.eof() ) {
- in >> ils;
+#endif
+ FGILS ils;
+ in >> ils;
if ( ils.get_ilstype() == '[' ) {
break;
}
- /* cout << "id = " << n.get_ident() << endl;
- cout << " type = " << n.get_type() << endl;
- cout << " lon = " << n.get_lon() << endl;
- cout << " lat = " << n.get_lat() << endl;
- cout << " elev = " << n.get_elev() << endl;
- cout << " freq = " << n.get_freq() << endl;
- cout << " range = " << n.get_range() << endl; */
+ /* cout << "typename = " << ils.get_ilstypename() << endl;
+ cout << " aptcode = " << ils.get_aptcode() << endl;
+ cout << " twyno = " << ils.get_rwyno() << endl;
+ cout << " locfreq = " << ils.get_locfreq() << endl;
+ cout << " locident = " << ils.get_locident() << endl << endl; */
ilslist[ils.get_locfreq()].push_back(ils);
in >> skipcomment;
- if ( ils.get_locfreq() < min ) {
+ /* if ( ils.get_locfreq() < min ) {
min = ils.get_locfreq();
}
if ( ils.get_locfreq() > max ) {
max = ils.get_locfreq();
- }
+ } */
// update the marker beacon list
if ( fabs(ils.get_omlon()) > SG_EPSILON ||
// cout << "min freq = " << min << endl;
// cout << "max freq = " << max << endl;
-#endif
-
return true;
}
public:
- inline FGNav(void) {}
+ inline FGNav(void);
inline ~FGNav(void) {}
inline char get_type() const { return type; }
};
+inline
+FGNav::FGNav(void) :
+ type(0),
+ lon(0.0), lat(0.0),
+ elev(0.0),
+ x(0.0), y(0.0), z(0.0),
+ freq(0),
+ range(0),
+ has_dme(false),
+ ident(""),
+ magvar(0.0),
+ trans_ident(""),
+ nav_failed(false),
+ dme_failed(false)
+{
+}
+
+
inline istream&
operator >> ( istream& in, FGNav& n )
{
// load the navaids and build the map
bool FGNavList::init( SGPath path ) {
- FGNav n;
navaids.erase( navaids.begin(), navaids.end() );
in >> skipeol;
in >> skipcomment;
-#ifdef __MWERKS__
+ // double min = 100000;
+ // double max = 0;
+#ifdef __MWERKS__
char c = 0;
- while ( in.get(c) && c != '\0' && n.get_type() != '[' ) {
+ while ( in.get(c) && c != '\0' ) {
in.putback(c);
- in >> n;
- if ( n.get_type() != '[' ) {
- navaids[n.get_freq()].push_back(n);
- }
- in >> skipcomment;
- }
-
#else
-
- double min = 100000;
- double max = 0;
-
while ( ! in.eof() ) {
- in >> n;
+#endif
+ FGNav n;
+ in >> n;
if ( n.get_type() == '[' ) {
break;
}
cout << " lat = " << n.get_lat() << endl;
cout << " elev = " << n.get_elev() << endl;
cout << " freq = " << n.get_freq() << endl;
- cout << " range = " << n.get_range() << endl; */
+ cout << " range = " << n.get_range() << endl << endl; */
navaids[n.get_freq()].push_back(n);
in >> skipcomment;
- if ( n.get_type() != 'N' ) {
+ /* if ( n.get_type() != 'N' ) {
if ( n.get_freq() < min ) {
min = n.get_freq();
}
if ( n.get_freq() > max ) {
max = n.get_freq();
}
- }
+ } */
}
// cout << "min freq = " << min << endl;
// cout << "max freq = " << max << endl;
-#endif
-
return true;
}