From f590af1041e1aa6351a3d962d23679ffbfe06094 Mon Sep 17 00:00:00 2001 From: Marat Fayzullin Date: Fri, 1 Mar 2024 18:53:37 -0500 Subject: [PATCH] Adding ability to show undecoded DSC messages --- htdocs/css/openwebrx.css | 4 ++-- htdocs/lib/MessagePanel.js | 11 ++++++----- owrx/dsc.py | 3 ++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/css/openwebrx.css b/htdocs/css/openwebrx.css index 715f91d5..e80744f9 100644 --- a/htdocs/css/openwebrx.css +++ b/htdocs/css/openwebrx.css @@ -1373,7 +1373,7 @@ img.openwebrx-mirror-img } #openwebrx-panel-dsc-message .timestamp { - width: 60px; + width: 70px; text-align: center; } @@ -1388,7 +1388,7 @@ img.openwebrx-mirror-img } #openwebrx-panel-dsc-message .data { - width: 326px; + width: 316px; text-align: center; } diff --git a/htdocs/lib/MessagePanel.js b/htdocs/lib/MessagePanel.js index e547ff69..7082ccf6 100644 --- a/htdocs/lib/MessagePanel.js +++ b/htdocs/lib/MessagePanel.js @@ -418,7 +418,7 @@ HfdlMessagePanel.prototype.pushMessage = function(msg) { if (msg.message) { $b.append($( '' + Utils.htmlEscape(msg.message) + '' - )) + )); } // Jump list to the last received message @@ -571,8 +571,8 @@ DscMessagePanel.prototype.pushMessage = function(msg) { var pad = function (i) { return ('' + i).padStart(2, "0") }; var bcolor = msg.color? msg.color : '#000'; var fcolor = msg.color? '#000' : '#FFF'; - var src = msg.src? Utils.linkifyVessel(msg.src) : '*'; - var dst = msg.dst? Utils.linkifyVessel(msg.dst) : '*'; + var src = msg.src? Utils.linkifyVessel(msg.src) : ''; + var dst = msg.dst? Utils.linkifyVessel(msg.dst) : ''; var data = ( (msg.category? ' ' + msg.category : '') + (msg.format? ' ' + msg.format : '') @@ -595,6 +595,7 @@ DscMessagePanel.prototype.pushMessage = function(msg) { + (msg.num? ' DIAL ' + msg.num : '') + (msg.rxfreq? ' RX ' + msg.rxfreq : '') + (msg.txfreq? ' TX ' + msg.txfreq : '') + + (msg.data? ' ' + msg.data + ' …' : '') ).trim(); // Append report @@ -611,8 +612,8 @@ DscMessagePanel.prototype.pushMessage = function(msg) { // Append messsage if present if (message) { $b.append($( - '' + Utils.htmlEscape(msg.message) + '' - )) + '' + Utils.htmlEscape(message) + '' + )); } // Jump list to the last received message diff --git a/owrx/dsc.py b/owrx/dsc.py index 36b68715..150f4d53 100644 --- a/owrx/dsc.py +++ b/owrx/dsc.py @@ -22,6 +22,7 @@ class DscParser(TextParser): out = json.loads(msg) # Add mode name and a color to identify the sender out["mode"] = "DSC" - out["color"] = self.colors.getColor(out["src"]) + if "src" in out: + out["color"] = self.colors.getColor(out["src"]) logger.debug("{0}".format(out)) return out