From 90200a2718887f8705313d202cec04acb78a3b9e Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Mon, 26 Apr 2021 14:58:26 +0100 Subject: [PATCH] Added origin of YSF-transmission to Target (if possible). --- html/js/config.js | 2 +- html/js/functions.js | 76 +++++++++++++++++++++++++++++--------------- html/js/version.js | 2 +- 3 files changed, 52 insertions(+), 28 deletions(-) diff --git a/html/js/config.js b/html/js/config.js index 24780a6..b8429c8 100644 --- a/html/js/config.js +++ b/html/js/config.js @@ -42,4 +42,4 @@ var dashboard_blacklist = [ ] // 1 = enable dark display theme, 0 = use bright theme -var useDarkTheme = 1; \ No newline at end of file +var useDarkTheme = 1; diff --git a/html/js/functions.js b/html/js/functions.js index e2fb8ed..b439563 100644 --- a/html/js/functions.js +++ b/html/js/functions.js @@ -273,9 +273,17 @@ function getTarget(logline) { return '
' + link + 'Origin:
' + target + '
'; } } else { - return '
' + resolveTarget(getMode(logline), getTimeslot(getMode(logline)), target) + 'Origin:
' + target + '
'; + retval = '
' + resolveTarget(getMode(logline), getTimeslot(getMode(logline)), target) + 'Origin:
' + target + '
'; + if (getMode(logline) == "YSF" && logline.indexOf(" at ") > 0) { + via = logline.substr(logline.indexOf(" at ")); + if (via.indexOf("$") > 0) { + via = via.substr(0, via.indexOf("$")); + } + retval += " @ " + via; + } + return retval; } -} +} function getSource(logline) { if (logline.indexOf("received") > 0) { @@ -633,16 +641,9 @@ function getLastHeard(document, event) { } } if (line.indexOf("network watchdog") > 0 || line.indexOf("end of voice transmission") > 0 || line.indexOf("end of transmission") > 0 || line.indexOf("transmission lost") > 0 ) { - if (getMode(line) == "DMR Slot 1" ) { - ts1TXing = null; - } else { - ts2TXing = null; - } txing = false; - if (line.indexOf("network watchdog") > 0) { logIt("Network Watchdog!"); - var rowIndexes = []; t_lh.rows( function ( idx, data, node ) { if (getMode(line) == "DMR Slot 1" ) { @@ -689,17 +690,23 @@ function getLastHeard(document, event) { } } } + } logIt("TS1: " + ts1TXing + "|" + ts1timestamp); logIt("TS2: " + ts2TXing + "|" + ts2timestamp); getCurrentTXing(); - if (line.indexOf("network watchdog") < 0 ) { + ts2tmp = []; + if (ts2TXing != null) { + matchstring = ""; + ts2tmp = ts2TXing.split(";"); + } + var rowIndexes = [], timestamp = getTimestamp(line), mode = getMode(line), callsign = getCallsign(line), - target = getTarget(line), + target = ts2tmp[2], source = getSource(line), duration = getDuration(line), loss = getLoss(line), @@ -709,6 +716,12 @@ function getLastHeard(document, event) { duration = "TXing"; loss = ""; ber = ""; + } else { + if (getMode(line) == "DMR Slot 1" ) { + ts1TXing = null; + } else { + ts2TXing = null; + } } if (mode == "POCSAG") { callsign = "POCSAG"; @@ -725,23 +738,35 @@ function getLastHeard(document, event) { } return false; }); - if (rowIndexes[0] == "0") { t_lh.row(rowIndexes[0]).remove().draw(false); } if (rowIndexes[0]) { - - newData = [ - timestamp, - mode, - callsign, - target, - source, - duration, - loss, - ber, - addToQSO - ] + if (t_lh.row(rowIndexes[0]).data[0] != null) { + newData = [ + timestamp, + mode, + callsign, + target, + source, + duration, + loss, + ber, + addToQSO + ] + } else { + newData = [ + timestamp, + mode, + callsign, + target, + source, + duration, + loss, + ber, + addToQSO + ] + } t_lh.row(rowIndexes[0]).data( newData ).draw(false); } else { t_lh.row.add( [ @@ -770,7 +795,6 @@ function getLastHeard(document, event) { } function getLocalHeard(document, event) { - $(document).ready(function() { lines = event.data.split("\n"); lines.forEach(function(line, index, array) { @@ -1028,4 +1052,4 @@ function processData(data) { talkgroups.push([rowCells[0], rowCells[1], rowCells[2], rowCells[3], rowCells[4]]); } logIt("Parsed TGs: " + talkgroups); -} \ No newline at end of file +} diff --git a/html/js/version.js b/html/js/version.js index e15a8b4..1c7027b 100644 --- a/html/js/version.js +++ b/html/js/version.js @@ -1 +1 @@ -var dashboard_version = "2021-04-25 18:56:19"; +var dashboard_version = "2021-04-26 14:58:26";