- FGEngInterface *e = get_engine( 0 );
- e->set_Throttle( controls.get_throttle( 0 ) * 100.0 );
- e->set_Mixture( 80 );
- e->set_Prop_Advance( 100 );
- e->set_RPM( eng.get_RPM() );
- e->set_Manifold_Pressure( eng.get_Manifold_Pressure() );
- e->set_MaxHP( eng.get_MaxHP() );
- e->set_Percentage_Power( eng.get_Percentage_Power() );
- e->set_EGT( eng.get_EGT() );
- e->set_CHT( eng.get_CHT() );
- e->set_prop_thrust( eng.get_prop_thrust_SI() );
- e->set_Fuel_Flow( eng.get_fuel_flow_gals_hr() );
-
- //Assume we are using both tanks equally for now
- reduce_Tank1Fuel( (eng.get_fuel_flow_gals_hr() / (2 * 3600))
- * get_delta_t() );
- reduce_Tank2Fuel( (eng.get_fuel_flow_gals_hr() / (2 * 3600))
- * get_delta_t() );
-
-#if 0
- SG_LOG( SG_FLIGHT, SG_INFO, "Throttle = "
- << controls.get_throttle( 0 ) * 100.0);
- SG_LOG( SG_FLIGHT, SG_INFO, " Mixture = " << 80);
- SG_LOG( SG_FLIGHT, SG_INFO, " RPM = " << eng.get_RPM());
- SG_LOG( SG_FLIGHT, SG_INFO, " MP = " << eng.get_Manifold_Pressure());
- SG_LOG( SG_FLIGHT, SG_INFO, " HP = "
- << ( eng.get_MaxHP() * eng.get_Percentage_Power()/ 100.0) );
- SG_LOG( SG_FLIGHT, SG_INFO, " EGT = " << eng.get_EGT());
- SG_LOG( SG_FLIGHT, SG_INFO, " Thrust (N) "
- << eng.get_prop_thrust_SI()); // Thrust in Newtons
- SG_LOG( SG_FLIGHT, SG_INFO, '\n');
-#endif
+ 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);
+ }
+