Skip to content

Commit

Permalink
Merge pull request #35 from wvolz/invalidbandfix
Browse files Browse the repository at this point in the history
Sane values for frequency outside of known bands
  • Loading branch information
mbridak authored Nov 9, 2023
2 parents 9e6612e + 5db82ae commit 27a2a4c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion fdlogger/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,8 @@ def fakefreq(self, band, mode):
"""
logger.info("fakefreq: band:%s mode:%s", band, mode)
modes = {"CW": 0, "DI": 1, "PH": 2, "FT8": 1, "SSB": 2}
if not band:
return 0
freqtoreturn = self.fakefreqs[band][modes[mode]]
logger.info("fakefreq: returning:%s", freqtoreturn)
return freqtoreturn
Expand Down Expand Up @@ -1041,7 +1043,10 @@ def poll_radio(self):
self.oldfreq = newfreq
self.set_fakefreq(int(newfreq))
self.oldmode = newmode
self.setband(str(self.getband(newfreq)))
if self.getband(newfreq) == 0:
self.setband(str(self.getband(oldfreq)))
else:
self.setband(str(self.getband(newfreq)))
self.setmode(str(self.getmode(newmode)))
self.radio_icon.setPixmap(self.radio_green)
if self.preference.get("send_n1mm_packets"):
Expand Down

0 comments on commit 27a2a4c

Please sign in to comment.