Skip to content

Commit

Permalink
Merge pull request #37 from ny4i/main
Browse files Browse the repository at this point in the history
A few fixes to the N1MM UDP ContactInfo message
  • Loading branch information
mbridak authored Feb 15, 2024
2 parents 7935d19 + 5b0fef9 commit bf03258
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fdlogger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,7 @@ def poll_radio(self):
else:
logger.info("cat_control %s", self.cat_control)
self.radio_icon.setPixmap(QtGui.QPixmap(self.radio_grey))
self.oldmode = self.mode # Set so the UDP packet sends mode when no radio connected - NY4I

def flash(self):
"""Flash the screen"""
Expand Down Expand Up @@ -1659,14 +1660,19 @@ def log_contact(self):
logger.warning("%s", err)

if self.preference.get("send_n1mm_packets"):
self.n1mm.contact_info["rxfreq"] = str(self.oldfreq)[:-1]
self.n1mm.contact_info["txfreq"] = str(self.oldfreq)[:-1]
if self.oldfreq == 0:
self.n1mm.contact_info["rxfreq"] = str(self.fakefreq(self.band, self.mode))
self.n1mm.contact_info["txfreq"] = str(self.fakefreq(self.band, self.mode))
else:
self.n1mm.contact_info["rxfreq"] = str(self.oldfreq)[:-1]
self.n1mm.contact_info["txfreq"] = str(self.oldfreq)[:-1]

self.n1mm.contact_info["mode"] = self.oldmode
if self.oldmode in ("CW", "DG"):
self.n1mm.contact_info["points"] = "2"
else:
self.n1mm.contact_info["points"] = "1"
self.n1mm.contact_info["band"] = self.band
self.n1mm.contact_info["band"] = self.n1mm.bandToUDPBand[self.band]
self.n1mm.contact_info["mycall"] = self.preference.get("mycall")
self.n1mm.contact_info["IsRunQSO"] = str(self.run_state)
self.n1mm.contact_info["timestamp"] = datetime.now(dt.UTC).strftime(
Expand Down
14 changes: 14 additions & 0 deletions fdlogger/lib/n1mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,20 @@ class N1MM:
"StationName": "",
"ID": "",
}

bandToUDPBand = {
"160" : "1.8",
"80" : "3.5",
"40" : "7",
"20" : "14",
"15" : "21",
"10" : "28",
"6" : "50",
"2" : "144",
"222" : "222",
"432" : "420",
"SAT" : "144", # The fakefreqs are 2m so I picked 2m for SAT - NY4I
}

def __init__(
self,
Expand Down

0 comments on commit bf03258

Please sign in to comment.