diff --git a/html/data/TG_List.csv b/html/data/TG_List.csv index a5ffa6d..7e20b96 100644 --- a/html/data/TG_List.csv +++ b/html/data/TG_List.csv @@ -1,4 +1,10 @@ -TS,TG,LABEL -1,263,DL Multimode BM -2,8021,Pegasus DMR-DL -2,2625,RLP/SL BM +MODE,TS,TG,LABEL +DMR,1,263,DL Multimode BM +DMR,2,8021,Pegasus DMR-DL +DMR,2,2625,RLP/SL BM +YSF,0,40,DL Multimode 263 +YSF,0,41,DL-RAMSES +YSF,0,42,DL-RAMSES-II +YSF,0,43,DL-RAMSES-III +YSF,0,44,DL-PEGASUS + diff --git a/html/js/functions.js b/html/js/functions.js index f41fd1b..07f9bfe 100644 --- a/html/js/functions.js +++ b/html/js/functions.js @@ -131,12 +131,26 @@ function getRawTarget(logline) { } } -function resolveTarget(timeslot, target) { +function resolveTarget(mode, timeslot, target) { + if (mode.startsWith("DMR")) { + mode = "DMR"; + } + retval = null; - tmpval = talkgroups.filter(function (tg) { return tg[0] == timeslot}); - retval = tmpval.filter(function (tg) { return tg[1] == target.substring(3, target.length)}); + tmpval = talkgroups.filter(function (tg) { return tg[0] == mode}); + switch (mode) { + case "DMR": + tmpval = talkgroups.filter(function (tg) { return tg[1] == timeslot}); + retval = tmpval.filter(function (tg) { return tg[2] == target.substring(3, target.length).trim()}); + break; + case "YSF": + retval = tmpval.filter(function (tg) { return tg[2] == target.substring(6, target.length).trim()}); + break; + default: + break; + } if (retval.length > 0) { - return retval[0][2]; + return retval[0][3]; } else { return target; } @@ -180,20 +194,20 @@ function getTarget(logline) { } } } else { - if (getMode(logline).startsWith("DMR")) { - link = '' + resolveTarget(getTimeslot(getMode(logline)), target) + ''; + //if (getMode(logline).startsWith("DMR")) { + link = '' + resolveTarget(getMode(logline), getTimeslot(getMode(logline)), target) + ''; return link; - } else { + /*} else { link = '' + target + ''; return link; - } + }*/ } } else { - if (getMode(logline).startsWith("DMR")) { - return resolveTarget(getTimeslot(getMode(logline)), target); - } else { + //if (getMode(logline).startsWith("DMR")) { + return resolveTarget(getMode(logline), getTimeslot(getMode(logline)), target); + /*} else { return target; - } + }*/ } } @@ -861,7 +875,7 @@ function processData(data) { var allRows = data.split(/\r?\n|\r/); for (var singleRow = 1; singleRow < allRows.length; singleRow++) { var rowCells = allRows[singleRow].split(','); - talkgroups.push([rowCells[0], rowCells[1], rowCells[2]]); + talkgroups.push([rowCells[0], rowCells[1], rowCells[2], rowCells[3]]); } logIt("Parsed TGs: " + talkgroups); } \ No newline at end of file diff --git a/html/js/version.js b/html/js/version.js index 0e8e86a..604705c 100644 --- a/html/js/version.js +++ b/html/js/version.js @@ -1 +1 @@ -var dashboard_version = "2021-02-16 20:44:20"; +var dashboard_version = "2021-02-17 20:58:46";