str += " ";
}
}
-
return(str);
}
+
+// Convert an integer to spoken digits
+string ConvertNumToSpokenDigits(int n) {
+ char buf[12]; // should be big enough!!
+ sprintf(buf, "%i", n);
+ string tempstr1 = buf;
+ return(ConvertNumToSpokenDigits(tempstr1));
+}
+
+
// Convert a 2 digit rwy number to a spoken-style string
string ConvertRwyNumToSpokenString(int n) {
string nums[10] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"};
// in fg_init.cxx, and are just here temporarily until some rationalisation occurs.
// find basic airport location info from airport database
bool dclFindAirportID( const string& id, FGAirport *a ) {
- if ( id.length() ) {
- SGPath path( globals->get_fg_root() );
- path.append( "Airports" );
- path.append( "simple.mk4" );
- FGAirports airports( path.c_str() );
+ FGAirport result;
+ if ( id.length() ) {
SG_LOG( SG_GENERAL, SG_INFO, "Searching for airport code = " << id );
- if ( ! airports.search( id, a ) ) {
+ result = globals->get_airports()->search( id );
+ if ( result.id.empty() ) {
SG_LOG( SG_GENERAL, SG_ALERT,
- "Failed to find " << id << " in " << path.str() );
+ "Failed to find " << id << " in basic.dat.gz" );
return false;
}
} else {
return false;
}
+ *a = result;
+
SG_LOG( SG_GENERAL, SG_INFO,
"Position for " << id << " is ("
<< a->longitude << ", "