RDS works inside WFM now.

This commit is contained in:
Marat Fayzullin 2024-01-30 21:47:22 -05:00
parent d9e294a378
commit 326c099482
8 changed files with 16 additions and 20 deletions

View File

@ -194,12 +194,12 @@ class AcarsDemodulator(ServiceDemodulator, DialFrequencyReceiver):
class RdsDemodulator(ServiceDemodulator, DialFrequencyReceiver):
def __init__(self):
pm = Config.get()
self.usa = pm["rds_usa"]
self.rbds = pm["wfm_rds_rbds"]
self.sampleRate = 171000
self.parser = RdsParser()
workers = [
Convert(Format.FLOAT, Format.SHORT),
RedseaModule(self.sampleRate, usa=self.usa),
RedseaModule(self.sampleRate, usa=self.rbds),
self.parser,
]
# Connect all the workers

View File

@ -164,7 +164,7 @@ class JsonParser(LineBasedModule):
try:
msg = json.loads(line)
msg["mode"] = self.mode
logger.debug(msg)
# logger.debug(msg)
return msg
except json.JSONDecodeError:
logger.exception("error parsing decoder json")

View File

@ -151,9 +151,9 @@ class AcarsDecModule(WavFileModule):
class RedseaModule(WavFileModule):
def __init__(self, sampleRate: int = 171000, usa: bool = False):
def __init__(self, sampleRate: int = 171000, rbds: bool = False):
self.sampleRate = sampleRate
self.usa = usa
self.rbds = rbds
super().__init__()
def getCommand(self):
@ -161,7 +161,7 @@ class RedseaModule(WavFileModule):
"redsea", "--file", "/dev/stdin", "--input", "mpx",
"--samplerate", str(self.sampleRate)
]
if self.usa:
if self.rbds:
cmd += ["--rbds"]
return cmd

View File

@ -1721,24 +1721,24 @@ img.openwebrx-mirror-img
}
.rds-container .rds-radiotext-plus .rds-rtplus-item:not(:empty):before {
content: "♫ ";
content: "\266B ";
}
.rds-container .rds-radiotext-plus .rds-rtplus-programme:not(:empty):before {
content: "📅 ";
content: "\1F4C5 ";
}
.rds-container .rds-radiotext-plus ul.rds-rtplus-news {
list-style-type: "📰 ";
list-style-type: "\1F4F0 ";
padding-left: 1.5lh;
}
.rds-container .rds-radiotext-plus .rds-rtplus-weather:not(:empty):before {
content: "⛅ ";
content: "\26C5 ";
}
.rds-container .rds-radiotext-plus .rds-rtplus-homepage:not(:empty):before {
content: "🔗 ";
content: "\1F517 ";
}
#openwebrx-panel-metadata-dab {

View File

@ -471,7 +471,6 @@ WfmMetaPanel.prototype.update = function(data) {
if ('info.weather' in tags) {
this.radiotext_plus.weather = tags['info.weather'];
}
}
if ('radiotext' in data && !this.radiotext_plus) {
@ -580,7 +579,6 @@ DabMetaPanel.prototype.isSupported = function(data) {
return this.modes.includes(data.mode);
}
DabMetaPanel.prototype.update = function(data) {
if (!this.isSupported(data)) return;
@ -645,4 +643,4 @@ $.fn.metaPanel = function() {
}
return $self.data('metapanel');
});
};
};

View File

@ -1134,6 +1134,9 @@ function on_ws_recv(evt) {
break;
case "features":
Modes.setFeatures(json['value']);
$('#openwebrx-panel-metadata-wfm').metaPanel().each(function() {
this.setEnabled(!!json.value.rds);
});
break;
case "metadata":
$('.openwebrx-meta-panel').metaPanel().each(function(){

View File

@ -210,6 +210,5 @@ defaultConfig = PropertyLayer(
fax_postprocess=True,
fax_color=False,
fax_am=False,
rds_usa=False,
cw_showcw=False
).readonly()

View File

@ -41,11 +41,7 @@ class DecodingSettingsController(SettingsFormController):
),
CheckboxInput(
"wfm_rds_rbds",
"Enable RBDS decoding (US RDS standard)",
),
CheckboxInput(
"rds_usa",
"Decode USA-specific RDS information from WFM broadcasts",
"Decode USA-specific RBDS information from WFM broadcasts",
),
CheckboxInput(
"paging_filter",