#include "inputvalue.hxx"
#include <Main/fg_props.hxx>
-using namespace FGXMLAutopilot;
+namespace FGXMLAutopilot {
/**
* @brief Flip flop implementation for a RS flip flop with dominant RESET
virtual bool getState( double dt, DigitalComponent::InputMap input, bool & q );
};
+} // namespace
+
+using namespace FGXMLAutopilot;
+
bool MonoFlopImplementation::configure( const std::string & nodeName, SGPropertyNode_ptr configNode )
{
if( JKFlipFlopImplementation::configure( nodeName, configNode ) )
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 );
}
q0 = q = get_output();
- if( _implementation->getState( dt, _input, q ) ) {
+ if( _implementation->getState( dt, _input, q ) && q0 != q ) {
set_output( q );
if(_debug) {