From 98c5e9e15baaa7e5fbb93ebb377cafc2a5ebeed2 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 28 Jul 2019 13:29:45 +0200 Subject: [PATCH] allow service configuration --- config_webrx.py | 3 +++ owrx/service.py | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config_webrx.py b/config_webrx.py index 15569de..044dc85 100644 --- a/config_webrx.py +++ b/config_webrx.py @@ -251,3 +251,6 @@ google_maps_api_key = "" map_position_retention_time = 2 * 60 * 60 temporary_directory = "/tmp" + +services_enabled = True +services_decoders = ["ft8", "ft4", "wspr"] diff --git a/owrx/service.py b/owrx/service.py index 577d29a..b6c2731 100644 --- a/owrx/service.py +++ b/owrx/service.py @@ -3,6 +3,7 @@ from owrx.source import SdrService from owrx.bands import Bandplan from csdr import dsp, output from owrx.wsjt import WsjtParser +from owrx.config import PropertyManager import logging @@ -41,7 +42,7 @@ class ServiceHandler(object): def isSupported(self, mode): # TODO make configurable - return mode in ["ft8", "ft4", "wspr"] + return mode in PropertyManager.getSharedInstance()["services_decoders"] def stopServices(self): for service in self.services: @@ -93,6 +94,8 @@ class ServiceManager(object): return ServiceManager.sharedInstance def start(self): + if not PropertyManager.getSharedInstance()["services_enabled"]: + return for source in SdrService.getSources().values(): ServiceHandler(source)