+
+std::istream& operator >> ( std::istream& fin, ATCData& a )
+{
+ double f;
+ char ch;
+ char tp;
+
+ fin >> tp;
+
+ switch(tp) {
+ case 'I':
+ a.type = ATIS;
+ break;
+ case 'T':
+ a.type = TOWER;
+ break;
+ case 'G':
+ a.type = GROUND;
+ break;
+ case 'A':
+ a.type = APPROACH;
+ break;
+ case '[':
+ a.type = INVALID;
+ return fin >> skipeol;
+ default:
+ SG_LOG(SG_GENERAL, SG_ALERT, "Warning - unknown type \'" << tp << "\' found whilst reading ATC frequency data!\n");
+ a.type = INVALID;
+ return fin >> skipeol;
+ }
+
+ double lat, lon, elev;
+
+ fin >> lat >> lon >> elev >> f >> a.range >> a.ident;
+ a.geod = SGGeod::fromDegM(lon, lat, elev);
+ a.name = "";
+ fin >> ch;
+ if(ch != '"') a.name += ch;
+ while(1) {
+ //in >> noskipws
+ fin.unsetf(std::ios::skipws);
+ fin >> ch;
+ if((ch == '"') || (ch == 0x0A)) {
+ break;
+ } // we shouldn't need the 0x0A but it makes a nice safely in case someone leaves off the "
+ a.name += ch;
+ }
+ fin.setf(std::ios::skipws);
+ //cout << "Comm name = " << a.name << '\n';
+
+ a.freq = (int)(f*100.0 + 0.5);
+
+ // cout << a.ident << endl;
+
+ // generate cartesian coordinates
+ a.cart = SGVec3d::fromGeod(a.geod);
+ return fin >> skipeol;
+}
+