p->open();
global_io_list.push_back( p );
if ( !p->is_enabled() ) {
- FG_LOG( FG_IO, FG_INFO, "I/O Channel config failed." );
+ FG_LOG( FG_IO, FG_ALERT, "I/O Channel config failed." );
+ exit(-1);
}
} else {
FG_LOG( FG_IO, FG_INFO, "I/O Channel parse failed." );
}
}
}
+
+
+// shutdown all I/O connections
+void fgIOShutdownAll() {
+ FGProtocol *p;
+
+ // cout << "processing I/O channels" << endl;
+
+ for ( int i = 0; i < (int)global_io_list.size(); ++i ) {
+ // cout << " channel = " << i << endl;
+ p = global_io_list[i];
+
+ if ( p->is_enabled() ) {
+ p->close();
+ }
+ }
+}
// fclose( fg_DebugOutput );
// }
FG_LOG( FG_INPUT, FG_ALERT,
- "Program exiting normally at user request." );
+ "Program exit requested." );
ConfirmExitDialog();
return;
}
double rpm_factor = cur_fdm_state->get_engine(0)->get_RPM() /
2500.0;
- cout << "rpm = " << cur_fdm_state->get_engine(0)->get_RPM() << endl;
+ // cout << "rpm = " << cur_fdm_state->get_engine(0)->get_RPM()
+ // << endl;
double pitch = 0.3 + rpm_factor * 3.0;
// and sounds bad to boot. :-)
if (pitch < 0.7) { pitch = 0.7; }
if (pitch > 5.0) { pitch = 5.0; }
- cout << "pitch = " << pitch << endl;
+ // cout << "pitch = " << pitch << endl;
double mp_factor =
cur_fdm_state->get_engine(0)->get_Manifold_Pressure() / 28;
- cout << "mp = "
- << cur_fdm_state->get_engine(0)->get_Manifold_Pressure()
- << endl;
+ // cout << "mp = "
+ // << cur_fdm_state->get_engine(0)->get_Manifold_Pressure()
+ // << endl;
double volume = mp_factor;
if ( volume < 0.3 ) { volume = 0.3; }
if ( volume > 2.0 ) { volume = 2.0; }
- cout << "volume = " << volume << endl;
+ // cout << "volume = " << volume << endl;
pitch_envelope.setStep ( 0, 0.01, pitch );
volume_envelope.setStep ( 0, 0.01, volume );