Skip to content

Commit

Permalink
repurpose the ft8 qso handler to also handle fldigi.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbridak committed Sep 5, 2024
1 parent 452c78d commit c2957e6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 32 deletions.
32 changes: 4 additions & 28 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __init__(self, *args, **kwargs):
self.rightdot.hide()
self.n1mm = N1MM()
self.ft8 = FT8Watcher()
self.ft8.set_callback(self.ft8_result)
self.ft8.set_callback(None)
self.mscp = SCP(fsutils.APP_DATA_PATH)
self.next_field = self.other_2
self.dupe_indicator.hide()
Expand Down Expand Up @@ -617,33 +617,9 @@ def fldigi_qso(self, result: str):
break
datadict[tag[0]] = tag[1].split(">")[1].strip()
logger.debug(f"{datadict=}")

def ft8_result(self, result: dict):
"""
Callback for ft8 watcher
{
'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'
}
"""
print(f"{result=}")
if hasattr(self.contest, "ft8_handler"):
self.contest.set_self(self)
self.contest.ft8_handler(datadict)

def setDarkMode(self, setdarkmode=False) -> None:
"""Forces a darkmode palette."""
Expand Down
31 changes: 27 additions & 4 deletions not1mm/plugins/arrl_field_day.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def set_self(the_outie):

def ft8_handler(the_packet: dict):
"""Process FT8 QSO packets
FT8
{
'CALL': 'KE0OG',
'GRIDSQUARE': 'DM10AT',
Expand All @@ -353,12 +353,36 @@ def ft8_handler(the_packet: dict):
'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'
}
"""
print(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()
Expand All @@ -375,5 +399,4 @@ def ft8_handler(the_packet: dict):
)
ALTEREGO.other_1.setText(the_packet.get("CLASS", "ERR"))
ALTEREGO.other_2.setText(the_packet.get("ARRL_SECT", "ERR"))
print(f"\n{ALTEREGO.contact=}\n")
ALTEREGO.save_contact()

0 comments on commit c2957e6

Please sign in to comment.