diff --git a/csdr/chain/toolbox.py b/csdr/chain/toolbox.py index 0ad1009c..a34e950d 100644 --- a/csdr/chain/toolbox.py +++ b/csdr/chain/toolbox.py @@ -4,6 +4,7 @@ from pycsdr.modules import FmDemod, AudioResampler, Convert, Agc, Squelch from pycsdr.types import Format from owrx.toolbox import TextParser, PageParser, SelCallParser, IsmParser, RdsParser from owrx.aircraft import HfdlParser, Vdl2Parser, AdsbParser, AcarsParser +from owrx.config import Config import os @@ -192,11 +193,13 @@ class AcarsDemodulator(ServiceDemodulator, DialFrequencyReceiver): class RdsDemodulator(ServiceDemodulator, DialFrequencyReceiver): def __init__(self): + pm = Config.get() + self.usa = pm["rds_usa"] self.sampleRate = 171000 self.parser = RdsParser() workers = [ Convert(Format.FLOAT, Format.SHORT), - RedseaModule(self.sampleRate), + RedseaModule(self.sampleRate, usa=self.usa), self.parser, ] # Connect all the workers diff --git a/csdr/module/toolbox.py b/csdr/module/toolbox.py index 646d9872..c5eb3e0c 100644 --- a/csdr/module/toolbox.py +++ b/csdr/module/toolbox.py @@ -151,15 +151,19 @@ class AcarsDecModule(WavFileModule): class RedseaModule(WavFileModule): - def __init__(self, sampleRate: int = 171000): + def __init__(self, sampleRate: int = 171000, usa: bool = False): self.sampleRate = sampleRate + self.usa = usa super().__init__() def getCommand(self): - return [ + cmd = [ "redsea", "--file", "/dev/stdin", "--input", "mpx", - "--samplerate", str(self.sampleRate), "--rbds" + "--samplerate", str(self.sampleRate) ] + if self.usa: + cmd += ["--rbds"] + return cmd def getOutputFormat(self) -> Format: return Format.CHAR diff --git a/owrx/config/defaults.py b/owrx/config/defaults.py index e869ce45..87342786 100644 --- a/owrx/config/defaults.py +++ b/owrx/config/defaults.py @@ -207,5 +207,6 @@ defaultConfig = PropertyLayer( acars_ttl=1800, fax_postprocess=True, fax_color=False, - fax_am=False + fax_am=False, + rds_usa=False ).readonly() diff --git a/owrx/controllers/settings/decoding.py b/owrx/controllers/settings/decoding.py index 98e5424d..6a43b59d 100644 --- a/owrx/controllers/settings/decoding.py +++ b/owrx/controllers/settings/decoding.py @@ -33,6 +33,10 @@ class DecodingSettingsController(SettingsFormController): infotext='See this Wikipedia article for more information', ), + CheckboxInput( + "rds_usa", + "Decode USA-specific RDS information from WFM broadcasts", + ), ), Section( "Digital voice",