- node = fgGetNode("/controls", true);
- net->fuel_pump_power[i]
- = node->getDoubleValue( "/systems/electrical/outputs/fuel-pump",
- 1.0 ) >= 1.0;
-
- net->starter_power[i]
- = node->getDoubleValue( "/systems/electrical/outputs/starter",
- 1.0 ) >= 1.0;
+
+ if ( fuelpump != NULL ) {
+ net->fuel_pump_power[i] = ( fuelpump->getDoubleValue() >= 1.0 );
+ } else {
+ net->fuel_pump_power[i] = 0.0;
+ }
+
+ if ( starter != NULL ) {
+ net->starter_power[i] = ( starter->getDoubleValue() >= 1.0 );
+ } else {
+ net->starter_power[i] = 0.0;
+ }
+
+ // Faults
+ SGPropertyNode *faults = node->getChild( "faults", 0, true );
+ net->engine_ok[i] = faults->getBoolValue( "serviceable", true );
+ net->mag_left_ok[i]
+ = faults->getBoolValue( "left-magneto-serviceable", true );
+ net->mag_right_ok[i]
+ = faults->getBoolValue( "right-magneto-serviceable", true);
+ net->spark_plugs_ok[i]
+ = faults->getBoolValue( "spark-plugs-serviceable", true );
+ net->oil_press_status[i]
+ = faults->getIntValue( "oil-pressure-status", 0 );
+ net->fuel_pump_ok[i]
+ = faults->getBoolValue( "fuel-pump-serviceable", true );