From abed95335407f1ec9fa75654d2993722393002f6 Mon Sep 17 00:00:00 2001 From: Jon Beniston Date: Tue, 5 Sep 2023 18:34:55 +0100 Subject: [PATCH] Distingush between China and Taiwan --- sdrbase/util/osndb.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sdrbase/util/osndb.cpp b/sdrbase/util/osndb.cpp index e1f03d913..c46757272 100644 --- a/sdrbase/util/osndb.cpp +++ b/sdrbase/util/osndb.cpp @@ -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); + } } } }