use the command mapper to generate event keys

This commit is contained in:
Jakob Ketterl 2020-04-02 00:10:28 +02:00
parent d9e15357f3
commit 112eda2021
6 changed files with 4 additions and 29 deletions

View File

@ -34,6 +34,8 @@ class SdrSource(ABC):
def __init__(self, id, props):
self.id = id
self.commandMapper = None
self.props = PropertyStack()
# layer 0 reserved for profile properties
self.props.addLayer(1, props)
@ -43,7 +45,6 @@ class SdrSource(ABC):
self.profile_id = None
self.activateProfile()
self.wireEvents()
self.commandMapper = None
if "port" in props and props["port"] is not None:
self.port = props["port"]
@ -72,7 +73,7 @@ class SdrSource(ABC):
"ppm",
"rf_gain",
"lfo_offset",
]
] + list(self.getCommandMapper().keys())
def getCommandMapper(self):
if self.commandMapper is None:

View File

@ -29,13 +29,6 @@ class ConnectorSource(SdrSource):
}
)
def getEventNames(self):
return super().getEventNames() + [
"device",
"iqswap",
"rtltcp_compat",
]
def sendControlMessage(self, prop, value):
logger.debug("sending property change over control socket: {0} changed to {1}".format(prop, value))
self.controlSocket.sendall("{prop}:{value}\n".format(prop=prop, value=value).encode())

View File

@ -14,11 +14,5 @@ class HackrfSource(DirectSource):
}
).setStatic("-r-")
def getEventNames(self):
return super().getEventNames() + [
"lna_gain",
"rf_amp",
]
def getFormatConversion(self):
return ["csdr convert_s8_f"]

View File

@ -29,11 +29,3 @@ class PerseussdrSource(DirectSource):
"wideband": Option("-w"),
}
)
def getEventNames(self):
return super().getEventNames() + [
"attenuator",
"adc_preamp",
"adc_dither",
"wideband",
]

View File

@ -10,6 +10,3 @@ class RtlSdrSource(ConnectorSource):
.setBase("rtl_connector")
.setMappings({"bias_tee": Flag("-b"), "direct_sampling": Option("-e")})
)
def getEventNames(self):
return super().getEventNames() + ["bias_tee", "direct_sampling"]

View File

@ -22,9 +22,7 @@ class SoapyConnectorSource(ConnectorSource, metaclass=ABCMeta):
pass
def getEventNames(self):
return super().getEventNames() + [
"antenna",
] + list(self.getSoapySettingsMappings().keys())
return super().getEventNames() + list(self.getSoapySettingsMappings().keys())
def parseDeviceString(self, dstr):
def decodeComponent(c):