Adding all current customizations to the original forked code.

This commit is contained in:
Marat Fayzullin
2022-11-19 14:34:47 -05:00
parent e20d94e241
commit e3780f6aea
13 changed files with 255 additions and 49 deletions

View File

@ -12,8 +12,8 @@ from owrx.command import CommandMapper
from owrx.socket import getAvailablePort
from owrx.property import PropertyStack, PropertyLayer, PropertyFilter, PropertyCarousel, PropertyDeleted
from owrx.property.filter import ByLambda
from owrx.form.input import Input, TextInput, NumberInput, CheckboxInput, ModesInput, ExponentialInput
from owrx.form.input.converter import OptionalConverter
from owrx.form.input import Input, TextInput, NumberInput, CheckboxInput, ModesInput, ExponentialInput, DropdownInput, Option
from owrx.form.input.converter import OptionalConverter, IntConverter
from owrx.form.input.device import GainInput, SchedulerInput, WaterfallLevelsInput
from owrx.form.input.validator import RequiredValidator
from owrx.form.section import OptionalSection
@ -277,8 +277,9 @@ class SdrSource(ABC):
if self.monitor:
return
if self.isFailed():
return
# @@@
# if self.isFailed():
# return
try:
self.preStart()
@ -568,6 +569,12 @@ class SdrDeviceDescription(object):
ExponentialInput("samp_rate", "Sample rate", "S/s"),
ExponentialInput("start_freq", "Initial frequency", "Hz"),
ModesInput("start_mod", "Initial modulation"),
DropdownInput(
"tuning_step",
"Tuning step",
options=[Option(str(i), "{} Hz".format(i)) for i in [1, 100, 500, 1000, 2500, 3000, 5000, 6000, 10000, 12000, 50000]],
converter=IntConverter(),
),
NumberInput("initial_squelch_level", "Initial squelch level", append="dBFS"),
]
@ -592,7 +599,7 @@ class SdrDeviceDescription(object):
return keys
def getProfileMandatoryKeys(self):
return ["name", "center_freq", "samp_rate", "start_freq", "start_mod"]
return ["name", "center_freq", "samp_rate", "start_freq", "start_mod", "tuning_step"]
def getProfileOptionalKeys(self):
return ["initial_squelch_level", "rf_gain", "lfo_offset", "waterfall_levels"]

View File

@ -1,6 +1,7 @@
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 owrx.form.input.validator import RangeValidator
from typing import List
@ -14,6 +15,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 +39,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 +55,26 @@ class SdrplayDeviceDescription(SoapyConnectorDeviceDescription):
"IF Mode",
IfModeOptions,
),
NumberInput(
"rfgain_sel",
"RF gain reduction",
validator=RangeValidator(0, 32),
),
NumberInput(
"agc_setpoint",
"AGC setpoint",
append="dBFS",
validator=RangeValidator(-60, 0),
),
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"]