nav2_radial = 0.0;
nav2_dme_dist = 0.0;
need_update = true;
- longitudeVal = fgGetValue("/position/longitude");
- latitudeVal = fgGetValue("/position/latitude");
- altitudeVal = fgGetValue("/position/altitude");
+ lon_node = fgGetNode("/position/longitude");
+ lat_node = fgGetNode("/position/latitude");
+ alt_node = fgGetNode("/position/altitude");
}
void
FGRadioStack::update()
{
- double lon = longitudeVal->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
- double lat = latitudeVal->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
- double elev = altitudeVal->getDoubleValue() * SG_FEET_TO_METER;
+ double lon = lon_node->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
+ double lat = lat_node->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
+ double elev = alt_node->getDoubleValue() * SG_FEET_TO_METER;
need_update = false;
{
static FGMkrBeacon::fgMkrBeacType last_beacon = FGMkrBeacon::NOBEACON;
- double lon = longitudeVal->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
- double lat = latitudeVal->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
- double elev = altitudeVal->getDoubleValue() * SG_FEET_TO_METER;
+ double lon = lon_node->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
+ double lat = lat_node->getDoubleValue() * SGD_DEGREES_TO_RADIANS;
+ double elev = alt_node->getDoubleValue() * SG_FEET_TO_METER;
// nav1
FGILS ils;
fgSetDouble("/fdm/trim/aileron", FCS->GetDaCmd());
fgSetDouble("/fdm/trim/rudder", FCS->GetDrCmd());
- trimmed = fgGetValue("/fdm/trim/trimmed",true);
+ startup_trim = fgGetNode("/sim/startup/trim", true);
+
+ trimmed = fgGetNode("/fdm/trim/trimmed", true);
trimmed->setBoolValue(false);
+ pitch_trim = fgGetNode("/fdm/trim/pitch-trim", true );
+ throttle_trim = fgGetNode("/fdm/trim/throttle", true );
+ aileron_trim = fgGetNode("/fdm/trim/aileron", true );
+ rudder_trim = fgGetNode("/fdm/trim/rudder", true );
}
/******************************************************************************/
trimmed->setBoolValue(false);
- if (needTrim && fgGetBool("/sim/startup/trim")) {
+ if ( needTrim && startup_trim->getBoolValue() ) {
- //fgic->SetSeaLevelRadiusFtIC( get_Sea_level_radius() );
- //fgic->SetTerrainAltitudeFtIC( scenery.cur_elev * SG_METER_TO_FEET );
+ //fgic->SetSeaLevelRadiusFtIC( get_Sea_level_radius() );
+ //fgic->SetTerrainAltitudeFtIC( scenery.cur_elev * SG_METER_TO_FEET );
- FGTrim *fgtrim;
- if(fgic->GetVcalibratedKtsIC() < 10 ) {
- fgic->SetVcalibratedKtsIC(0.0);
- fgtrim=new FGTrim(fdmex,fgic,tGround);
- } else {
- fgtrim=new FGTrim(fdmex,fgic,tLongitudinal);
- }
- if(!fgtrim->DoTrim()) {
- fgtrim->Report();
- fgtrim->TrimStats();
- } else {
- trimmed->setBoolValue(true);
- }
- fgtrim->ReportState();
- delete fgtrim;
+ FGTrim *fgtrim;
+ if(fgic->GetVcalibratedKtsIC() < 10 ) {
+ fgic->SetVcalibratedKtsIC(0.0);
+ fgtrim=new FGTrim(fdmex,fgic,tGround);
+ } else {
+ fgtrim=new FGTrim(fdmex,fgic,tLongitudinal);
+ }
+ if(!fgtrim->DoTrim()) {
+ fgtrim->Report();
+ fgtrim->TrimStats();
+ } else {
+ trimmed->setBoolValue(true);
+ }
+ fgtrim->ReportState();
+ delete fgtrim;
- needTrim=false;
+ needTrim=false;
- fgSetDouble("/fdm/trim/pitch-trim", FCS->GetPitchTrimCmd());
- fgSetDouble("/fdm/trim/throttle", FCS->GetThrottleCmd(0));
- fgSetDouble("/fdm/trim/aileron", FCS->GetDaCmd());
- fgSetDouble("/fdm/trim/rudder", FCS->GetDrCmd());
+ pitch_trim->setDoubleValue( FCS->GetPitchTrimCmd() );
+ throttle_trim->setDoubleValue( FCS->GetThrottleCmd(0) );
+ aileron_trim->setDoubleValue( FCS->GetDaCmd() );
+ rudder_trim->setDoubleValue( FCS->GetDrCmd() );
- controls.set_elevator_trim(FCS->GetPitchTrimCmd());
- controls.set_elevator(FCS->GetDeCmd());
- controls.set_throttle(FGControls::ALL_ENGINES,
- FCS->GetThrottleCmd(0));
+ controls.set_elevator_trim(FCS->GetPitchTrimCmd());
+ controls.set_elevator(FCS->GetDeCmd());
+ controls.set_throttle(FGControls::ALL_ENGINES,
+ FCS->GetThrottleCmd(0));
- controls.set_aileron(FCS->GetDaCmd());
- controls.set_rudder( FCS->GetDrCmd());
+ controls.set_aileron(FCS->GetDaCmd());
+ controls.set_rudder( FCS->GetDrCmd());
- SG_LOG( SG_FLIGHT, SG_INFO, " Trim complete" );
- }
+ SG_LOG( SG_FLIGHT, SG_INFO, " Trim complete" );
+ }
for( i=0; i<get_num_engines(); i++ ) {
get_engine(i)->set_RPM( Propulsion->GetThruster(i)->GetRPM() );
FGLaRCsim::FGLaRCsim( double dt ) {
set_delta_t( dt );
- ls_toplevel_init( 0.0,
- (char *)fgGetString("/sim/aircraft").c_str() );
+ speed_up = fgGetNode("/sim/speed-up", true);
+ aircraft = fgGetNode("/sim/aircraft", true);
+
+ ls_toplevel_init( 0.0, (char *)(aircraft->getStringValue().c_str()) );
+
lsic=new LaRCsimIC; //this needs to be brought up after LaRCsim is
copy_to_LaRCsim(); // initialize all of LaRCsim's vars
//this should go away someday -- formerly done in fg_init.cxx
// init method first.
FGInterface::init();
- speed_up = fgGetValue("/sim/speed-up", true);
-
ls_set_model_dt( get_delta_t() );
// Initialize our little engine that hopefully might
eng.init( get_delta_t() );
// Run an iteration of the EOM (equations of motion)
bool FGLaRCsim::update( int multiloop ) {
- if ( fgGetString("/sim/aircraft") == "c172" ) {
+ if ( aircraft->getStringValue() == "c172" ) {
// set control inputs
// cout << "V_calibrated_kts = " << V_calibrated_kts << '\n';
eng.set_IAS( V_calibrated_kts );
speed_up->getIntValue();
Flap_handle = 30.0 * controls.get_flaps();
- if ( fgGetString("/sim/aircraft") == "c172" ) {
+ if ( aircraft->getStringValue() == "c172" ) {
Use_External_Engine = 1;
} else {
Use_External_Engine = 0;