From e37bc0573df434fe95ba4929f9e65f3d17500e4f Mon Sep 17 00:00:00 2001 From: Jim Ancona Date: Mon, 10 May 2021 20:35:49 -0400 Subject: [PATCH] Set proper config options for HPSDR connector --- owrx/source/hpsdr.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/owrx/source/hpsdr.py b/owrx/source/hpsdr.py index b0ee66c..8c317dc 100644 --- a/owrx/source/hpsdr.py +++ b/owrx/source/hpsdr.py @@ -1,5 +1,7 @@ from owrx.source.connector import ConnectorSource, ConnectorDeviceDescription from owrx.command import Option +from owrx.form.input import Input, NumberInput, TextInput +from typing import List # In order to use an HPSDR radio, you must install hpsdrconnector from https://github.com/jancona/hpsdrconnector # These are the command line options available: @@ -34,7 +36,25 @@ class HpsdrSource(ConnectorSource): ) ) +class RemoteInput(TextInput): + def __init__(self): + super().__init__( + "remote", "Remote IP", infotext="Remote IP address to connect to." + ) class HpsdrDeviceDescription(ConnectorDeviceDescription): def getName(self): return "HPSDR devices (Hermes / Hermes Lite 2 / Red Pitaya)" + + def getInputs(self) -> List[Input]: + return list(filter(lambda x : x.id != "rf_gain", super().getInputs())) + [ + RemoteInput(), NumberInput("rf_gain", "LNA Gain", + "LNA gain between 0 (-12dB) and 60 (48dB)"), + ] + + def getDeviceOptionalKeys(self): + return list(filter(lambda x : x not in ["rtltcp_compat", "iqswap"], super().getDeviceOptionalKeys())) + ["remote"] + + def getProfileOptionalKeys(self): + return list(filter(lambda x : x != "iqswap", super().getProfileOptionalKeys())) +