activate enable / disable cycle
This commit is contained in:
parent
37e7331627
commit
d573561c67
@ -221,13 +221,15 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
||||
self.handleSdrAvailable()
|
||||
|
||||
def onFail(self):
|
||||
self.handleSdrFailed()
|
||||
|
||||
def handleSdrFailed(self):
|
||||
logger.warning('SDR device "%s" has failed, selecting new device', self.sdr.getName())
|
||||
self.write_log_message('SDR device "{0}" has failed, selecting new device'.format(self.sdr.getName()))
|
||||
self.setSdr()
|
||||
|
||||
def onDisable(self):
|
||||
logger.warning('SDR device "%s" was disabled, selecting new device', self.sdr.getName())
|
||||
self.write_log_message('SDR device "{0}" was disabled, selecting new device'.format(self.sdr.getName()))
|
||||
self.setSdr()
|
||||
|
||||
def getClientClass(self) -> SdrClientClass:
|
||||
return SdrClientClass.USER
|
||||
|
||||
|
@ -122,6 +122,9 @@ class ServiceHandler(SdrSourceEventClient):
|
||||
logger.debug("sdr source failed; stopping services.")
|
||||
self.stopServices()
|
||||
|
||||
def onEnable(self):
|
||||
self._scheduleServiceStartup()
|
||||
|
||||
def isSupported(self, mode):
|
||||
configured = Config.get()["services_decoders"]
|
||||
available = [m.modulation for m in Modes.getAvailableServices()]
|
||||
|
@ -258,6 +258,12 @@ class ServiceScheduler(SdrSourceEventClient):
|
||||
def onFail(self):
|
||||
self.shutdown()
|
||||
|
||||
def onDisable(self):
|
||||
self.shutdown()
|
||||
|
||||
def onEnable(self):
|
||||
self.scheduleSelection()
|
||||
|
||||
def onBusyStateChange(self, state: SdrBusyState):
|
||||
if state is SdrBusyState.IDLE:
|
||||
self.scheduleSelection()
|
||||
|
@ -153,6 +153,8 @@ class SdrSource(ABC):
|
||||
self.enabled = changes["enabled"]
|
||||
else:
|
||||
self.enabled = True
|
||||
if not self.enabled:
|
||||
self.stop()
|
||||
for c in self.clients.copy():
|
||||
if self.isEnabled():
|
||||
c.onEnable()
|
||||
|
Loading…
Reference in New Issue
Block a user