From 27c16c372071c29020bec2edd8f18aff258475a2 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Fri, 19 Feb 2021 16:29:30 +0100 Subject: [PATCH] add more inputs --- owrx/source/__init__.py | 9 ++++++++- owrx/source/connector.py | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/owrx/source/__init__.py b/owrx/source/__init__.py index 9b84b67..f03e752 100644 --- a/owrx/source/__init__.py +++ b/owrx/source/__init__.py @@ -10,7 +10,7 @@ from abc import ABC, abstractmethod from owrx.command import CommandMapper from owrx.socket import getAvailablePort from owrx.property import PropertyStack, PropertyLayer -from owrx.form import Input, TextInput, NumberInput +from owrx.form import Input, TextInput, NumberInput, CheckboxInput from owrx.controllers.settings import Section from typing import List @@ -376,6 +376,13 @@ class SdrDeviceDescription(object): return [ TextInput("name", "Device name"), NumberInput("ppm", "Frequency correction", append="ppm"), + CheckboxInput( + "always-on", + "", + checkboxText="Keep device running at all times", + infotext="Prevents shutdown of the device when idle. Useful for devices with unreliable startup." + ), + CheckboxInput("services", "", "Run services on this device"), ] def mergeInputs(self, *args): diff --git a/owrx/source/connector.py b/owrx/source/connector.py index dd055c2..60ce212 100644 --- a/owrx/source/connector.py +++ b/owrx/source/connector.py @@ -2,6 +2,8 @@ from owrx.source import SdrSource, SdrDeviceDescription from owrx.socket import getAvailablePort import socket from owrx.command import Flag, Option +from typing import List +from owrx.form import Input, NumberInput import logging @@ -72,4 +74,16 @@ class ConnectorSource(SdrSource): class ConnectorDeviceDescription(SdrDeviceDescription): - pass + def getInputs(self) -> List[Input]: + return self.mergeInputs( + super().getInputs(), + [ + NumberInput( + "rtltcp_compat", + "Port for rtl_tcp compatible data", + infotext="Activate an rtl_tcp compatible interface on the port number specified.
" + + "Note: Port is only available on the local machine, not on the network.
" + + "Note: IQ data may be degraded by the downsampling process to 8 bits.", + ) + ], + )