Merge branch 'server_rework' into server_rework_dsd

This commit is contained in:
Jakob Ketterl 2019-05-19 22:10:39 +02:00
commit a36eb55680
3 changed files with 16 additions and 8 deletions

View File

@ -134,7 +134,8 @@ sdrs = {
"20m": {
"name":"20m",
"center_freq": 14150000,
"rf_gain": 40,
"rf_gain": 4,
"if_gain": 40,
"samp_rate": 500000,
"start_freq": 14070000,
"start_mod": "usb",
@ -151,7 +152,8 @@ sdrs = {
"40m": {
"name":"40m",
"center_freq": 7100000,
"rf_gain": 40,
"rf_gain": 4,
"if_gain": 40,
"samp_rate": 500000,
"start_freq": 7070000,
"start_mod": "usb",
@ -160,7 +162,8 @@ sdrs = {
"80m": {
"name":"80m",
"center_freq": 3650000,
"rf_gain": 40,
"rf_gain": 4,
"if_gain": 40,
"samp_rate": 500000,
"start_freq": 3570000,
"start_mod": "usb",
@ -169,7 +172,8 @@ sdrs = {
"49m": {
"name": "49m Broadcast",
"center_freq": 6000000,
"rf_gain": 40,
"rf_gain": 4,
"if_gain": 40,
"samp_rate": 500000,
"start_freq": 6070000,
"start_mod": "am",

View File

@ -90,7 +90,7 @@ class OpenWebRxClient(object):
def setParams(self, params):
# 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())
for key, value in params.items():
protected[key] = value

View File

@ -76,7 +76,7 @@ class SdrSource(object):
self.props = props
self.activateProfile()
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())
def restart(name, value):
@ -132,7 +132,7 @@ class SdrSource(object):
props = self.rtlProps
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()
@ -243,7 +243,11 @@ class HackrfSource(SdrSource):
class SdrplaySource(SdrSource):
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:
command += " -a \"{antenna}\""
command += " -"