Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions not1mm/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -1430,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)
Expand Down Expand Up @@ -3075,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
Expand Down
108 changes: 105 additions & 3 deletions not1mm/plugins/winter_field_day.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -334,9 +335,33 @@ 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 (
"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)

Expand Down Expand Up @@ -365,6 +390,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"""

Expand Down