use frequency input for the other inputs, too

This commit is contained in:
Jakob Ketterl 2021-02-27 22:44:48 +01:00
parent e787336fc4
commit 7a0c934af5
2 changed files with 6 additions and 6 deletions

View File

@ -322,8 +322,8 @@ class ModesInput(DropdownInput):
class FrequencyInput(Input): class FrequencyInput(Input):
def __init__(self, id, label): def __init__(self, id, label, infotext=None):
super().__init__(id, label) super().__init__(id, label, infotext=infotext)
def defaultConverter(self): def defaultConverter(self):
return IntConverter() return IntConverter()
@ -337,7 +337,7 @@ class FrequencyInput(Input):
def render_input(self, value): def render_input(self, value):
append = """ append = """
<div class="input-group-append"> <div class="input-group-append">
<select class="input-group-text frequency-exponent" name="{id}-exponent"> <select class="input-group-text frequency-exponent" name="{id}-exponent" {disabled}>
<option value="0" selected>Hz</option> <option value="0" selected>Hz</option>
<option value="3">kHz</option> <option value="3">kHz</option>
<option value="6">MHz</option> <option value="6">MHz</option>
@ -347,6 +347,7 @@ class FrequencyInput(Input):
</div> </div>
""".format( """.format(
id=self.id, id=self.id,
disabled="disabled" if self.disabled else "",
) )
return """ return """

View File

@ -494,10 +494,9 @@ class SdrDeviceDescription(object):
"services", "services",
"Run background services on this device", "Run background services on this device",
), ),
NumberInput( FrequencyInput(
"lfo_offset", "lfo_offset",
"Oscilator offset", "Oscilator offset",
append="Hz",
infotext="Use this when the actual receiving frequency differs from the frequency to be tuned on the" 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", + " device. <br/> Formula: Center frequency + oscillator offset = sdr tune frequency",
), ),
@ -505,7 +504,7 @@ class SdrDeviceDescription(object):
SchedulerInput("scheduler", "Scheduler"), SchedulerInput("scheduler", "Scheduler"),
FrequencyInput("center_freq", "Center frequency"), FrequencyInput("center_freq", "Center frequency"),
NumberInput("samp_rate", "Sample rate", append="S/s"), NumberInput("samp_rate", "Sample rate", append="S/s"),
NumberInput("start_freq", "Initial frequency", append="Hz"), FrequencyInput("start_freq", "Initial frequency"),
ModesInput("start_mod", "Initial modulation"), ModesInput("start_mod", "Initial modulation"),
NumberInput("initial_squelch_level", "Initial squelch level", append="dBFS"), NumberInput("initial_squelch_level", "Initial squelch level", append="dBFS"),
] ]