refactor sources to be more flexible
This commit is contained in:
@ -1,9 +1,23 @@
|
||||
from . import SdrSource
|
||||
from .direct import DirectSource
|
||||
from owrx.command import Flag, Option
|
||||
|
||||
|
||||
class HackrfSource(SdrSource):
|
||||
def getCommand(self):
|
||||
return "hackrf_transfer -s {samp_rate} -f {tuner_freq} -g {rf_gain} -l{lna_gain} -a{rf_amp} -r-"
|
||||
class HackrfSource(DirectSource):
|
||||
def __init__(self, id, props, port):
|
||||
super().__init__(id, props, port)
|
||||
self.getCommandMapper().setBase("hackrf_transfer").setMappings({
|
||||
"samp_rate": Option("-s"),
|
||||
"tuner_freq": Option("-f"),
|
||||
"rf_gain": Option("-g"),
|
||||
"lna_gain": Option("-l"),
|
||||
"rf_amp": Option("-a")
|
||||
}).setStatic("-r-")
|
||||
|
||||
def getEventNames(self):
|
||||
return super().getEventNames() + [
|
||||
"lna_gain",
|
||||
"rf_amp",
|
||||
]
|
||||
|
||||
def getFormatConversion(self):
|
||||
return "csdr convert_s8_f"
|
||||
|
Reference in New Issue
Block a user