+
+ void parseATISLine(FGCommList *comm_list, const vector<string>& token)
+ {
+ if ( rwy_count <= 0 ) {
+ SG_LOG( SG_GENERAL, SG_ALERT,
+ "No runways; skipping AWOS for " + last_apt_id);
+ }
+
+// This assumes/requires that any code-50 line (ATIS or AWOS)
+ // applies to the preceding code-1 line (airport ID and name)
+ // and that a full set of code-10 lines (runway descriptors)
+ // has come between the code-1 and code-50 lines.
+ // typical code-50 lines:
+ // 50 11770 ATIS
+ // 50 11770 AWOS 3
+ // This code parallels code found in "operator>>" in ATC.hxx;
+ // FIXME: unify the code.
+#if ENABLE_ATCDCL
+ ATCData a;
+ a.geod = SGGeod::fromDegFt(rwy_lon_accum / (double)rwy_count,
+ rwy_lat_accum / (double)rwy_count, last_apt_elev);
+ a.range = 50; // give all ATISs small range
+ a.ident = last_apt_id;
+ a.name = last_apt_name;
+ // short int representing tens of kHz:
+ 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
+ }
+