restructure config
This commit is contained in:
@ -2,7 +2,7 @@ from owrx.property import PropertyLayer
|
||||
|
||||
|
||||
defaultConfig = PropertyLayer(
|
||||
version=6,
|
||||
version=7,
|
||||
max_clients=20,
|
||||
receiver_name="[Callsign]",
|
||||
receiver_location="Budapest, Hungary",
|
||||
@ -142,7 +142,8 @@ defaultConfig = PropertyLayer(
|
||||
),
|
||||
waterfall_scheme="GoogleTurboWaterfall",
|
||||
waterfall_levels=PropertyLayer(min=-88, max=-20),
|
||||
waterfall_auto_level_margin=PropertyLayer(min=3, max=10, min_range=50),
|
||||
waterfall_auto_levels=PropertyLayer(min=3, max=10),
|
||||
waterfall_auto_min_range=50,
|
||||
tuning_precision=2,
|
||||
squelch_auto_margin=10,
|
||||
nmux_memory=50,
|
||||
|
@ -1,4 +1,5 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from owrx.property import PropertyLayer
|
||||
|
||||
import logging
|
||||
|
||||
@ -98,14 +99,27 @@ class ConfigMigratorVersion5(ConfigMigrator):
|
||||
config["version"] = 6
|
||||
|
||||
|
||||
class ConfigMigratorVersion6(ConfigMigrator):
|
||||
def migrate(self, config):
|
||||
if "waterfall_auto_level_margin" in config:
|
||||
walm_config = config["waterfall_auto_level_margin"]
|
||||
if "min_range" in walm_config:
|
||||
config["waterfall_auto_min_range"] = walm_config["min_range"]
|
||||
wal = {k: v for k, v in walm_config.items() if k in ["min", "max"]}
|
||||
config["waterfall_auto_levels"] = PropertyLayer(**wal)
|
||||
del config["waterfall_auto_level_margin"]
|
||||
config["version"] = 7
|
||||
|
||||
|
||||
class Migrator(object):
|
||||
currentVersion = 6
|
||||
currentVersion = 7
|
||||
migrators = {
|
||||
1: ConfigMigratorVersion1(),
|
||||
2: ConfigMigratorVersion2(),
|
||||
3: ConfigMigratorVersion3(),
|
||||
4: ConfigMigratorVersion4(),
|
||||
5: ConfigMigratorVersion5(),
|
||||
6: ConfigMigratorVersion6(),
|
||||
}
|
||||
|
||||
@staticmethod
|
||||
|
@ -127,7 +127,8 @@ class OpenWebRxReceiverClient(OpenWebRxClient, SdrSourceEventClient):
|
||||
global_config_keys = [
|
||||
"waterfall_scheme",
|
||||
"waterfall_colors",
|
||||
"waterfall_auto_level_margin",
|
||||
"waterfall_auto_levels",
|
||||
"waterfall_auto_min_range",
|
||||
"fft_size",
|
||||
"audio_compression",
|
||||
"fft_compression",
|
||||
|
Reference in New Issue
Block a user