<abs>true</abs>
for input elements.
If set to true, the input value is filtered thru fabs() function.
Defaults to false if absent, so there is no impact for existing configurations
min = new FGXMLAutoInput( n );
}
+ if( (n = node->getChild( "abs" )) != NULL ) {
+ abs = n->getBoolValue();
+ }
+
SGPropertyNode *valueNode = node->getChild( "value" );
if ( valueNode != NULL ) {
value = valueNode->getDoubleValue();
value = m;
}
- return value;
+ return abs ? fabs(value) : value;
}
FGXMLAutoComponent::FGXMLAutoComponent( SGPropertyNode * node ) :
class FGXMLAutoInput : public SGReferenced {
private:
double value; // The value as a constant or initializer for the property
+ bool abs; // return absolute value
SGPropertyNode_ptr property; // The name of the property containing the value
SGSharedPtr<FGXMLAutoInput> offset; // A fixed offset, defaults to zero
SGSharedPtr<FGXMLAutoInput> scale; // A constant scaling factor defaults to one
FGXMLAutoInput( SGPropertyNode_ptr node = NULL, double value = 0.0, double offset = 0.0, double scale = 1.0 ) :
property(NULL),
value(0.0),
+ abs(false),
offset(NULL),
scale(NULL),
min(NULL),