change display precision behavior to reference Hertz
This commit is contained in:
@ -2,7 +2,7 @@ from owrx.property import PropertyLayer
|
||||
|
||||
|
||||
defaultConfig = PropertyLayer(
|
||||
version=5,
|
||||
version=6,
|
||||
max_clients=20,
|
||||
receiver_name="[Callsign]",
|
||||
receiver_location="Budapest, Hungary",
|
||||
@ -25,7 +25,7 @@ defaultConfig = PropertyLayer(
|
||||
waterfall_scheme="GoogleTurboWaterfall",
|
||||
waterfall_levels=PropertyLayer(min=-88, max=-20),
|
||||
waterfall_auto_level_margin=PropertyLayer(min=3, max=10, min_range=50),
|
||||
frequency_display_precision=4,
|
||||
tuning_precision=2,
|
||||
squelch_auto_margin=10,
|
||||
nmux_memory=50,
|
||||
google_maps_api_key="",
|
||||
|
@ -89,13 +89,23 @@ class ConfigMigratorVersion4(ConfigMigrator):
|
||||
config["version"] = 5
|
||||
|
||||
|
||||
class ConfigMigratorVersion5(ConfigMigrator):
|
||||
def migrate(self, config):
|
||||
if "frequency_display_precision" in config:
|
||||
# old config was always in relation to the display in MHz (1e6 Hz, hence the 6)
|
||||
config["tuning_precision"] = 6 - config["frequency_display_precision"]
|
||||
del config["frequency_display_precision"]
|
||||
config["version"] = 6
|
||||
|
||||
|
||||
class Migrator(object):
|
||||
currentVersion = 5
|
||||
currentVersion = 6
|
||||
migrators = {
|
||||
1: ConfigMigratorVersion1(),
|
||||
2: ConfigMigratorVersion2(),
|
||||
3: ConfigMigratorVersion3(),
|
||||
4: ConfigMigratorVersion4(),
|
||||
5: ConfigMigratorVersion5(),
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
|
@ -132,7 +132,7 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
||||
"audio_compression",
|
||||
"fft_compression",
|
||||
"max_clients",
|
||||
"frequency_display_precision",
|
||||
"tuning_precision",
|
||||
]
|
||||
|
||||
def __init__(self, conn):
|
||||
|
@ -126,10 +126,12 @@ class GeneralSettingsController(SettingsFormController):
|
||||
),
|
||||
Section(
|
||||
"Display settings",
|
||||
# TODO: custom input for this?
|
||||
NumberInput(
|
||||
"frequency_display_precision",
|
||||
"Frequency display precision",
|
||||
infotext="Number of decimal digits to show on the frequency display",
|
||||
"tuning_precision",
|
||||
"Tuning precision",
|
||||
infotext="Specifies the precision of the frequency tuning display as an exponent of 10, in Hertz. "
|
||||
+ "Setting this to 1 means 10Hz precision, 2 means 100Hz precision, etc.",
|
||||
),
|
||||
),
|
||||
Section(
|
||||
|
Reference in New Issue
Block a user