X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAutopilot%2Fxmlauto.cxx;h=6761cddf7d30a88330064d7e088b9447b089a75d;hb=11d15b451347674fba77648700d23c5aaec3c6c2;hp=e971201c4a68b2b5e8ac1759903c2c3e6a119f91;hpb=219be77f1e329b03a7dcf1d697ea2fdbf7f1a81a;p=flightgear.git diff --git a/src/Autopilot/xmlauto.cxx b/src/Autopilot/xmlauto.cxx index e971201c4..6761cddf7 100644 --- a/src/Autopilot/xmlauto.cxx +++ b/src/Autopilot/xmlauto.cxx @@ -152,15 +152,15 @@ double FGXMLAutoInput::get_value() } FGXMLAutoComponent::FGXMLAutoComponent( SGPropertyNode * node ) : - debug(false), - name(""), + _condition( NULL ), enable_prop( NULL ), - passive_mode( fgGetNode("/autopilot/locks/passive-mode", true) ), enable_value( NULL ), + passive_mode( fgGetNode("/autopilot/locks/passive-mode", true) ), honor_passive( false ), - enabled( false ), - _condition( NULL ), - feedback_if_disabled( false ) + name(""), + feedback_if_disabled( false ), + debug(false), + enabled( false ) { int i; SGPropertyNode *prop; @@ -573,7 +573,8 @@ void FGPISimpleController::update( double dt ) { FGPredictor::FGPredictor ( SGPropertyNode *node ): - FGXMLAutoComponent( node ) + FGXMLAutoComponent( node ), + average(0.0) { int i; for ( i = 0; i < node->nChildren(); ++i ) { @@ -618,7 +619,7 @@ void FGPredictor::update( double dt ) { if ( dt > 0.0 ) { double current = (ivalue - last_value)/dt; // calculate current error change (per second) - double average = dt < 1.0 ? ((1.0 - dt) * average + current * dt) : current; + average = dt < 1.0 ? ((1.0 - dt) * average + current * dt) : current; // calculate output with filter gain adjustment double output = ivalue +