convert boolean values into something that soapy understands
This commit is contained in:
parent
00a7b7877c
commit
d2ce27eeab
@ -61,9 +61,14 @@ class SoapyConnectorSource(ConnectorSource, metaclass=ABCMeta):
|
|||||||
settings = {}
|
settings = {}
|
||||||
for k, v in self.getSoapySettingsMappings().items():
|
for k, v in self.getSoapySettingsMappings().items():
|
||||||
if k in values and values[k] is not None:
|
if k in values and values[k] is not None:
|
||||||
settings[v] = values[k]
|
settings[v] = self.convertSoapySettingsValue(values[k])
|
||||||
return settings
|
return settings
|
||||||
|
|
||||||
|
def convertSoapySettingsValue(self, value):
|
||||||
|
if isinstance(value, bool):
|
||||||
|
return "true" if value else "false"
|
||||||
|
return value
|
||||||
|
|
||||||
def getCommandValues(self):
|
def getCommandValues(self):
|
||||||
values = super().getCommandValues()
|
values = super().getCommandValues()
|
||||||
if "device" in values and values["device"] is not None:
|
if "device" in values and values["device"] is not None:
|
||||||
@ -80,6 +85,6 @@ class SoapyConnectorSource(ConnectorSource, metaclass=ABCMeta):
|
|||||||
def onPropertyChange(self, prop, value):
|
def onPropertyChange(self, prop, value):
|
||||||
mappings = self.getSoapySettingsMappings()
|
mappings = self.getSoapySettingsMappings()
|
||||||
if prop in mappings.keys():
|
if prop in mappings.keys():
|
||||||
value = "{0}={1}".format(mappings[prop], value)
|
value = "{0}={1}".format(mappings[prop], self.convertSoapySettingsValue(value))
|
||||||
prop = "settings"
|
prop = "settings"
|
||||||
super().onPropertyChange(prop, value)
|
super().onPropertyChange(prop, value)
|
||||||
|
Loading…
Reference in New Issue
Block a user