Introducing proper SDRPlay gains, optional AGC reduction parameter.

This commit is contained in:
Marat Fayzullin 2022-08-25 12:30:08 -04:00
parent 5cd0847362
commit f7cb9b1b1f

View File

@ -1,6 +1,6 @@
from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription
from owrx.form.input import Input, CheckboxInput, DropdownInput, DropdownEnum from owrx.form.input import Input, CheckboxInput, DropdownInput, NumberInput, DropdownEnum
from owrx.form.input.device import BiasTeeInput from owrx.form.input.device import BiasTeeInput, GainInput
from typing import List from typing import List
@ -14,6 +14,8 @@ class SdrplaySource(SoapyConnectorSource):
"dab_notch": "dabnotch_ctrl", "dab_notch": "dabnotch_ctrl",
"if_mode": "if_mode", "if_mode": "if_mode",
"external_reference": "extref_ctrl", "external_reference": "extref_ctrl",
"rfgain_sel": "rfgain_sel",
"agc_setpoint": "agc_setpoint",
} }
) )
return mappings return mappings
@ -36,9 +38,6 @@ class SdrplayDeviceDescription(SoapyConnectorDeviceDescription):
def getName(self): def getName(self):
return "SDRPlay device (RSP1, RSP2, RSPDuo, RSPDx)" return "SDRPlay device (RSP1, RSP2, RSPDuo, RSPDx)"
def getGainStages(self):
return ["RFGR", "IFGR"]
def getInputs(self) -> List[Input]: def getInputs(self) -> List[Input]:
return super().getInputs() + [ return super().getInputs() + [
BiasTeeInput(), BiasTeeInput(),
@ -55,10 +54,24 @@ class SdrplayDeviceDescription(SoapyConnectorDeviceDescription):
"IF Mode", "IF Mode",
IfModeOptions, IfModeOptions,
), ),
NumberInput(
"rfgain_sel",
"RF gain reduction",
),
NumberInput(
"agc_setpoint",
"AGC setpoint",
append="dBFS",
),
GainInput(
"rf_gain",
"IF gain reduction",
has_agc=self.hasAgc(),
),
] ]
def getDeviceOptionalKeys(self): def getDeviceOptionalKeys(self):
return super().getDeviceOptionalKeys() + ["bias_tee", "rf_notch", "dab_notch", "if_mode"] return super().getDeviceOptionalKeys() + ["bias_tee", "rf_notch", "dab_notch", "if_mode", "rfgain_sel", "agc_setpoint"]
def getProfileOptionalKeys(self): def getProfileOptionalKeys(self):
return super().getProfileOptionalKeys() + ["bias_tee", "rf_notch", "dab_notch", "if_mode"] return super().getProfileOptionalKeys() + ["bias_tee", "rf_notch", "dab_notch", "if_mode", "rfgain_sel", "agc_setpoint"]