From: Bertrand <bco...@us...> - 2017-02-25 15:45:27
|
Update of /cvsroot/jsbsim/JSBSim/examples In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31066/examples Modified Files: FlightGear.cxx Log Message: Backport from FlightGear Index: FlightGear.cxx =================================================================== RCS file: /cvsroot/jsbsim/JSBSim/examples/FlightGear.cxx,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** FlightGear.cxx 18 May 2016 13:26:59 -0000 1.24 --- FlightGear.cxx 25 Feb 2017 15:45:23 -0000 1.25 *************** *** 186,189 **** --- 186,190 ---- case SG_WARN: case SG_ALERT: + case SG_POPUP: FGJSBBase::debug_lvl = 0x00; break; *************** *** 234,240 **** fdmex->Setdt( dt ); ! result = fdmex->LoadModel( aircraft_path.str(), ! engine_path.str(), ! systems_path.str(), fgGetString("/sim/aero"), false ); --- 235,239 ---- fdmex->Setdt( dt ); ! result = fdmex->LoadModel( aircraft_path, engine_path, systems_path, fgGetString("/sim/aero"), false ); *************** *** 503,507 **** // Run an iteration of the EOM (equations of motion) - void FGJSBsim::update( double dt ) { --- 502,505 ---- *************** *** 655,659 **** eng->SetReverse( globals->get_controls()->get_reverser(i) ); eng->SetCutoff( globals->get_controls()->get_cutoff(i) ); ! eng->SetIgnition( globals->get_controls()->get_ignition(i) ); eng->SetGeneratorPower( globals->get_controls()->get_generator_breaker(i) ); --- 653,657 ---- eng->SetReverse( globals->get_controls()->get_reverser(i) ); eng->SetCutoff( globals->get_controls()->get_cutoff(i) ); ! // eng->SetIgnition( globals->get_controls()->get_ignition(i) ); eng->SetGeneratorPower( globals->get_controls()->get_generator_breaker(i) ); *************** *** 883,889 **** //node->setDoubleValue("n2", eng->GetN2()); node->setDoubleValue("itt_degf", 32 + eng->GetITT()*9/5); ! node->setBoolValue("ignition", eng->GetIgnition() != 0); ! node->setDoubleValue("nozzle-pos-norm", eng->GetNozzle()); ! node->setDoubleValue("inlet-pos-norm", eng->GetInlet()); node->setDoubleValue("oil-pressure-psi", eng->getOilPressure_psi()); node->setBoolValue("reversed", eng->GetReversed()); --- 881,887 ---- //node->setDoubleValue("n2", eng->GetN2()); node->setDoubleValue("itt_degf", 32 + eng->GetITT()*9/5); ! // node->setBoolValue("ignition", eng->GetIgnition() != 0); ! // node->setDoubleValue("nozzle-pos-norm", eng->GetNozzle()); ! // node->setDoubleValue("inlet-pos-norm", eng->GetInlet()); node->setDoubleValue("oil-pressure-psi", eng->getOilPressure_psi()); node->setBoolValue("reversed", eng->GetReversed()); *************** *** 1024,1037 **** SG_LOG(SG_FLIGHT,SG_INFO," cur alt (ft) = " << alt ); ! sgGeodToGeoc( lat, alt * SG_FEET_TO_METER, ! &sea_level_radius_meters, &lat_geoc ); ! double sea_level_radius_ft = sea_level_radius_meters * SG_METER_TO_FEET; ! _set_Sea_level_radius( sea_level_radius_ft ); - if (needTrim) - fgic->SetLatitudeRadIC( lat_geoc ); - else Propagate->SetLatitude(lat_geoc); FGInterface::set_Latitude(lat); --- 1022,1036 ---- SG_LOG(SG_FLIGHT,SG_INFO," cur alt (ft) = " << alt ); ! if (needTrim) ! fgic->SetGeodLatitudeRadIC( lat ); ! else { ! sgGeodToGeoc( lat, alt * SG_FEET_TO_METER, ! &sea_level_radius_meters, &lat_geoc ); ! double sea_level_radius_ft = sea_level_radius_meters * SG_METER_TO_FEET; ! _set_Sea_level_radius( sea_level_radius_ft ); Propagate->SetLatitude(lat_geoc); + } FGInterface::set_Latitude(lat); *************** *** 1056,1066 **** SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Altitude: " << alt ); ! if (needTrim) { ! FGLocation position = fgic->GetPosition(); ! ! position.SetPositionGeodetic(0.0, position.GetGeodLatitudeRad(), alt); ! fgic->SetAltitudeASLFtIC(position.GetAltitudeASL()); ! fgic->SetLatitudeRadIC(position.GetLatitude()); ! } else Propagate->SetAltitudeASL(alt); --- 1055,1060 ---- SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Altitude: " << alt ); ! if (needTrim) ! fgic->SetAltitudeASLFtIC(alt); else Propagate->SetAltitudeASL(alt); *************** *** 1312,1315 **** --- 1306,1310 ---- // ground in this area. double groundCacheRadius = acrad + 2*dt*Propagate->GetUVW().Magnitude(); + cart_pos[0] = cart(1); cart_pos[1] = cart(2); |