+ if ( !strcmp(aero->getStringValue(), "basic") ) {
+ // set control inputs
+ // cout << "V_calibrated_kts = " << V_calibrated_kts << '\n';
+ eng.set_IAS( V_calibrated_kts );
+ eng.set_Throttle_Lever_Pos( globals->get_controls()->get_throttle( 0 )
+ * 100.0 );
+ eng.set_Propeller_Lever_Pos( 100 );
+ eng.set_Mixture_Lever_Pos( globals->get_controls()->get_mixture( 0 )
+ * 100.0 );
+ eng.set_Magneto_Switch_Pos( globals->get_controls()->get_magnetos(0) );
+ eng.setStarterFlag( globals->get_controls()->get_starter(0) );
+ eng.set_p_amb( Static_pressure );
+ eng.set_T_amb( Static_temperature );
+
+ // update engine model
+ eng.update();
+
+ // Fake control-surface positions
+ fgSetDouble("/surface-positions/flap-pos-norm",
+ fgGetDouble("/controls/flight/flaps"));
+ // FIXME: ignoring trim
+ fgSetDouble("/surface-positions/elevator-pos-norm",
+ fgGetDouble("/controls/flight/elevator"));
+ // FIXME: ignoring trim
+ fgSetDouble("/surface-positions/left-aileron-pos-norm",
+ fgGetDouble("/controls/flight/aileron"));
+ // FIXME: ignoring trim
+ fgSetDouble("/surface-positions/right-aileron-pos-norm",
+ -1 * fgGetDouble("/controls/flight/aileron"));
+ // FIXME: ignoring trim
+ fgSetDouble("/surface-positions/rudder-pos-norm",
+ fgGetDouble("/controls/flight/rudder"));
+
+ // copy engine state values onto "bus"
+ fgSetDouble("/engines/engine/rpm", eng.get_RPM());
+ fgSetDouble("/engines/engine/mp-osi", eng.get_Manifold_Pressure());
+ fgSetDouble("/engines/engine/max-hp", eng.get_MaxHP());
+ fgSetDouble("/engines/engine/power-pct", eng.get_Percentage_Power());
+ fgSetDouble("/engines/engine/egt-degf", eng.get_EGT());
+ fgSetDouble("/engines/engine/cht-degf", eng.get_CHT());
+ fgSetDouble("/engines/engine/prop-thrust", eng.get_prop_thrust_SI());
+ fgSetDouble("/engines/engine/fuel-flow-gph",
+ eng.get_fuel_flow_gals_hr());
+ fgSetDouble("/engines/engine/oil-temperature-degf",
+ eng.get_oil_temp());
+ fgSetDouble("/engines/engine/running", eng.getRunningFlag());
+ fgSetDouble("/engines/engine/cranking", eng.getCrankingFlag());
+
+ static const SGPropertyNode *fuel_freeze
+ = fgGetNode("/sim/freeze/fuel");
+
+ if ( ! fuel_freeze->getBoolValue() ) {
+ //Assume we are using both tanks equally for now
+ fgSetDouble("/consumables/fuel/tank[0]/level-gal_us",
+ fgGetDouble("/consumables/fuel/tank[0]/level-gal_us")
+ - (eng.get_fuel_flow_gals_hr() / (2 * 3600))
+ * dt);
+ fgSetDouble("/consumables/fuel/tank[1]/level-gal_us",
+ fgGetDouble("/consumables/fuel/tank[1]/level-gal_us")
+ - (eng.get_fuel_flow_gals_hr() / (2 * 3600))
+ * dt);
+ }
+
+ // Apparently the IO360 thrust model is not working.
+ // F_X_engine is zero here.
+ F_X_engine = eng.get_prop_thrust_lbs();
+
+ Flap_handle = 30.0 * globals->get_controls()->get_flaps();
+ }
+ // done with basic-larcsim if-block
+