Adding all current customizations to the original forked code.
This commit is contained in:
@ -33,6 +33,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=2400000,
|
||||
start_freq=439275000,
|
||||
start_mod="nfm",
|
||||
tuning_step="1000",
|
||||
),
|
||||
"2m": PropertyLayer(
|
||||
name="2m",
|
||||
@ -41,6 +42,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=2048000,
|
||||
start_freq=145725000,
|
||||
start_mod="nfm",
|
||||
tuning_step="1000",
|
||||
),
|
||||
}
|
||||
),
|
||||
@ -57,6 +59,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=384000,
|
||||
start_freq=14070000,
|
||||
start_mod="usb",
|
||||
tuning_step="500",
|
||||
),
|
||||
"30m": PropertyLayer(
|
||||
name="30m",
|
||||
@ -64,6 +67,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=192000,
|
||||
start_freq=10142000,
|
||||
start_mod="usb",
|
||||
tuning_step="500",
|
||||
),
|
||||
"40m": PropertyLayer(
|
||||
name="40m",
|
||||
@ -71,6 +75,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=256000,
|
||||
start_freq=7070000,
|
||||
start_mod="lsb",
|
||||
tuning_step="500",
|
||||
),
|
||||
"80m": PropertyLayer(
|
||||
name="80m",
|
||||
@ -78,6 +83,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=384000,
|
||||
start_freq=3570000,
|
||||
start_mod="lsb",
|
||||
tuning_step="500",
|
||||
),
|
||||
"49m": PropertyLayer(
|
||||
name="49m Broadcast",
|
||||
@ -85,6 +91,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=384000,
|
||||
start_freq=6070000,
|
||||
start_mod="am",
|
||||
tuning_step="1000",
|
||||
),
|
||||
}
|
||||
),
|
||||
@ -102,6 +109,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=500000,
|
||||
start_freq=14070000,
|
||||
start_mod="usb",
|
||||
tuning_step="500",
|
||||
),
|
||||
"30m": PropertyLayer(
|
||||
name="30m",
|
||||
@ -110,6 +118,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=250000,
|
||||
start_freq=10142000,
|
||||
start_mod="usb",
|
||||
tuning_step="500",
|
||||
),
|
||||
"40m": PropertyLayer(
|
||||
name="40m",
|
||||
@ -118,6 +127,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=500000,
|
||||
start_freq=7070000,
|
||||
start_mod="lsb",
|
||||
tuning_step="500",
|
||||
),
|
||||
"80m": PropertyLayer(
|
||||
name="80m",
|
||||
@ -126,6 +136,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=500000,
|
||||
start_freq=3570000,
|
||||
start_mod="lsb",
|
||||
tuning_step="500",
|
||||
),
|
||||
"49m": PropertyLayer(
|
||||
name="49m Broadcast",
|
||||
@ -134,6 +145,7 @@ defaultConfig = PropertyLayer(
|
||||
samp_rate=500000,
|
||||
start_freq=6070000,
|
||||
start_mod="am",
|
||||
tuning_step="1000",
|
||||
),
|
||||
}
|
||||
),
|
||||
@ -147,6 +159,7 @@ defaultConfig = PropertyLayer(
|
||||
squelch_auto_margin=10,
|
||||
google_maps_api_key="",
|
||||
map_position_retention_time=2 * 60 * 60,
|
||||
callsign_url="https://www.qrzcq.com/call/{}",
|
||||
decoding_queue_workers=2,
|
||||
decoding_queue_length=10,
|
||||
wsjt_decoding_depth=3,
|
||||
|
@ -120,6 +120,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
||||
"start_mod",
|
||||
"start_freq",
|
||||
"center_freq",
|
||||
"tuning_step",
|
||||
"initial_squelch_level",
|
||||
"sdr_id",
|
||||
"profile_id",
|
||||
@ -456,6 +457,7 @@ class MapConnection(OpenWebRxClient):
|
||||
"google_maps_api_key",
|
||||
"receiver_gps",
|
||||
"map_position_retention_time",
|
||||
"callsign_url",
|
||||
"receiver_name",
|
||||
)
|
||||
filtered_config.wire(self.write_config)
|
||||
|
@ -168,6 +168,13 @@ class GeneralSettingsController(SettingsFormController):
|
||||
infotext="Specifies how log markers / grids will remain visible on the map",
|
||||
append="s",
|
||||
),
|
||||
TextInput(
|
||||
"callsign_url",
|
||||
"Callsign database URL",
|
||||
infotext="Specifies callsign lookup URL, such as QRZ.COM "
|
||||
+ "or QRZCQ.COM. Place curly brackers ({}) where callsign "
|
||||
+ "is supposed to be.",
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
|
20
owrx/dsp.py
20
owrx/dsp.py
@ -34,10 +34,12 @@ class ClientDemodulatorSecondaryDspEventClient(ABC):
|
||||
|
||||
|
||||
class ClientDemodulatorChain(Chain):
|
||||
def __init__(self, demod: BaseDemodulatorChain, sampleRate: int, outputRate: int, hdOutputRate: int, audioCompression: str, secondaryDspEventReceiver: ClientDemodulatorSecondaryDspEventClient):
|
||||
def __init__(self, demod: BaseDemodulatorChain, sampleRate: int, outputRate: int, hdOutputRate: int, audioCompression: str, nrEnabled: bool, nrThreshold: int, secondaryDspEventReceiver: ClientDemodulatorSecondaryDspEventClient):
|
||||
self.sampleRate = sampleRate
|
||||
self.outputRate = outputRate
|
||||
self.hdOutputRate = hdOutputRate
|
||||
self.nrEnabled = nrEnabled
|
||||
self.nrThreshold = nrThreshold
|
||||
self.secondaryDspEventReceiver = secondaryDspEventReceiver
|
||||
self.selector = Selector(sampleRate, outputRate)
|
||||
self.selector.setBandpass(-4000, 4000)
|
||||
@ -50,7 +52,7 @@ class ClientDemodulatorChain(Chain):
|
||||
self.wfmDeemphasisTau = 50e-6
|
||||
inputRate = demod.getFixedAudioRate() if isinstance(demod, FixedAudioRateChain) else outputRate
|
||||
oRate = hdOutputRate if isinstance(demod, HdAudio) else outputRate
|
||||
self.clientAudioChain = ClientAudioChain(demod.getOutputFormat(), inputRate, oRate, audioCompression)
|
||||
self.clientAudioChain = ClientAudioChain(demod.getOutputFormat(), inputRate, oRate, audioCompression, nrEnabled, nrThreshold)
|
||||
self.secondaryFftSize = 2048
|
||||
self.secondaryFftOverlapFactor = 0.3
|
||||
self.secondaryFftFps = 9
|
||||
@ -251,6 +253,12 @@ class ClientDemodulatorChain(Chain):
|
||||
def setAudioCompression(self, compression: str) -> None:
|
||||
self.clientAudioChain.setAudioCompression(compression)
|
||||
|
||||
def setNrEnabled(self, nrEnabled: bool) -> None:
|
||||
self.clientAudioChain.setNrEnabled(nrEnabled)
|
||||
|
||||
def setNrThreshold(self, nrThreshold: int) -> None:
|
||||
self.clientAudioChain.setNrThreshold(nrThreshold)
|
||||
|
||||
def setSquelchLevel(self, level: float) -> None:
|
||||
if level == self.squelchLevel:
|
||||
return
|
||||
@ -409,6 +417,8 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient)
|
||||
"mod": ModulationValidator(),
|
||||
"secondary_offset_freq": "int",
|
||||
"dmr_filter": "int",
|
||||
"nr_enabled": "bool",
|
||||
"nr_threshold": "int",
|
||||
}
|
||||
self.localProps = PropertyValidator(PropertyLayer().filter(*validators.keys()), validators)
|
||||
|
||||
@ -436,6 +446,8 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient)
|
||||
output_rate=12000,
|
||||
hd_output_rate=48000,
|
||||
digital_voice_codecserver="",
|
||||
nr_enabled=False,
|
||||
nr_threshold=0
|
||||
).readonly()
|
||||
)
|
||||
|
||||
@ -445,6 +457,8 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient)
|
||||
self.props["output_rate"],
|
||||
self.props["hd_output_rate"],
|
||||
self.props["audio_compression"],
|
||||
self.props["nr_enabled"],
|
||||
self.props["nr_threshold"],
|
||||
self
|
||||
)
|
||||
|
||||
@ -487,6 +501,8 @@ class DspManager(SdrSourceEventClient, ClientDemodulatorSecondaryDspEventClient)
|
||||
self.props.wireProperty("wfm_deemphasis_tau", self.chain.setWfmDeemphasisTau),
|
||||
self.props.wireProperty("secondary_mod", self.setSecondaryDemodulator),
|
||||
self.props.wireProperty("secondary_offset_freq", self.chain.setSecondaryFrequencyOffset),
|
||||
self.props.wireProperty("nr_enabled", self.chain.setNrEnabled),
|
||||
self.props.wireProperty("nr_threshold", self.chain.setNrThreshold),
|
||||
]
|
||||
|
||||
# wire power level output
|
||||
|
@ -94,4 +94,5 @@ validator_types = {
|
||||
"int": IntegerValidator,
|
||||
"number": NumberValidator,
|
||||
"num": NumberValidator,
|
||||
"bool": BoolValidator,
|
||||
}
|
||||
|
@ -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"]
|
||||
|
@ -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"]
|
||||
|
Reference in New Issue
Block a user