summaryrefslogtreecommitdiff
path: root/Radio.cpp
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2020-11-16 21:55:31 +0100
committerChristoph Berg <myon@debian.org>2020-11-16 21:55:31 +0100
commit62b7139bfe06fb6555de9a62ee3e62ccfd6e6cf1 (patch)
tree3d9e4579a69060d2767ec2e9153b0ec60f78cb54 /Radio.cpp
parent8bf7a33f24073bbed51789cb9aaf36ef9126e543 (diff)
parent77922fa33547ce24535f2e514c9a112dcb496f18 (diff)
Update upstream source from tag 'upstream/2.3.0_rc2+repack'
Update to upstream version '2.3.0~rc2+repack' with Debian dir c40ed5d87e465612e7c15c7b67791946a5dcf64c
Diffstat (limited to 'Radio.cpp')
-rw-r--r--Radio.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/Radio.cpp b/Radio.cpp
index e5b34c35..56b94373 100644
--- a/Radio.cpp
+++ b/Radio.cpp
@@ -14,10 +14,16 @@ namespace Radio
double constexpr MHz_factor {1.e6};
int constexpr frequency_precsion {6};
+ // valid callsign alphabet
+ QRegularExpression callsign_alphabet_re {R"(^[A-Z0-9/]{3,11}$)"};
+
// very loose validation - callsign must contain a letter next to
// a number
QRegularExpression valid_callsign_regexp {R"(\d[[:alpha:]]|[[:alpha:]]\d)"};
+ // standard callsign
+ QRegularExpression strict_standard_callsign_re {R"(^([A-Z][0-9]?|[0-9][A-Z])[0-9][A-Z]{0,3}$)"};
+
// suffixes that are often used and should not be interpreted as a
// DXCC Entity prefix used as a suffix
QRegularExpression non_prefix_suffix {R"(\A([0-9AMPQR]|QRP|F[DF]|[AM]M|L[HT]|LGT)\z)"};
@@ -112,6 +118,12 @@ namespace Radio
return callsign.contains ('/');
}
+ bool is_77bit_nonstandard_callsign (QString const& callsign)
+ {
+ return callsign.contains (callsign_alphabet_re)
+ && !callsign.contains (strict_standard_callsign_re);
+ }
+
// split on first '/' and return the larger portion or the whole if
// there is no '/'
QString base_callsign (QString callsign)