Skip to content

Commit fa59e55

Browse files
committed
Enhance Winter Field Day plugin: update mode handling and add FT8 packet processing
1 parent b35a793 commit fa59e55

File tree

2 files changed

+82
-3
lines changed

2 files changed

+82
-3
lines changed

not1mm/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,6 +1121,7 @@ def fldigi_on_udp_socket_ready_read(self) -> None:
11211121
datagram, sender_host, sender_port_number = self.udp_socket.readDatagram(
11221122
self.udp_socket.pendingDatagramSize()
11231123
)
1124+
print(f"{datagram=}")
11241125
self.fldigi_qso(datagram.decode())
11251126

11261127
def is_it_dark(self) -> bool:

not1mm/plugins/winter_field_day.py

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121

2222
from pathlib import Path
2323
from PyQt6 import QtWidgets
24+
from not1mm.lib.ham_utility import get_logged_band
2425
from not1mm.lib.plugin_common import gen_adif, imp_adif, get_points, online_score_xml
2526
from not1mm.lib.version import __version__
2627

2728
logger = logging.getLogger(__name__)
28-
29+
ALTEREGO = None
2930
EXCHANGE_HINT = "1O ORG"
3031

3132
cabrillo_name = "WFDA-CONTEST"
@@ -334,9 +335,9 @@ def cabrillo(self, file_encoding):
334335
for contact in log:
335336
the_date_and_time = contact.get("TS", "")
336337
themode = contact.get("Mode", "")
337-
if themode == "LSB" or themode == "USB":
338+
if themode in ("LSB", "USB", "FM", "AM"):
338339
themode = "PH"
339-
if themode == "RTTY":
340+
if themode.upper() in ("RTTY", "BPSK31", "OLIVIA", "JS8"):
340341
themode = "DG"
341342
frequency = str(round(contact.get("Freq", "0"))).rjust(5)
342343

@@ -365,6 +366,83 @@ def recalculate_mults(self):
365366
"""Recalculates multipliers after change in logged qso."""
366367

367368

369+
def set_self(the_outie):
370+
"""..."""
371+
globals()["ALTEREGO"] = the_outie
372+
373+
374+
def ft8_handler(the_packet: dict):
375+
"""Process FT8 QSO packets
376+
FT8
377+
{
378+
'CALL': 'KE0OG',
379+
'GRIDSQUARE': 'DM10AT',
380+
'MODE': 'FT8',
381+
'RST_SENT': '',
382+
'RST_RCVD': '',
383+
'QSO_DATE': '20210329',
384+
'TIME_ON': '183213',
385+
'QSO_DATE_OFF': '20210329',
386+
'TIME_OFF': '183213',
387+
'BAND': '20M',
388+
'FREQ': '14.074754',
389+
'STATION_CALLSIGN': 'K6GTE',
390+
'MY_GRIDSQUARE': 'DM13AT',
391+
'CONTEST_ID': 'ARRL-FIELD-DAY',
392+
'SRX_STRING': '1D UT',
393+
'CLASS': '1D',
394+
'ARRL_SECT': 'UT'
395+
}
396+
FlDigi
397+
{
398+
'FREQ': '7.029500',
399+
'CALL': 'DL2DSL',
400+
'MODE': 'RTTY',
401+
'NAME': 'BOB',
402+
'QSO_DATE': '20240904',
403+
'QSO_DATE_OFF': '20240904',
404+
'TIME_OFF': '212825',
405+
'TIME_ON': '212800',
406+
'RST_RCVD': '599',
407+
'RST_SENT': '599',
408+
'BAND': '40M',
409+
'COUNTRY': 'FED. REP. OF GERMANY',
410+
'CQZ': '14',
411+
'STX': '000',
412+
'STX_STRING': '1D ORG',
413+
'CLASS': '1D',
414+
'ARRL_SECT': 'DX',
415+
'TX_PWR': '0',
416+
'OPERATOR': 'K6GTE',
417+
'STATION_CALLSIGN': 'K6GTE',
418+
'MY_GRIDSQUARE': 'DM13AT',
419+
'MY_CITY': 'ANAHEIM, CA',
420+
'MY_STATE': 'CA'
421+
}
422+
423+
"""
424+
logger.debug(f"{the_packet=}")
425+
if ALTEREGO is not None:
426+
ALTEREGO.callsign.setText(the_packet.get("CALL"))
427+
ALTEREGO.contact["Call"] = the_packet.get("CALL", "")
428+
ALTEREGO.contact["SNT"] = ALTEREGO.sent.text()
429+
ALTEREGO.contact["RCV"] = ALTEREGO.receive.text()
430+
ALTEREGO.contact["Exchange1"] = the_packet.get("CLASS", "ERR")
431+
ALTEREGO.contact["Sect"] = the_packet.get("ARRL_SECT", "ERR")
432+
ALTEREGO.contact["Mode"] = the_packet.get("MODE", "ERR")
433+
ALTEREGO.contact["Freq"] = round(float(the_packet.get("FREQ", "0.0")) * 1000, 2)
434+
ALTEREGO.contact["QSXFreq"] = round(
435+
float(the_packet.get("FREQ", "0.0")) * 1000, 2
436+
)
437+
ALTEREGO.contact["Band"] = get_logged_band(
438+
str(int(float(the_packet.get("FREQ", "0.0")) * 1000000))
439+
)
440+
logger.debug(f"{ALTEREGO.contact=}")
441+
ALTEREGO.other_1.setText(the_packet.get("CLASS", "ERR"))
442+
ALTEREGO.other_2.setText(the_packet.get("ARRL_SECT", "ERR"))
443+
ALTEREGO.save_contact()
444+
445+
368446
def process_esm(self, new_focused_widget=None, with_enter=False):
369447
"""ESM State Machine"""
370448

0 commit comments

Comments
 (0)