make a more generic ExponentialInput and use that for the sample_rate input
This commit is contained in:
@ -153,7 +153,7 @@ class CompiledAssetsController(GzipMixin, ModificationAwareController):
|
||||
"lib/settings/GainInput.js",
|
||||
"lib/settings/OptionalSection.js",
|
||||
"lib/settings/SchedulerInput.js",
|
||||
"lib/settings/FrequencyInput.js",
|
||||
"lib/settings/ExponentialInput.js",
|
||||
"settings.js",
|
||||
],
|
||||
}
|
||||
|
@ -321,9 +321,10 @@ class ModesInput(DropdownInput):
|
||||
super().__init__(id, label, options)
|
||||
|
||||
|
||||
class FrequencyInput(Input):
|
||||
def __init__(self, id, label, infotext=None):
|
||||
class ExponentialInput(Input):
|
||||
def __init__(self, id, label, unit, infotext=None):
|
||||
super().__init__(id, label, infotext=infotext)
|
||||
self.unit = unit
|
||||
|
||||
def defaultConverter(self):
|
||||
return IntConverter()
|
||||
@ -337,21 +338,22 @@ class FrequencyInput(Input):
|
||||
def render_input(self, value):
|
||||
append = """
|
||||
<div class="input-group-append">
|
||||
<select class="input-group-text frequency-exponent" name="{id}-exponent" {disabled}>
|
||||
<option value="0" selected>Hz</option>
|
||||
<option value="3">kHz</option>
|
||||
<option value="6">MHz</option>
|
||||
<option value="9">GHz</option>
|
||||
<option value="12">THz</option>
|
||||
<select class="input-group-text exponent" name="{id}-exponent" {disabled}>
|
||||
<option value="0" selected>{unit}</option>
|
||||
<option value="3">k{unit}</option>
|
||||
<option value="6">M{unit}</option>
|
||||
<option value="9">G{unit}</option>
|
||||
<option value="12">T{unit}</option>
|
||||
</select>
|
||||
</div>
|
||||
""".format(
|
||||
id=self.id,
|
||||
disabled="disabled" if self.disabled else "",
|
||||
unit=self.unit,
|
||||
)
|
||||
|
||||
return """
|
||||
<div class="input-group input-group-sm frequency-input">
|
||||
<div class="input-group input-group-sm exponential-input">
|
||||
{input}
|
||||
{append}
|
||||
</div>
|
||||
|
@ -11,7 +11,7 @@ from owrx.command import CommandMapper
|
||||
from owrx.socket import getAvailablePort
|
||||
from owrx.property import PropertyStack, PropertyLayer, PropertyFilter
|
||||
from owrx.property.filter import ByLambda
|
||||
from owrx.form import Input, TextInput, NumberInput, CheckboxInput, ModesInput, FrequencyInput
|
||||
from owrx.form import Input, TextInput, NumberInput, CheckboxInput, ModesInput, ExponentialInput
|
||||
from owrx.form.converter import OptionalConverter
|
||||
from owrx.form.device import GainInput, SchedulerInput, WaterfallLevelsInput
|
||||
from owrx.controllers.settings import Section
|
||||
@ -494,17 +494,18 @@ class SdrDeviceDescription(object):
|
||||
"services",
|
||||
"Run background services on this device",
|
||||
),
|
||||
FrequencyInput(
|
||||
ExponentialInput(
|
||||
"lfo_offset",
|
||||
"Oscilator offset",
|
||||
"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",
|
||||
),
|
||||
WaterfallLevelsInput("waterfall_levels", "Waterfall levels"),
|
||||
SchedulerInput("scheduler", "Scheduler"),
|
||||
FrequencyInput("center_freq", "Center frequency"),
|
||||
NumberInput("samp_rate", "Sample rate", append="S/s"),
|
||||
FrequencyInput("start_freq", "Initial frequency"),
|
||||
ExponentialInput("center_freq", "Center frequency", "Hz"),
|
||||
ExponentialInput("samp_rate", "Sample rate", "S/s"),
|
||||
ExponentialInput("start_freq", "Initial frequency", "Hz"),
|
||||
ModesInput("start_mod", "Initial modulation"),
|
||||
NumberInput("initial_squelch_level", "Initial squelch level", append="dBFS"),
|
||||
]
|
||||
|
Reference in New Issue
Block a user