refactor sources to be more flexible

This commit is contained in:
Jakob Ketterl
2019-12-28 00:26:45 +01:00
parent ca4d9771cc
commit 8371d3b67a
12 changed files with 283 additions and 233 deletions

View File

@ -2,15 +2,6 @@ from .connector import ConnectorSource
class RtlSdrSource(ConnectorSource):
def getCommand(self):
cmd = (
"rtl_connector -p {port} -c {controlPort}".format(port=self.port, controlPort=self.controlPort)
+ " -s {samp_rate} -f {tuner_freq} -g {rf_gain} -P {ppm}"
)
if "device" in self.rtlProps and self.rtlProps["device"] is not None:
cmd += ' -d "{device}"'
if self.rtlProps["iqswap"]:
cmd += " -i"
if self.rtlProps["rtltcp_compat"]:
cmd += " -r"
return cmd
def __init__(self, id, props, port):
super().__init__(id, props, port)
self.getCommandMapper().setBase("rtl_connector")