mag1 = magnetos;
if ( mag1 == mag2 && mag2 == mag3 ) {
fgSetInt( "/controls/engines/engine[0]/magnetos", magnetos );
+ fgSetInt( "/controls/engines/engine[1]/magnetos", magnetos );
}
static bool start1, start2, start3;
start3 = start2;
start1 = starter;
if ( start1 == start2 && start2 == start3 ) {
fgSetBool( "/controls/engines/engine[0]/starter", starter );
+ fgSetBool( "/controls/engines/engine[1]/starter", starter );
}
}
// other toggle switches
fgSetBool( "/controls/engines/engine[0]/fuel-pump",
switch_matrix[board][0][2] );
+ fgSetBool( "/controls/engines/engine[1]/fuel-pump",
+ switch_matrix[board][0][2] );
fgSetBool( "/controls/switches/flashing-beacon",
switch_matrix[board][1][2] );
fgSetBool( "/controls/switches/landing-light", switch_matrix[board][2][2] );
{
int i;
SGPropertyNode *node;
+ SGPropertyNode *starter;
+ SGPropertyNode *fuelpump;
SGPropertyNode *tempnode;
// fill in values
for ( i = 0; i < FGNetCtrls::FG_MAX_ENGINES; ++i ) {
// Controls
node = fgGetNode("/controls/engines/engine", i );
- net->throttle[i] = node->getDoubleValue( "throttle", 0.0 );
+ starter = fgGetNode("/systems/electrical/outputs/starter", i );
+ fuelpump = fgGetNode("/systems/electrical/outputs/fuel-pump", i );
+ net->throttle[i] = node->getDoubleValue( "throttle", 0.0 );
net->mixture[i] = node->getDoubleValue( "mixture", 0.0 );
net->prop_advance[i] = node->getDoubleValue( "propeller-pitch", 0.0 );
net->magnetos[i] = node->getIntValue( "magnetos", 0 );
// cout << "Starter -> " << node->getIntValue( "starter", false )
// << endl;
}
- 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 );
for ( i = 0; i < net->num_engines; ++i ) {
SGPropertyNode *node = fgGetNode("engines/engine", i, true);
if ( node->getBoolValue( "running" ) ) {
- net->eng_state[0] = 2;
+ net->eng_state[i] = 2;
} else if ( node->getBoolValue( "cranking" ) ) {
- net->eng_state[0] = 1;
+ net->eng_state[i] = 1;
} else {
- net->eng_state[0] = 0;
+ net->eng_state[i] = 0;
}
net->rpm[i] = node->getDoubleValue( "rpm" );
net->fuel_flow[i] = node->getDoubleValue( "fuel-flow-gph" );