allow services to be disabled on individual sdrs

This commit is contained in:
Jakob Ketterl 2019-12-31 18:44:47 +01:00
parent e60c332c24
commit 036442aa69

View File

@ -120,6 +120,8 @@ class ServiceScheduler(object):
self.source.removeClient(self) self.source.removeClient(self)
def scheduleSelection(self, time=None): def scheduleSelection(self, time=None):
if self.source.getState() == SdrSource.STATE_FAILED:
return
seconds = 10 seconds = 10
if time is not None: if time is not None:
delta = time - datetime.utcnow() delta = time - datetime.utcnow()
@ -199,6 +201,8 @@ class ServiceHandler(object):
elif state == SdrSource.STATE_FAILED: elif state == SdrSource.STATE_FAILED:
logger.debug("sdr source failed; stopping services.") logger.debug("sdr source failed; stopping services.")
self.stopServices() self.stopServices()
if self.scheduler:
self.scheduler.shutdown()
def onBusyStateChange(self, state): def onBusyStateChange(self, state):
pass pass
@ -385,7 +389,9 @@ class Services(object):
if not PropertyManager.getSharedInstance()["services_enabled"]: if not PropertyManager.getSharedInstance()["services_enabled"]:
return return
for source in SdrService.getSources().values(): for source in SdrService.getSources().values():
Services.handlers.append(ServiceHandler(source)) props = source.getProps()
if "services" not in props or props["services"] != False:
Services.handlers.append(ServiceHandler(source))
@staticmethod @staticmethod
def stop(): def stop():