Fix to keep-source-running feature, provided by Jakob.

This commit is contained in:
Marat Fayzullin 2024-01-29 18:50:34 -05:00
parent 49f24a7598
commit 68bc75b783
1 changed files with 8 additions and 0 deletions

View File

@ -183,6 +183,8 @@ class SdrSource(ABC):
if self.isAlwaysOn() and self.isEnabled():
self.start()
props.filter("always-on").wire(self._handleAlwaysOnChanged)
def isEnabled(self):
return self.enabled
@ -204,6 +206,12 @@ class SdrSource(ABC):
if "center_freq" in changes and changes["center_freq"] is not PropertyDeleted:
self.setCenterFreq(changes["center_freq"])
def _handleAlwaysOnChanged(self, changes):
if self.isAlwaysOn():
self.start()
else:
self.checkStatus()
def isFailed(self):
return self.failed