show more information on the sdr settings page

This commit is contained in:
Jakob Ketterl
2021-03-18 21:53:59 +01:00
parent 9dcf342b13
commit 364c7eb505
6 changed files with 26 additions and 12 deletions

View File

@@ -91,7 +91,7 @@ class SdrService(object):
@staticmethod
def getFirstSource():
sources = SdrService.getSources()
sources = SdrService.getActiveSources()
if not sources:
return None
# TODO: configure default sdr in config? right now it will pick the first one off the list.
@@ -99,7 +99,7 @@ class SdrService(object):
@staticmethod
def getSource(id):
sources = SdrService.getSources()
sources = SdrService.getActiveSources()
if not sources:
return None
if id not in sources:
@@ -107,11 +107,15 @@ class SdrService(object):
return sources[id]
@staticmethod
def getSources():
def getAllSources():
if SdrService.sources is None:
SdrService.sources = MappedSdrSources(Config.get()["sdrs"])
return SdrService.sources
@staticmethod
def getActiveSources():
return {
key: s
for key, s in SdrService.sources.items()
for key, s in SdrService.getAllSources().items()
if not s.isFailed() and s.isEnabled()
}