From: Torsten Dreyer Date: Fri, 28 Mar 2014 16:48:35 +0000 (+0100) Subject: Autopilot: enable debug output for logic elements X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4be1aba62e59a991dacf44e41bf6175cc591f6db;p=flightgear.git Autopilot: enable debug output for logic elements --- diff --git a/src/Autopilot/logic.cxx b/src/Autopilot/logic.cxx index 6f8a53041..e49627f2a 100644 --- a/src/Autopilot/logic.cxx +++ b/src/Autopilot/logic.cxx @@ -57,6 +57,17 @@ bool Logic::get_output() const void Logic::update( bool firstTime, double dt ) { + if(_debug) { + bool q = get_output(); + bool a = get_input(); + if( a != q ) { + using std::endl; + using std::cout; + cout << "updating logic \"" << get_name() << "\"" << endl; + cout << "prev. Output:" << q << endl; + cout << "new Output:" << a << endl; + } + } set_output( get_input() ); }