result = globals->get_airports()->search( id );
- if ( result._id.empty() ) {
+ if ( result.getId().empty() ) {
SG_LOG( SG_GENERAL, SG_ALERT,
"Failed to find " << id << " in basic.dat.gz" );
return false;
SG_LOG( SG_GENERAL, SG_INFO,
"Position for " << id << " is ("
- << a->_longitude << ", "
- << a->_latitude << ")" );
+ << a->getLongitude() << ", "
+ << a->getLatitude() << ")" );
return true;
}
"Finding elevation for airport: " << id );
if ( fgFindAirportID( id, &a ) ) {
- return a._elevation;
+ return a.getElevation();
} else {
return -9999.0;
}
float fudge_lat = .003f - fudge_lon;
if ( fgFindAirportID( id, &a ) ) {
- fgSetDouble("/sim/tower/longitude-deg", a._longitude + fudge_lon);
- fgSetDouble("/sim/tower/latitude-deg", a._latitude + fudge_lat);
- fgSetDouble("/sim/tower/altitude-ft", a._elevation + towerheight);
+ fgSetDouble("/sim/tower/longitude-deg", a.getLongitude() + fudge_lon);
+ fgSetDouble("/sim/tower/latitude-deg", a.getLatitude() + fudge_lat);
+ fgSetDouble("/sim/tower/altitude-ft", a.getElevation() + towerheight);
return true;
} else {
return false;
}
cur_fdm_state = new FGExternalNet( dt, host, port1, port2, port3 );
} else if ( model.find("pipe") == 0 ) {
- string pipe_path = model.substr(5);
- cur_fdm_state = new FGExternalPipe( dt, pipe_path );
+ // /* old */ string pipe_path = model.substr(5);
+ // /* old */ cur_fdm_state = new FGExternalPipe( dt, pipe_path );
+ string pipe_path = "";
+ string pipe_protocol = "";
+ string pipe_options = model.substr(5);
+ string::size_type begin, end;
+ begin = 0;
+ // pipe file path
+ end = pipe_options.find( ",", begin );
+ if ( end != string::npos ) {
+ pipe_path = pipe_options.substr(begin, end - begin);
+ begin = end + 1;
+ }
+ // protocol (last option)
+ pipe_protocol = pipe_options.substr(begin);
+ cur_fdm_state = new FGExternalPipe( dt, pipe_path, pipe_protocol );
} else if ( model == "null" ) {
cur_fdm_state = new FGNullFDM( dt );
} else if ( model == "yasim" ) {
// update the current timezone each 30 minutes
globals->get_event_mgr()->addTask( "fgUpdateLocalTime()",
&fgUpdateLocalTime, 30*60 );
+ fgInitTimeOffset(); // the environment subsystem needs this
////////////////////////////////////////////////////////////////////
globals->add_subsystem("Traffic Manager", new FGTrafficManager);
FGTrafficManager *dispatcher =
(FGTrafficManager*) globals->get_subsystem("Traffic Manager");
- SGPath path =globals->get_fg_root();
- path.append("Traffic/fgtraffic.xml");
+ SGPath path = globals->get_fg_root();
+ path.append("/Traffic/fgtraffic.xml");
readXML(path.str(),
- *dispatcher);
- globals->get_subsystem("Traffic Manager")->init();
+ *dispatcher);
+ //globals->get_subsystem("Traffic Manager")->init();
globals->add_subsystem("instrumentation", new FGInstrumentMgr);
globals->add_subsystem("systems", new FGSystemMgr);