kc3pib / wsjtxutils.searchlight Goto Github PK
View Code? Open in Web Editor NEWA .NET 6 console application that highlights callsigns within WSJT-X based on reception reports from PSK Reporter.
License: MIT License
A .NET 6 console application that highlights callsigns within WSJT-X based on reception reports from PSK Reporter.
License: MIT License
WsjtxQsoParser is a useful class that should probably be included in the WsjtxUtils library. However, it fails to parse some Special Operating Activity (such as ARRL Field Day) messages, e.g. VE3NEA VE3RYI R 1D GTA
. My current work around is to just look for anything that is a valid callsign or grid square:
var wsjtxQso = WsjtxQsoParser.ParseDecode(message);
if (string.IsNullOrEmpty(wsjtxQso.DECallsign)) ParseSpecialMessage(wsjtxQso);
where
private void ParseSpecialMessage(WsjtxQso wsjtxQso)
{
var parts = wsjtxQso.RawMessage
.Replace("<", "")
.Replace(">", "")
.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
.Where(part => part != "?")
.ToArray();
if (parts.Any() && parts[0] == MyCall)
wsjtxQso.DXCallsign = parts[0];
int idx = FindSenderCallsign(parts);
if (idx == -1) return;
wsjtxQso.DECallsign = parts[idx];
if (++idx < parts.Length && parts[idx] == "R") idx++;
if (idx < parts.Length && Utils.GridSquareRegex.IsMatch(parts[idx]))
wsjtxQso.GridSquare = parts[idx];
}
private int FindSenderCallsign(string[] parts)
{
for (int i = parts.Length - 1; i > 0; i--)
if (Utils.CallsignRegex.IsMatch(parts[i]))
return i;
return -1;
}
The regular expressions to match the callsign and grid square are as follows:
internal static class Utils
{
public static Regex CallsignRegex = new Regex(
// portable prefix
@"^((?:(?:[A-NPR-Z](?:(?:[A-Z](?:\d[A-Z]?)?)|(?:\d[\dA-Z]?))?)|(?:[2-9][A-Z]{1,2}\d?))\/)?" +
// prefix
@"((?:(?:[A-NPR-Z][A-Z]?)|(?:[2-9][A-Z]{1,2}))\d)" +
// suffix
@"(\d{0,3}[A-Z]{1,6})" +
// modifier
@"(\/[\dA-Z]{1,4})?$",
RegexOptions.Compiled
);
public static Regex GridSquareRegex = new Regex(@"^(?!RR73)[A-R]{2}\d{2}$", RegexOptions.Compiled);
}
It would be nice to add support of Special Activities message formats, and perhaps optionally validate the grid square and callsigns.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.