From fa59e55d2dcb9d67fffd46e616d7ee59cb33d4cb Mon Sep 17 00:00:00 2001 From: mbridak Date: Wed, 28 Jan 2026 06:14:07 -0800 Subject: [PATCH 1/2] Enhance Winter Field Day plugin: update mode handling and add FT8 packet processing --- not1mm/__main__.py | 1 + not1mm/plugins/winter_field_day.py | 84 ++++++++++++++++++++++++++++-- 2 files changed, 82 insertions(+), 3 deletions(-) diff --git a/not1mm/__main__.py b/not1mm/__main__.py index 1040af16..ffb97667 100644 --- a/not1mm/__main__.py +++ b/not1mm/__main__.py @@ -1121,6 +1121,7 @@ def fldigi_on_udp_socket_ready_read(self) -> None: datagram, sender_host, sender_port_number = self.udp_socket.readDatagram( self.udp_socket.pendingDatagramSize() ) + print(f"{datagram=}") self.fldigi_qso(datagram.decode()) def is_it_dark(self) -> bool: diff --git a/not1mm/plugins/winter_field_day.py b/not1mm/plugins/winter_field_day.py index df5849bd..e7e74ee5 100644 --- a/not1mm/plugins/winter_field_day.py +++ b/not1mm/plugins/winter_field_day.py @@ -21,11 +21,12 @@ from pathlib import Path from PyQt6 import QtWidgets +from not1mm.lib.ham_utility import get_logged_band from not1mm.lib.plugin_common import gen_adif, imp_adif, get_points, online_score_xml from not1mm.lib.version import __version__ logger = logging.getLogger(__name__) - +ALTEREGO = None EXCHANGE_HINT = "1O ORG" cabrillo_name = "WFDA-CONTEST" @@ -334,9 +335,9 @@ def cabrillo(self, file_encoding): for contact in log: the_date_and_time = contact.get("TS", "") themode = contact.get("Mode", "") - if themode == "LSB" or themode == "USB": + if themode in ("LSB", "USB", "FM", "AM"): themode = "PH" - if themode == "RTTY": + if themode.upper() in ("RTTY", "BPSK31", "OLIVIA", "JS8"): themode = "DG" frequency = str(round(contact.get("Freq", "0"))).rjust(5) @@ -365,6 +366,83 @@ def recalculate_mults(self): """Recalculates multipliers after change in logged qso.""" +def set_self(the_outie): + """...""" + globals()["ALTEREGO"] = the_outie + + +def ft8_handler(the_packet: dict): + """Process FT8 QSO packets + FT8 + { + 'CALL': 'KE0OG', + 'GRIDSQUARE': 'DM10AT', + 'MODE': 'FT8', + 'RST_SENT': '', + 'RST_RCVD': '', + 'QSO_DATE': '20210329', + 'TIME_ON': '183213', + 'QSO_DATE_OFF': '20210329', + 'TIME_OFF': '183213', + 'BAND': '20M', + 'FREQ': '14.074754', + 'STATION_CALLSIGN': 'K6GTE', + 'MY_GRIDSQUARE': 'DM13AT', + 'CONTEST_ID': 'ARRL-FIELD-DAY', + 'SRX_STRING': '1D UT', + 'CLASS': '1D', + 'ARRL_SECT': 'UT' + } + FlDigi + { + 'FREQ': '7.029500', + 'CALL': 'DL2DSL', + 'MODE': 'RTTY', + 'NAME': 'BOB', + 'QSO_DATE': '20240904', + 'QSO_DATE_OFF': '20240904', + 'TIME_OFF': '212825', + 'TIME_ON': '212800', + 'RST_RCVD': '599', + 'RST_SENT': '599', + 'BAND': '40M', + 'COUNTRY': 'FED. REP. OF GERMANY', + 'CQZ': '14', + 'STX': '000', + 'STX_STRING': '1D ORG', + 'CLASS': '1D', + 'ARRL_SECT': 'DX', + 'TX_PWR': '0', + 'OPERATOR': 'K6GTE', + 'STATION_CALLSIGN': 'K6GTE', + 'MY_GRIDSQUARE': 'DM13AT', + 'MY_CITY': 'ANAHEIM, CA', + 'MY_STATE': 'CA' + } + + """ + logger.debug(f"{the_packet=}") + if ALTEREGO is not None: + ALTEREGO.callsign.setText(the_packet.get("CALL")) + ALTEREGO.contact["Call"] = the_packet.get("CALL", "") + ALTEREGO.contact["SNT"] = ALTEREGO.sent.text() + ALTEREGO.contact["RCV"] = ALTEREGO.receive.text() + ALTEREGO.contact["Exchange1"] = the_packet.get("CLASS", "ERR") + ALTEREGO.contact["Sect"] = the_packet.get("ARRL_SECT", "ERR") + ALTEREGO.contact["Mode"] = the_packet.get("MODE", "ERR") + ALTEREGO.contact["Freq"] = round(float(the_packet.get("FREQ", "0.0")) * 1000, 2) + ALTEREGO.contact["QSXFreq"] = round( + float(the_packet.get("FREQ", "0.0")) * 1000, 2 + ) + ALTEREGO.contact["Band"] = get_logged_band( + str(int(float(the_packet.get("FREQ", "0.0")) * 1000000)) + ) + logger.debug(f"{ALTEREGO.contact=}") + ALTEREGO.other_1.setText(the_packet.get("CLASS", "ERR")) + ALTEREGO.other_2.setText(the_packet.get("ARRL_SECT", "ERR")) + ALTEREGO.save_contact() + + def process_esm(self, new_focused_widget=None, with_enter=False): """ESM State Machine""" From 9e81c74a0cf0320da5dad453abe5a2d7c793bb57 Mon Sep 17 00:00:00 2001 From: mbridak Date: Wed, 28 Jan 2026 17:16:23 -0800 Subject: [PATCH 2/2] Enhance Cabrillo export mode identifiers for Winter Field Day plugin --- not1mm/__main__.py | 14 ++++++++++++++ not1mm/plugins/winter_field_day.py | 26 +++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/not1mm/__main__.py b/not1mm/__main__.py index ffb97667..039c6c4f 100644 --- a/not1mm/__main__.py +++ b/not1mm/__main__.py @@ -1431,6 +1431,7 @@ def fldigi_qso(self, result: str) -> None: except IndexError: logger.debug(f"Parse error: {result=} {data=} {tag=}") logger.debug(f"{datadict=}") + print(f"{datadict=}") if hasattr(self.contest, "ft8_handler"): self.contest.set_self(self) self.contest.ft8_handler(datadict) @@ -3076,15 +3077,28 @@ def save_contact(self) -> None: )[:19] self.contact["Call"] = self.callsign.text() if self.contact.get("Mode") not in ( + "CONTESTI", + "DOMINO", + "FSQ", "FT8", "FT4", + "HELL", + "IFKP", "RTTY", + "PSK", "PSK31", "FSK441", + "MFSK", "MSK144", + "MT63", + "OLIVIA", + "JS8", "JT65", "JT9", "Q65", + "SCAMP", + "THOR", + "THRB", ): self.contact["Freq"] = round( float(self.radio_state.get("vfoa", 0.0)) / 1000, 2 diff --git a/not1mm/plugins/winter_field_day.py b/not1mm/plugins/winter_field_day.py index e7e74ee5..b71ac86d 100644 --- a/not1mm/plugins/winter_field_day.py +++ b/not1mm/plugins/winter_field_day.py @@ -337,7 +337,31 @@ def cabrillo(self, file_encoding): themode = contact.get("Mode", "") if themode in ("LSB", "USB", "FM", "AM"): themode = "PH" - if themode.upper() in ("RTTY", "BPSK31", "OLIVIA", "JS8"): + if themode.upper() in ( + "BPSK31", + "CONTESTI", + "DOMINO", + "FSQ", + "FT8", + "FT4", + "HELL", + "IFKP", + "RTTY", + "PSK", + "PSK31", + "FSK441", + "MFSK", + "MSK144", + "MT63", + "OLIVIA", + "JS8", + "JT65", + "JT9", + "Q65", + "SCAMP", + "THOR", + "THRB", + ): themode = "DG" frequency = str(round(contact.get("Freq", "0"))).rjust(5)