Navradio: fix regression and optimize older code
- Fix a little regression introduced in commit d2f4807fa2
: changing
the standby frequency disabled the low-pass filter for the next call
to updateReceiver(); this must happen when the selected frequency is
changed but not when the standby frequency is changed. This is covered
by the recently-added unit test NavRadioTests::testVORSignalQuality.
- Optimization of the older code: no need to perform a navaid search()
when only the standby frequency is changed.
This commit is contained in:
parent
8290d94ada
commit
876330772b
1 changed files with 4 additions and 2 deletions
|
@ -698,10 +698,12 @@ void FGNavRadio::valueChanged (SGPropertyNode* prop)
|
||||||
_navaid = NULL;
|
_navaid = NULL;
|
||||||
_apply_lowpass_filter = false;
|
_apply_lowpass_filter = false;
|
||||||
_time_before_search_sec = 0;
|
_time_before_search_sec = 0;
|
||||||
} else if ((prop == freq_node) || (prop == alt_freq_node)) {
|
} else if (prop == alt_freq_node) {
|
||||||
|
updateFormattedFrequencies();
|
||||||
|
} else if (prop == freq_node) {
|
||||||
updateFormattedFrequencies();
|
updateFormattedFrequencies();
|
||||||
_apply_lowpass_filter = false; // signal quality allowed to vary quickly
|
_apply_lowpass_filter = false; // signal quality allowed to vary quickly
|
||||||
_time_before_search_sec = 0.0; // force a frequency update
|
_time_before_search_sec = 0.0; // trigger a new search() ASAP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue