double ualtitude = atoi( s ) * FEET_TO_METER;
Point3D p( longitude, latitude, altitude+EQUATORIAL_RADIUS_M );
m_locationPolar = p;
- m_locationCart = fgPolarToCart3d( p );
+ m_locationCart = sgPolarToCart3d( p );
Point3D up( ulongitude, ulatitude, ualtitude+EQUATORIAL_RADIUS_M );
m_upperLocationPolar = up;
- m_upperLocationCart = fgPolarToCart3d( up );
+ m_upperLocationCart = sgPolarToCart3d( up );
s = t;
m_pFlag = s[0];
}
int CMetarStation::initialize()
{
- // Read the list of metar stations, decoding and adding to global list.
+ // Read the list of metar stations, decoding and adding to global list.
- CMetarStation *m;
- char buf[256];
+ CMetarStation *m;
+ char buf[256];
- // Goto the Flight Gear installation directory
+ // Goto the Flight Gear installation directory
#ifdef TESTPROG
- FGPath weatherPath( "/mkv/Build/FlightGear" );
+ //FGPath weatherPath( "/mkv/Build/FlightGear" );
+ FGPath weatherPath( ":Data" );
#else
FGPath weatherPath( current_options.get_fg_root() );
#endif
- weatherPath.append( "Weather/MetarStations" );
- // Open the metar station list
- FILE *f = fopen( weatherPath.c_str(), "r" );
+ weatherPath.append( "Weather" );
+ weatherPath.append( "MetarStations" );
+ // Open the metar station list
+ FILE *f = fopen( weatherPath.c_str(), "r" );
- if ( f != NULL )
- {
- // Read each line, create an instance of a station, and add it to the vector
- while ( fgets( buf, 256, f) != NULL && feof( f ) == 0 )
- {
- //std::cout << buf << std::endl;
- m = new CMetarStation( buf );
- //m->dump();
- METAR_Stations.push_back( m );
- }
-
- // Close the list
- fclose( f );
- std::cout << METAR_Stations.size() << " Metar stations" << std::endl;
- return 1;
- }
- else
- {
- std::cout << "Could not open MetarStations file " << std::endl;
- return 0;
+ if ( f != NULL ) {
+ // Read each line, create an instance of a station, and add it to the vector
+ while ( fgets( buf, 256, f) != NULL && feof( f ) == 0 ) {
+ //std::cout << buf << std::endl;
+ m = new CMetarStation( buf );
+ //m->dump();
+ METAR_Stations.push_back( m );
}
+
+ // Close the list
+ fclose( f );
+ // std::cout << METAR_Stations.size() << " Metar stations" << std::endl;
+ return 1;
+ } else {
+ // std::cout << "Could not open MetarStations file " << std::endl;
+ return 0;
+ }
}