]> git.mxchange.org Git - flightgear.git/blobdiff - src/Autopilot/flipflop.cxx
Merge branch 'merge-requests/1555' into next
[flightgear.git] / src / Autopilot / flipflop.cxx
index c829818499585a6d6f4809b335ef01d6326499d8..8046ce5dcd8ddcc761ac44faf9a562bdc4fb4eba 100644 (file)
 #include "inputvalue.hxx"
 #include <Main/fg_props.hxx>
 
+using std::map;
+using std::string;
+using std::endl;
+using std::cout;
+
 namespace FGXMLAutopilot {
 
 /**
@@ -334,14 +339,15 @@ bool RSFlipFlopImplementation::getState( double dt, DigitalComponent::InputMap i
 
 bool ClockedFlipFlopImplementation::getState( double dt, DigitalComponent::InputMap input, bool & q )
 {
-  if( RSFlipFlopImplementation::getState( dt, input, q ) )
-    return true;
-
   bool c = input.get_value("clock");
   bool raisingEdge = c && !_clock;
     
   _clock = c;
 
+  if( RSFlipFlopImplementation::getState( dt, input, q ) )
+    return true;
+
+
   if( !raisingEdge ) return false; //signal no change
   return onRaisingEdge( input, q );
 }
@@ -452,7 +458,7 @@ void FlipFlop::update( bool firstTime, double dt )
 
   q0 = q = get_output();
 
-  if( _implementation->getState( dt, _input, q ) ) {
+  if( _implementation->getState( dt, _input, q ) && q0 != q ) {
     set_output( q );
 
     if(_debug) {