straighten out sdrplay options

This commit is contained in:
Jakob Ketterl 2024-01-17 23:12:24 +01:00
parent 402eadd280
commit 02c631e6e7
1 changed files with 15 additions and 18 deletions

View File

@ -1,5 +1,5 @@
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
from owrx.form.input.device import BiasTeeInput from owrx.form.input.device import BiasTeeInput
from owrx.form.input.validator import Range from owrx.form.input.validator import Range
from typing import List from typing import List
@ -13,8 +13,8 @@ class SdrplaySource(SoapyConnectorSource):
"bias_tee": "biasT_ctrl", "bias_tee": "biasT_ctrl",
"rf_notch": "rfnotch_ctrl", "rf_notch": "rfnotch_ctrl",
"dab_notch": "dabnotch_ctrl", "dab_notch": "dabnotch_ctrl",
"if_mode": "if_mode",
"external_reference": "extref_ctrl", "external_reference": "extref_ctrl",
"hdr_ctrl": "hdr_ctrl",
} }
) )
return mappings return mappings
@ -23,16 +23,6 @@ class SdrplaySource(SoapyConnectorSource):
return "sdrplay" return "sdrplay"
class IfModeOptions(DropdownEnum):
IFMODE_ZERO_IF = "Zero-IF"
IFMODE_450 = "450kHz"
IFMODE_1620 = "1620kHz"
IFMODE_2048 = "2048kHz"
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)"
@ -51,18 +41,25 @@ class SdrplayDeviceDescription(SoapyConnectorDeviceDescription):
"dab_notch", "dab_notch",
"Enable DAB notch filter", "Enable DAB notch filter",
), ),
DropdownInput( CheckboxInput(
"if_mode", "external_reference",
"IF Mode", "Enable external reference clock",
IfModeOptions,
), ),
CheckboxInput(
"hdr_ctrl",
"Enable RSPdx HDR mode",
)
] ]
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", "external_reference", "hdr_ctrl"
]
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", "external_reference", "hdr_ctrl"
]
def getSampleRateRanges(self) -> list[Range]: def getSampleRateRanges(self) -> list[Range]:
# this is from SoapySDRPlay3's implementation of listSampleRates(). # this is from SoapySDRPlay3's implementation of listSampleRates().