Skip to content

Commit

Permalink
Merge pull request f4exb#1810 from srcejon/fix_1805
Browse files Browse the repository at this point in the history
Distinguish between China and Taiwan aircraft registrations in ADS-B Demod
  • Loading branch information
f4exb authored Sep 6, 2023
2 parents df179dd + abed953 commit 428c4a3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions sdrbase/util/osndb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,20 @@ QString AircraftInformation::getFlag() const
{
// Try letters before '-'
prefix = m_registration.left(idx);
if (m_prefixMap->contains(prefix)) {
flag = m_prefixMap->value(prefix);
// Both China and Taiwan use B prefix. China regs are <= 4 digits, with Taiwan 5
if (prefix == "B")
{
if (m_registration.size() >= 7) {
flag = "taiwan";
} else {
flag = "china";
}
}
else
{
if (m_prefixMap->contains(prefix)) {
flag = m_prefixMap->value(prefix);
}
}
}
}
Expand Down

0 comments on commit 428c4a3

Please sign in to comment.