Fixing problem when profile center_freq changes would not propagate up.

This commit is contained in:
Marat Fayzullin 2023-06-21 23:17:34 -04:00
parent f3f06b040d
commit 54661ebde3
1 changed files with 10 additions and 0 deletions

View File

@ -147,6 +147,10 @@ class SdrSource(ABC):
# finally, accept global config properties from the top-level config # finally, accept global config properties from the top-level config
self.props.addLayer(4, Config.get()) self.props.addLayer(4, Config.get())
# make sure that when center_freq is changed in the profile,
# that change gets propagated to the top layer
self.profileCarousel.filter("center_freq").wire(self._handleCenterFreqChanged)
self.sdrProps = self.props.filter(*self.getEventNames()) self.sdrProps = self.props.filter(*self.getEventNames())
self.wireEvents() self.wireEvents()
@ -186,6 +190,12 @@ class SdrSource(ABC):
else: else:
c.onDisable() c.onDisable()
def _handleCenterFreqChanged(self, changes):
# make sure profile center_freq changes are propagated
# to the top layer
if "center_freq" in changes and changes["center_freq"] is not PropertyDeleted:
self.setCenterFreq(changes["center_freq"])
def isFailed(self): def isFailed(self):
return self.failed return self.failed