make the frontend resume when an sdr device becomes present

This commit is contained in:
Jakob Ketterl
2021-03-21 00:14:18 +01:00
parent 8fa1796037
commit acee318dae
4 changed files with 25 additions and 0 deletions

View File

@ -325,6 +325,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
self.sdr.addSpectrumClient(self)
def handleNoSdrsAvailable(self):
self.stack.removeLayerByPriority(0)
self.write_sdr_error("No SDR Devices available")
def startDsp(self):

View File

@ -294,6 +294,11 @@ class PropertyStack(PropertyManager):
return changes
def removeLayerByPriority(self, priority):
for layer in self.layers:
if layer["priority"] == priority:
self.removeLayer(layer["props"])
def removeLayer(self, pm: PropertyManager):
for layer in self.layers:
if layer["props"] == pm: