rework the way soapy settings are built
This commit is contained in:
parent
02c631e6e7
commit
6bb26de98f
|
|
@ -74,13 +74,20 @@ class SoapyConnectorSource(ConnectorSource, metaclass=ABCMeta):
|
||||||
|
|
||||||
def onPropertyChange(self, changes):
|
def onPropertyChange(self, changes):
|
||||||
mappings = self.getSoapySettingsMappings()
|
mappings = self.getSoapySettingsMappings()
|
||||||
settings = {}
|
affectsSettings = False
|
||||||
|
forward = {}
|
||||||
for prop, value in changes.items():
|
for prop, value in changes.items():
|
||||||
if prop in mappings.keys():
|
if prop in mappings.keys():
|
||||||
settings[mappings[prop]] = self.convertSoapySettingsValue(value)
|
affectsSettings = True
|
||||||
if settings:
|
else:
|
||||||
changes["settings"] = ",".join("{0}={1}".format(k, v) for k, v in settings.items())
|
forward[prop] = value
|
||||||
super().onPropertyChange(changes)
|
if affectsSettings:
|
||||||
|
settings = {}
|
||||||
|
for owrx_key, soapy_key in mappings.items():
|
||||||
|
if owrx_key in self.props:
|
||||||
|
settings[soapy_key] = self.convertSoapySettingsValue(self.props[owrx_key])
|
||||||
|
forward["settings"] = ",".join("{0}={1}".format(k, v) for k, v in settings.items())
|
||||||
|
super().onPropertyChange(forward)
|
||||||
|
|
||||||
|
|
||||||
class SoapyConnectorDeviceDescription(ConnectorDeviceDescription):
|
class SoapyConnectorDeviceDescription(ConnectorDeviceDescription):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue