- a.freq = atoi(token[1].c_str());
- if (token[2] == "ATIS") a.type = ATIS;
- else a.type = AWOS; // ASOS same as AWOS
-
- // generate cartesian coordinates
- a.cart = SGVec3d::fromGeod(a.geod);
- comm_list->commlist_freq[a.freq].push_back(a);
-
- SGBucket bucket(a.geod);
- int bucknum = bucket.gen_index();
- comm_list->commlist_bck[bucknum].push_back(a);
-#else
-#endif
-#if 0
- SG_LOG( SG_GENERAL, SG_ALERT,
- "Loaded ATIS/AWOS for airport: " << a.ident
- << " lat: " << a.geod.getLatitudeDeg()
- << " lon: " << a.geod.getLongitudeDeg()
- << " freq: " << a.freq
- << " type: " << a.type );
-#endif
+ int freqKhz = atoi(token[1].c_str());
+ int rangeNm = 50;
+ FGPositioned::Type ty;
+ switch (lineId) {
+ case 50:
+ ty = FGPositioned::FREQ_AWOS;
+ if (token[2] == "ATIS") {
+ ty = FGPositioned::FREQ_ATIS;
+ }
+ break;
+
+ case 51: ty = FGPositioned::FREQ_UNICOM; break;
+ case 52: ty = FGPositioned::FREQ_CLEARANCE; break;
+ case 53: ty = FGPositioned::FREQ_GROUND; break;
+ case 54: ty = FGPositioned::FREQ_TOWER; break;
+ case 55:
+ case 56: ty = FGPositioned::FREQ_APP_DEP; break;
+ default:
+ throw sg_range_exception("unupported apt.dat comm station type");
+ }
+
+ commStations.push_back(new flightgear::CommStation(token[2], ty, pos, rangeNm, freqKhz));