2021-02-19 14:29:17 +00:00
|
|
|
from owrx.source.connector import ConnectorSource, ConnectorDeviceDescription
|
2020-04-01 21:37:40 +00:00
|
|
|
from owrx.command import Flag, Option
|
2021-02-19 13:44:16 +00:00
|
|
|
from typing import List
|
|
|
|
from owrx.form import Input, TextInput
|
2021-02-20 17:48:12 +00:00
|
|
|
from owrx.form.device import BiasTeeInput, DirectSamplingInput
|
2019-12-21 19:58:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RtlSdrSource(ConnectorSource):
|
2019-12-31 18:14:05 +00:00
|
|
|
def getCommandMapper(self):
|
2020-04-01 21:37:40 +00:00
|
|
|
return (
|
|
|
|
super()
|
|
|
|
.getCommandMapper()
|
|
|
|
.setBase("rtl_connector")
|
|
|
|
.setMappings({"bias_tee": Flag("-b"), "direct_sampling": Option("-e")})
|
2020-03-26 12:33:32 +00:00
|
|
|
)
|
2021-02-19 13:44:16 +00:00
|
|
|
|
|
|
|
|
2021-02-19 14:29:17 +00:00
|
|
|
class RtlSdrDeviceDescription(ConnectorDeviceDescription):
|
2021-02-19 13:44:16 +00:00
|
|
|
def getInputs(self) -> List[Input]:
|
2021-02-21 23:35:47 +00:00
|
|
|
return super().getInputs() + [
|
|
|
|
TextInput(
|
|
|
|
"device",
|
|
|
|
"Device identifier",
|
|
|
|
infotext="Device serial number or index",
|
|
|
|
),
|
|
|
|
BiasTeeInput(),
|
2021-02-22 23:27:29 +00:00
|
|
|
DirectSamplingInput(),
|
2021-02-21 23:35:47 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
def getOptionalKeys(self):
|
|
|
|
return super().getOptionalKeys() + ["device", "bias_tee", "direct_sampling"]
|
2021-02-23 17:32:23 +00:00
|
|
|
|
|
|
|
def getProfileOptionalKeys(self):
|
|
|
|
return super().getProfileOptionalKeys() + ["bias_tee", "direct_sampling"]
|