Putting YSF also to resolving of Talkgroups...
Working on DG-IDs, add lines like: YSF,0,40,DL Multimode 263 So only makes sense, if you are using DGIdGateway or (modified) versions of YSFGateway (for using YCS).
This commit is contained in:
parent
37580baaae
commit
e6f2368322
3 changed files with 38 additions and 18 deletions
|
@ -1,4 +1,10 @@
|
||||||
TS,TG,LABEL
|
MODE,TS,TG,LABEL
|
||||||
1,263,DL Multimode BM
|
DMR,1,263,DL Multimode BM
|
||||||
2,8021,Pegasus DMR-DL
|
DMR,2,8021,Pegasus DMR-DL
|
||||||
2,2625,RLP/SL BM
|
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
|
||||||
|
|
||||||
|
|
|
|
@ -131,12 +131,26 @@ function getRawTarget(logline) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveTarget(timeslot, target) {
|
function resolveTarget(mode, timeslot, target) {
|
||||||
|
if (mode.startsWith("DMR")) {
|
||||||
|
mode = "DMR";
|
||||||
|
}
|
||||||
|
|
||||||
retval = null;
|
retval = null;
|
||||||
tmpval = talkgroups.filter(function (tg) { return tg[0] == timeslot});
|
tmpval = talkgroups.filter(function (tg) { return tg[0] == mode});
|
||||||
retval = tmpval.filter(function (tg) { return tg[1] == target.substring(3, target.length)});
|
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) {
|
if (retval.length > 0) {
|
||||||
return retval[0][2];
|
return retval[0][3];
|
||||||
} else {
|
} else {
|
||||||
return target;
|
return target;
|
||||||
}
|
}
|
||||||
|
@ -180,20 +194,20 @@ function getTarget(logline) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (getMode(logline).startsWith("DMR")) {
|
//if (getMode(logline).startsWith("DMR")) {
|
||||||
link = '<a href="' + bmlink + linkTarget + '" target="_new">' + resolveTarget(getTimeslot(getMode(logline)), target) + '</a>';
|
link = '<a href="' + bmlink + linkTarget + '" target="_new">' + resolveTarget(getMode(logline), getTimeslot(getMode(logline)), target) + '</a>';
|
||||||
return link;
|
return link;
|
||||||
} else {
|
/*} else {
|
||||||
link = '<a href="' + bmlink + linkTarget + '" target="_new">' + target + '</a>';
|
link = '<a href="' + bmlink + linkTarget + '" target="_new">' + target + '</a>';
|
||||||
return link;
|
return link;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (getMode(logline).startsWith("DMR")) {
|
//if (getMode(logline).startsWith("DMR")) {
|
||||||
return resolveTarget(getTimeslot(getMode(logline)), target);
|
return resolveTarget(getMode(logline), getTimeslot(getMode(logline)), target);
|
||||||
} else {
|
/*} else {
|
||||||
return target;
|
return target;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -861,7 +875,7 @@ function processData(data) {
|
||||||
var allRows = data.split(/\r?\n|\r/);
|
var allRows = data.split(/\r?\n|\r/);
|
||||||
for (var singleRow = 1; singleRow < allRows.length; singleRow++) {
|
for (var singleRow = 1; singleRow < allRows.length; singleRow++) {
|
||||||
var rowCells = allRows[singleRow].split(',');
|
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);
|
logIt("Parsed TGs: " + talkgroups);
|
||||||
}
|
}
|
|
@ -1 +1 @@
|
||||||
var dashboard_version = "2021-02-16 20:44:20";
|
var dashboard_version = "2021-02-17 20:58:46";
|
||||||
|
|
Loading…
Reference in a new issue