vk6flab / contest-logger

Cross platform amateur radio contest logging tool.
https://vk6flab.github.io/contest-logger/
GNU General Public License v3.0
8 stars 1 forks source link

All Text command line like input as an Option #1

Open MewR4D opened 1 year ago

MewR4D commented 1 year ago

Paper logging for me is great because I can write down multiple times the call sing I hear and finally pic the right version. After that usually RST and a Number are exchanged. This Informations are going out and coming in on paper I Tag my Notes with “i /in” and “o/out”. An input could look like this. DO8 DO8A DO8E DO8EW 59i 025i 59o o001 Representing I heard DO8EW recived 59 and Number 025 I reported a 59 with Number 001.

vk6flab commented 1 year ago

Nice to hear from you and thank you for the first issue. I've marked it as a feature request and will use it to track progress towards implementation.

Implementing it isn't likely to be an issue, but functionality is, as in, how would this actually work?

The reason I'm asking is that most of the purpose of a contest logger is to show what the next exchange is for the operator and to validate that a log entry is allowed with the rules for that contest.

Please don't read this as a dismissal of your idea, it's not. I would like to understand how you'd like this to work, how it fits and what the user experience is. Again, writing the code is not the difficult part, it's understanding how it should work.

flwyd commented 1 year ago

Here's how I've imagined something like this would work:

I think that parsing this data would be reasonably straightforward because the fields match different patterns. Split on whitespace, then test each "word" against a set of regex patterns or lookup tables. If it matches \d+.\d+ it's a frequency. If it matches [a-z]+[0-9]+[a-z]+(/\w+)? it's a callsign. (Actual callsign regex is a little more complex, since some countries have numbers in their prefix, etc.) If it matches \d{2,3}/\d{2,3} it's an RST sent/received; if it's \d{2,3}/ it's just RST sent, if it's /\d{2,3} it's just RST received (this allows typing things as they're heard over the air: "Kilo seven station go again" / "This is K7XYZ you're 59 in Oregon" / "K7XYZ thanks for 59 Oregon, you're 55 Colorado" --> K7XYZ /59 OR 55/. If it matches \d{2}:\d{2} it's the time on (useful for entering paper logs). If it matches \w+-{4,5} it's a POTA reference. [a-z]{2}[0-9]{2}([a-z]{2}([0-9]{2})?)? is a Maidenhead grid square. Contest exchange would need a little configuration, but there are a couple common options including standalone integer (serial number or CQWW zone or station power) and a string matching an entry in a list (ARRL section, county abbreviation for a QSO party). Since the full text of the free-form field is stored, if the exchange can't be identified (e.g. someone gives you their country because they don't know their CQWW zone) you can correct the details later.

vk6flab commented 1 year ago

My thinking about this is currently that a "CLI" plug-in would provide the basic functionality that a "POTA" or "SOTA" plug-in could enhance, especially considering Issue #20 where the suggestion is to provide extra "lookup" data.

flwyd commented 1 year ago

I would shy away from using a plugin architecture for parsing this field. There are a lot of variations a person could type in, so robust unit testing to ensure minimal surprises is valuable. It may make sense to let users select and deselect a set of fields the free-form box will look for, but I recommend keeping the set of parsers "in the core code" to make development easier to understand. For what it's worth, IOTA, POTA, SOTA, and WWFF all have different string formats which are easy to distinguish from each other. FISTS, SKCC, and Ten-Ten member numbers are just integers, so if free-form support is desired then a microsyntax like SK#123 and TT#456 might be useful.

I think of things like POTA detail lookup as orthogonal to the free-form parsing. The lookup would be tied to the structured field; once the free-form parser populates the POTA_REF field, a POTA listener could display the park details. I think a plugin architecture for that functionality may be warranted, since the chance for weird interactions between plugins in such a case is reduced.

NoseyNick commented 1 year ago

I do quite like the basic idea here - just type the stuff into a freeform field and have it break out. I'd extend further by saying if I've NOT typed a frequency, take one from hamlib (if available) or from the most recent QSO (if recent enough). Also highlight mandatory fields that haven't yet been typed.

Obvious problem would be if multiple pattern-matches match. Crappy examples:

Here some combination of heuristics (599 looks MOST LIKELY to be an RST but 123 looks more likely to be a serial number)... and "what we have already filled" may help?