diff --git a/src/Main/fg_io.cxx b/src/Main/fg_io.cxx index b3304d651..f57dac486 100644 --- a/src/Main/fg_io.cxx +++ b/src/Main/fg_io.cxx @@ -210,7 +210,8 @@ void fgIOInit() { 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." ); @@ -253,3 +254,20 @@ void fgIOProcess() { } } } + + +// 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(); + } + } +} diff --git a/src/Main/fg_io.hxx b/src/Main/fg_io.hxx index 6f7f55cb1..0550fdb02 100644 --- a/src/Main/fg_io.hxx +++ b/src/Main/fg_io.hxx @@ -36,4 +36,8 @@ void fgIOInit(); void fgIOProcess(); +// shutdown all I/O connections +void fgIOShutdownAll(); + + #endif // _FG_IO_HXX diff --git a/src/Main/keyboard.cxx b/src/Main/keyboard.cxx index 69d940a1a..ba6e96092 100644 --- a/src/Main/keyboard.cxx +++ b/src/Main/keyboard.cxx @@ -399,7 +399,7 @@ void GLUTkey(unsigned char k, int x, int y) { // fclose( fg_DebugOutput ); // } FG_LOG( FG_INPUT, FG_ALERT, - "Program exiting normally at user request." ); + "Program exit requested." ); ConfirmExitDialog(); return; } diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 803462fd7..c0d33fe4e 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -962,7 +962,8 @@ static void fgMainLoop( void ) { 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; @@ -970,19 +971,19 @@ static void fgMainLoop( void ) { // 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 );