make both gains available for sdrplay

This commit is contained in:
Jakob Ketterl 2019-05-19 22:10:11 +02:00
parent 92abef7172
commit 8091831b1f
3 changed files with 16 additions and 8 deletions

View File

@ -130,7 +130,8 @@ sdrs = {
"20m": { "20m": {
"name":"20m", "name":"20m",
"center_freq": 14150000, "center_freq": 14150000,
"rf_gain": 40, "rf_gain": 4,
"if_gain": 40,
"samp_rate": 500000, "samp_rate": 500000,
"start_freq": 14070000, "start_freq": 14070000,
"start_mod": "usb", "start_mod": "usb",
@ -139,7 +140,8 @@ sdrs = {
"40m": { "40m": {
"name":"40m", "name":"40m",
"center_freq": 7100000, "center_freq": 7100000,
"rf_gain": 40, "rf_gain": 4,
"if_gain": 40,
"samp_rate": 500000, "samp_rate": 500000,
"start_freq": 7070000, "start_freq": 7070000,
"start_mod": "usb", "start_mod": "usb",
@ -148,7 +150,8 @@ sdrs = {
"80m": { "80m": {
"name":"80m", "name":"80m",
"center_freq": 3650000, "center_freq": 3650000,
"rf_gain": 40, "rf_gain": 4,
"if_gain": 40,
"samp_rate": 500000, "samp_rate": 500000,
"start_freq": 3570000, "start_freq": 3570000,
"start_mod": "usb", "start_mod": "usb",
@ -157,7 +160,8 @@ sdrs = {
"49m": { "49m": {
"name": "49m Broadcast", "name": "49m Broadcast",
"center_freq": 6000000, "center_freq": 6000000,
"rf_gain": 40, "rf_gain": 4,
"if_gain": 40,
"samp_rate": 500000, "samp_rate": 500000,
"start_freq": 6070000, "start_freq": 6070000,
"start_mod": "am", "start_mod": "am",

View File

@ -81,7 +81,7 @@ class OpenWebRxClient(object):
def setParams(self, params): def setParams(self, params):
# only the keys in the protected property manager can be overridden from the web # only the keys in the protected property manager can be overridden from the web
protected = self.sdr.getProps().collect("samp_rate", "center_freq", "rf_gain", "type") \ protected = self.sdr.getProps().collect("samp_rate", "center_freq", "rf_gain", "type", "if_gain") \
.defaults(PropertyManager.getSharedInstance()) .defaults(PropertyManager.getSharedInstance())
for key, value in params.items(): for key, value in params.items():
protected[key] = value protected[key] = value

View File

@ -76,7 +76,7 @@ class SdrSource(object):
self.props = props self.props = props
self.activateProfile() self.activateProfile()
self.rtlProps = self.props.collect( self.rtlProps = self.props.collect(
"samp_rate", "nmux_memory", "center_freq", "ppm", "rf_gain", "lna_gain", "rf_amp", "antenna" "samp_rate", "nmux_memory", "center_freq", "ppm", "rf_gain", "lna_gain", "rf_amp", "antenna", "if_gain"
).defaults(PropertyManager.getSharedInstance()) ).defaults(PropertyManager.getSharedInstance())
def restart(name, value): def restart(name, value):
@ -132,7 +132,7 @@ class SdrSource(object):
props = self.rtlProps props = self.rtlProps
start_sdr_command = self.getCommand().format( start_sdr_command = self.getCommand().format(
**props.collect("samp_rate", "center_freq", "ppm", "rf_gain", "lna_gain", "rf_amp", "antenna").__dict__() **props.collect("samp_rate", "center_freq", "ppm", "rf_gain", "lna_gain", "rf_amp", "antenna", "if_gain").__dict__()
) )
format_conversion = self.getFormatConversion() format_conversion = self.getFormatConversion()
@ -244,7 +244,11 @@ class HackrfSource(SdrSource):
class SdrplaySource(SdrSource): class SdrplaySource(SdrSource):
def getCommand(self): def getCommand(self):
command = "rx_sdr -F CF32 -s {samp_rate} -f {center_freq} -p {ppm} -g {rf_gain}" command = "rx_sdr -F CF32 -s {samp_rate} -f {center_freq} -p {ppm}"
gainMap = { "rf_gain" : "RFGR", "if_gain" : "IFGR"}
gains = [ "{0}={{{1}}}".format(gainMap[name], name) for name in self.rtlProps.collect("rf_gain", "if_gain").__dict__() ]
if gains:
command += " -g {gains}".format(gains = ",".join(gains))
if self.rtlProps["antenna"] is not None: if self.rtlProps["antenna"] is not None:
command += " -a \"{antenna}\"" command += " -a \"{antenna}\""
command += " -" command += " -"