diff --git a/owrx/source/sdrplay.py b/owrx/source/sdrplay.py index 454e472..fb89b18 100644 --- a/owrx/source/sdrplay.py +++ b/owrx/source/sdrplay.py @@ -1,6 +1,6 @@ from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription -from owrx.form.input import Input, CheckboxInput, DropdownInput, DropdownEnum -from owrx.form.input.device import BiasTeeInput +from owrx.form.input import Input, CheckboxInput, DropdownInput, NumberInput, DropdownEnum +from owrx.form.input.device import BiasTeeInput, GainInput from typing import List @@ -14,6 +14,8 @@ class SdrplaySource(SoapyConnectorSource): "dab_notch": "dabnotch_ctrl", "if_mode": "if_mode", "external_reference": "extref_ctrl", + "rfgain_sel": "rfgain_sel", + "agc_setpoint": "agc_setpoint", } ) return mappings @@ -36,9 +38,6 @@ class SdrplayDeviceDescription(SoapyConnectorDeviceDescription): def getName(self): return "SDRPlay device (RSP1, RSP2, RSPDuo, RSPDx)" - def getGainStages(self): - return ["RFGR", "IFGR"] - def getInputs(self) -> List[Input]: return super().getInputs() + [ BiasTeeInput(), @@ -55,10 +54,24 @@ class SdrplayDeviceDescription(SoapyConnectorDeviceDescription): "IF Mode", 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): - 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): - 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"]