Adding new gain options available in SoapySDRPlay3.

This commit is contained in:
Marat Fayzullin 2022-09-14 22:59:27 -04:00
parent 5cd0847362
commit 11ec294032

View File

@ -1,5 +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.validator import RangeValidator
from owrx.form.input.device import BiasTeeInput from owrx.form.input.device import BiasTeeInput
from typing import List from typing import List
@ -14,6 +15,9 @@ 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",
"gain_ctrl_mode": "gain_ctrl_mode",
"agc_setpoint": "agc_setpoint",
"rfgain_sel": "rfgain_sel"
} }
) )
return mappings return mappings
@ -32,6 +36,16 @@ class IfModeOptions(DropdownEnum):
return self.value return self.value
class GainModelOptions(DropdownEnum):
GMODEL_LEGACY = "LEGACY"
GMODEL_DB = "DB"
GMODEL_RFATT = "RFATT"
GMODEL_STEPS = "STEPS"
def __str__(self):
return self.value
class SdrplayDeviceDescription(SoapyConnectorDeviceDescription): class SdrplayDeviceDescription(SoapyConnectorDeviceDescription):
def getName(self): def getName(self):
return "SDRPlay device (RSP1, RSP2, RSPDuo, RSPDx)" return "SDRPlay device (RSP1, RSP2, RSPDuo, RSPDx)"
@ -55,10 +69,26 @@ class SdrplayDeviceDescription(SoapyConnectorDeviceDescription):
"IF Mode", "IF Mode",
IfModeOptions, IfModeOptions,
), ),
DropdownInput(
"gain_ctrl_model",
"Gain Control Model",
GainModelOptions,
),
NumberInput(
"agc_setpoint",
"AGC Setpoint",
append="dBFS",
validator=RangeValidator(-60, 0),
),
NumberInput(
"rfgain_sel",
"RF Gain Reduction",
validator=RangeValidator(0, 32),
),
] ]
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", "gain_ctrl_mode", "agc_setpoint", "rfgain_sel"]
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", "gain_ctrl_mode", "agc_setpoint", "rfgain_sel"]