[AFV] Disregard 6th digit of VHF alias frequency

This means for example 132.070 is equal to 132.075
This commit is contained in:
Mat Sutcliffe
2021-10-05 17:51:44 +01:00
parent d3a63ad4de
commit fd02656eb2

View File

@@ -1338,6 +1338,11 @@ namespace BlackCore::Afv::Clients
QMutexLocker lock(&m_mutex);
const auto it = std::find_if(m_aliasedStations.constBegin(), m_aliasedStations.constEnd(), [roundedFrequencyHz](const StationDto & d)
{
if (d.frequencyAliasHz > 100000000 && roundedFrequencyHz > 100000000) // both VHF
{
// disregard 6th digit (e.g. 132.070 == 132.075)
return (d.frequencyAliasHz / 10000 * 10000) == (roundedFrequencyHz / 10000 * 10000);
}
return d.frequencyAliasHz == roundedFrequencyHz;
});