remove implicit optional handling for optional fields
This commit is contained in:
@ -11,7 +11,7 @@ from owrx.command import CommandMapper
|
||||
from owrx.socket import getAvailablePort
|
||||
from owrx.property import PropertyStack, PropertyLayer
|
||||
from owrx.form import Input, TextInput, NumberInput, CheckboxInput
|
||||
from owrx.form.converter import IntConverter, OptionalConverter
|
||||
from owrx.form.converter import OptionalConverter
|
||||
from owrx.form.device import GainInput
|
||||
from owrx.controllers.settings import Section
|
||||
from typing import List
|
||||
@ -471,18 +471,15 @@ class SdrDeviceDescription(object):
|
||||
"ppm",
|
||||
"Frequency correction",
|
||||
append="ppm",
|
||||
converter=OptionalConverter(IntConverter(), defaultFormValue="0"),
|
||||
),
|
||||
CheckboxInput(
|
||||
"always-on",
|
||||
"Keep device running at all times",
|
||||
infotext="Prevents shutdown of the device when idle. Useful for devices with unreliable startup.",
|
||||
converter=OptionalConverter(defaultFormValue=False),
|
||||
),
|
||||
CheckboxInput(
|
||||
"services",
|
||||
"Run background services on this device",
|
||||
converter=OptionalConverter(defaultFormValue=True),
|
||||
),
|
||||
GainInput("rf_gain", "Device gain"),
|
||||
NumberInput(
|
||||
@ -491,10 +488,9 @@ class SdrDeviceDescription(object):
|
||||
append="Hz",
|
||||
infotext="Use this when the actual receiving frequency differs from the frequency to be tuned on the"
|
||||
+ " device. <br/> Formula: Center frequency + oscillator offset = sdr tune frequency",
|
||||
converter=OptionalConverter(),
|
||||
),
|
||||
NumberInput("waterfall_min_level", "Lowest waterfall level", append="dBFS", converter=OptionalConverter()),
|
||||
NumberInput("waterfall_max_level", "Highest waterfall level", append="dBFS", converter=OptionalConverter()),
|
||||
NumberInput("waterfall_min_level", "Lowest waterfall level", append="dBFS"),
|
||||
NumberInput("waterfall_max_level", "Highest waterfall level", append="dBFS"),
|
||||
# TODO `schedule`
|
||||
]
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription
|
||||
from owrx.form import Input, CheckboxInput
|
||||
from owrx.form.device import BiasTeeInput
|
||||
from owrx.form.converter import OptionalConverter
|
||||
from typing import List
|
||||
|
||||
|
||||
@ -29,7 +28,6 @@ class AirspyDeviceDescription(SoapyConnectorDeviceDescription):
|
||||
"Enable bit-packing",
|
||||
infotext="Packs two 12-bit samples into 3 bytes."
|
||||
+ " Lowers USB bandwidth consumption, increases CPU load",
|
||||
converter=OptionalConverter(defaultFormValue=False),
|
||||
),
|
||||
]
|
||||
|
||||
|
@ -4,7 +4,6 @@ import socket
|
||||
from owrx.command import Flag, Option
|
||||
from typing import List
|
||||
from owrx.form import Input, NumberInput, CheckboxInput
|
||||
from owrx.form.converter import OptionalConverter, IntConverter
|
||||
|
||||
import logging
|
||||
|
||||
@ -83,13 +82,11 @@ class ConnectorDeviceDescription(SdrDeviceDescription):
|
||||
infotext="Activate an rtl_tcp compatible interface on the port number specified.<br />"
|
||||
+ "Note: Port is only available on the local machine, not on the network.<br />"
|
||||
+ "Note: IQ data may be degraded by the downsampling process to 8 bits.",
|
||||
converter=OptionalConverter(IntConverter()),
|
||||
),
|
||||
CheckboxInput(
|
||||
"iqswap",
|
||||
"Swap I and Q channels",
|
||||
infotext="Swapping inverts the spectrum, so this is useful in combination with an inverting mixer",
|
||||
converter=OptionalConverter(defaultFormValue=False),
|
||||
),
|
||||
]
|
||||
|
||||
|
@ -2,7 +2,6 @@ from owrx.source.connector import ConnectorSource, ConnectorDeviceDescription
|
||||
from owrx.command import Flag, Option
|
||||
from typing import List
|
||||
from owrx.form import Input, TextInput
|
||||
from owrx.form.converter import OptionalConverter
|
||||
from owrx.form.device import BiasTeeInput, DirectSamplingInput
|
||||
|
||||
|
||||
@ -23,10 +22,9 @@ class RtlSdrDeviceDescription(ConnectorDeviceDescription):
|
||||
"device",
|
||||
"Device identifier",
|
||||
infotext="Device serial number or index",
|
||||
converter=OptionalConverter(),
|
||||
),
|
||||
BiasTeeInput(),
|
||||
DirectSamplingInput()
|
||||
DirectSamplingInput(),
|
||||
]
|
||||
|
||||
def getOptionalKeys(self):
|
||||
|
@ -2,7 +2,6 @@ from owrx.source.connector import ConnectorSource, ConnectorDeviceDescription
|
||||
from owrx.command import Argument, Flag, Option
|
||||
from owrx.form import Input, DropdownInput, DropdownEnum, CheckboxInput
|
||||
from owrx.form.device import RemoteInput
|
||||
from owrx.form.converter import OptionalConverter
|
||||
from typing import List
|
||||
|
||||
|
||||
@ -42,10 +41,11 @@ class RundsDeviceDescription(ConnectorDeviceDescription):
|
||||
return super().getInputs() + [
|
||||
RemoteInput(),
|
||||
DropdownInput("protocol", "Protocol", ProtocolOptions),
|
||||
CheckboxInput(
|
||||
"long", "", "Use 32-bit sample size (LONG)", converter=OptionalConverter(defaultFormValue=False)
|
||||
),
|
||||
CheckboxInput("long", "Use 32-bit sample size (LONG)"),
|
||||
]
|
||||
|
||||
def getMandatoryKeys(self):
|
||||
return super().getMandatoryKeys() + ["device"]
|
||||
|
||||
def getOptionalKeys(self):
|
||||
return super().getOptionalKeys() + ["protocol", "long"]
|
||||
|
@ -1,7 +1,6 @@
|
||||
from owrx.source.soapy import SoapyConnectorSource, SoapyConnectorDeviceDescription
|
||||
from owrx.form import Input, CheckboxInput, DropdownInput, DropdownEnum
|
||||
from owrx.form.device import BiasTeeInput
|
||||
from owrx.form.converter import OptionalConverter, EnumConverter
|
||||
from typing import List
|
||||
|
||||
|
||||
@ -43,20 +42,15 @@ class SdrplayDeviceDescription(SoapyConnectorDeviceDescription):
|
||||
CheckboxInput(
|
||||
"rf_notch",
|
||||
"Enable RF notch filter",
|
||||
converter=OptionalConverter(defaultFormValue=True),
|
||||
),
|
||||
CheckboxInput(
|
||||
"dab_notch",
|
||||
"Enable DAB notch filter",
|
||||
converter=OptionalConverter(defaultFormValue=True),
|
||||
),
|
||||
DropdownInput(
|
||||
"if_mode",
|
||||
"IF Mode",
|
||||
IfModeOptions,
|
||||
converter=OptionalConverter(
|
||||
EnumConverter(IfModeOptions), defaultFormValue=IfModeOptions.IFMODE_ZERO_IF.name
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
|
@ -3,7 +3,6 @@ from owrx.command import Option
|
||||
from owrx.source.connector import ConnectorSource, ConnectorDeviceDescription
|
||||
from typing import List
|
||||
from owrx.form import Input, TextInput
|
||||
from owrx.form.converter import OptionalConverter
|
||||
from owrx.form.device import GainInput
|
||||
from owrx.soapy import SoapySettings
|
||||
|
||||
@ -89,18 +88,13 @@ class SoapyConnectorDeviceDescription(ConnectorDeviceDescription):
|
||||
"device",
|
||||
"Device Identifier",
|
||||
infotext='SoapySDR device identifier string (example: "serial=123456789")',
|
||||
converter=OptionalConverter()
|
||||
),
|
||||
GainInput(
|
||||
"rf_gain",
|
||||
"Device Gain",
|
||||
gain_stages=self.getGainStages(),
|
||||
),
|
||||
TextInput(
|
||||
"antenna",
|
||||
"Antenna",
|
||||
converter=OptionalConverter(),
|
||||
),
|
||||
TextInput("antenna", "Antenna"),
|
||||
]
|
||||
|
||||
def getOptionalKeys(self):
|
||||
|
Reference in New Issue
Block a user