mirror of
https://github.com/jketterl/openwebrx.git
synced 2026-04-20 22:05:13 +00:00
collect dial frequencies and send to client
This commit is contained in:
parent
6e08a428d6
commit
abd5cf0795
2 changed files with 18 additions and 1 deletions
|
|
@ -18,7 +18,7 @@ class Band(object):
|
|||
if not self.inBand(f):
|
||||
logger.warning("Frequency for {mode} on {band} is not within band limits: {frequency}".format(mode = mode, frequency = f, band = self.name))
|
||||
else:
|
||||
self.frequencies.append([{"mode": mode, "frequency": f}])
|
||||
self.frequencies.append({"mode": mode, "frequency": f})
|
||||
|
||||
def inBand(self, freq):
|
||||
return self.lower_bound <= freq <= self.upper_bound
|
||||
|
|
@ -26,6 +26,10 @@ class Band(object):
|
|||
def getName(self):
|
||||
return self.name
|
||||
|
||||
def getDialFrequencies(self, range):
|
||||
(low, hi) = range
|
||||
return [e for e in self.frequencies if low <= e["frequency"] <= hi]
|
||||
|
||||
|
||||
class Bandplan(object):
|
||||
sharedInstance = None
|
||||
|
|
@ -43,3 +47,6 @@ class Bandplan(object):
|
|||
|
||||
def findBand(self, freq):
|
||||
return next(band for band in self.bands if band.inBand(freq))
|
||||
|
||||
def collectDialFrequencis(self, range):
|
||||
return [e for b in self.bands for e in b.getDialFrequencies(range)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue