[fix](trx): ignore FTx farewell pseudo-locators and narrow split slider

This commit is contained in:
2026-03-05 19:24:54 +01:00
parent 05e72e21e8
commit 49f44e84a0
4 changed files with 34 additions and 8 deletions
+7 -1
View File
@@ -219,7 +219,7 @@ fn normalize_token(token: &str) -> String {
fn parse_locator(message: &str) -> Option<String> {
message.split_whitespace().find_map(|raw| {
let t = normalize_token(raw);
if is_locator(&t) {
if !is_ftx_farewell_token(&t) && is_locator(&t) {
Some(t)
} else {
None
@@ -272,6 +272,10 @@ fn is_locator(token: &str) -> bool {
}
}
fn is_ftx_farewell_token(token: &str) -> bool {
matches!(token, "RR73" | "73" | "RR")
}
fn maidenhead_from_lat_lon(lat: f64, lon: f64) -> String {
let lat = lat.clamp(-90.0, 90.0 - f64::EPSILON);
let lon = lon.clamp(-180.0, 180.0 - f64::EPSILON);
@@ -433,6 +437,8 @@ mod tests {
Some("SP2SJG".to_string())
);
assert_eq!(parse_locator("CQ SP2SJG JO93"), Some("JO93".to_string()));
assert_eq!(parse_locator("CQ SP2SJG RR73"), None);
assert_eq!(parse_locator("SP2SJG RR 73"), None);
}
#[test]