Autopilot XML: Improve logging around NaNs
The current NaN message is very noisy, and not very information. Try to improve that, to avoid filling up the logs.
This commit is contained in:
parent
e4c0e71424
commit
397aad1d1d
1 changed files with 13 additions and 2 deletions
|
@ -180,8 +180,20 @@ double InputValue::get_value() const
|
|||
if (_expression) {
|
||||
// compute the expression value
|
||||
value = _expression->getValue(NULL);
|
||||
|
||||
if (SGMiscd::isNaN(value)) {
|
||||
SG_LOG(SG_AUTOPILOT, SG_DEV_ALERT, "AP input: read NaN from expression");
|
||||
}
|
||||
} else if( _property != NULL ) {
|
||||
value = _property->getDoubleValue();
|
||||
|
||||
if (SGMiscd::isNaN(value)) {
|
||||
SG_LOG(SG_AUTOPILOT, SG_DEV_ALERT, "AP input: read NaN from:" << _property->getPath() );
|
||||
}
|
||||
} else {
|
||||
if (SGMiscd::isNaN(value)) {
|
||||
SG_LOG(SG_AUTOPILOT, SG_DEV_ALERT, "AP input is NaN." );
|
||||
}
|
||||
}
|
||||
|
||||
if( _scale )
|
||||
|
@ -205,8 +217,7 @@ double InputValue::get_value() const
|
|||
if( _periodical ) {
|
||||
value = _periodical->normalize( value );
|
||||
}
|
||||
if (SGMiscd::isNaN(value))
|
||||
SG_LOG(SG_AUTOPILOT, SG_ALERT, "input is NaN." );
|
||||
|
||||
return _abs ? fabs(value) : value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue