Adding Messages in Queue in DAPNET
This commit is contained in:
parent
c585f45bcd
commit
63ba1aa3f1
4 changed files with 44 additions and 13 deletions
|
@ -133,6 +133,7 @@
|
||||||
<!-- Standard-Panel-Inhalt -->
|
<!-- Standard-Panel-Inhalt -->
|
||||||
<div class="panel-heading">Dapnet-Messages<span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span></div>
|
<div class="panel-heading">Dapnet-Messages<span class="pull-right clickable"><i class="glyphicon glyphicon-chevron-up"></i></span></div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
<div id="messagesinqueue">Messages in Queue: 0</div>
|
||||||
<!-- Tabelle -->
|
<!-- Tabelle -->
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table id="dapnetmessages" class="table dapnetmessages table-condensed table-striped table-hover">
|
<table id="dapnetmessages" class="table dapnetmessages table-condensed table-striped table-hover">
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
var qrz = 1;
|
var qrz = 1;
|
||||||
|
var debug = 0;
|
|
@ -1,7 +1,16 @@
|
||||||
|
var messagecount = 0;
|
||||||
|
|
||||||
// 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333
|
// 00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333
|
||||||
// 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
|
// 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
|
||||||
// M: 2020-11-01 21:33:27.454 YSF, received network data from DG2MAS to DG-ID 0 at DG2MAS
|
// M: 2020-11-01 21:33:27.454 YSF, received network data from DG2MAS to DG-ID 0 at DG2MAS
|
||||||
// M: 2020-11-01 21:33:35.025 YSF, received network end of transmission from DG2MAS to DG-ID 0, 7.7 seconds, 0% packet loss, BER: 0.0%
|
// M: 2020-11-01 21:33:35.025 YSF, received network end of transmission from DG2MAS to DG-ID 0, 7.7 seconds, 0% packet loss, BER: 0.0%
|
||||||
|
|
||||||
|
function logIt(message) {
|
||||||
|
if (debug == 1) {
|
||||||
|
console.log(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getTimestamp(logline) {
|
function getTimestamp(logline) {
|
||||||
return logline.substring(3,22);
|
return logline.substring(3,22);
|
||||||
}
|
}
|
||||||
|
@ -82,7 +91,7 @@ function getAddToQSO(logline) {
|
||||||
// M: 2020-11-03 19:36:00.124 Sending message in slot 13 to 0002504, type 5, func Numeric: "193600 031120"
|
// M: 2020-11-03 19:36:00.124 Sending message in slot 13 to 0002504, type 5, func Numeric: "193600 031120"
|
||||||
// M: 2020-11-03 19:36:00.165 Sending message in slot 13 to 0000200, type 6, func Alphanumeric: "XTIME=1936031120XTIME=1936031120"
|
// M: 2020-11-03 19:36:00.165 Sending message in slot 13 to 0000200, type 6, func Alphanumeric: "XTIME=1936031120XTIME=1936031120"
|
||||||
// M: 2020-11-03 19:36:00.216 Sending message in slot 13 to 0000216, type 6, func Alphanumeric: "YYYYMMDDHHMMSS201103193600"
|
// M: 2020-11-03 19:36:00.216 Sending message in slot 13 to 0000216, type 6, func Alphanumeric: "YYYYMMDDHHMMSS201103193600"
|
||||||
|
// D: 2020-11-06 18:35:00.343 Messages in Queue 0001
|
||||||
function getSlot(logline) {
|
function getSlot(logline) {
|
||||||
return logline.substring(logline.indexOf("slot") + 5, logline.indexOf("to ")).trim();
|
return logline.substring(logline.indexOf("slot") + 5, logline.indexOf("to ")).trim();
|
||||||
}
|
}
|
||||||
|
@ -106,6 +115,11 @@ function getMessage(logline) {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getMessagesInQueue(line) {
|
||||||
|
messagecount = parseInt(line.substring(45));
|
||||||
|
logIt("messagecount: " + messagecount);
|
||||||
|
}
|
||||||
|
|
||||||
function ord(str) {
|
function ord(str) {
|
||||||
return str.charCodeAt(0);
|
return str.charCodeAt(0);
|
||||||
}
|
}
|
||||||
|
@ -175,9 +189,9 @@ function getLastHeard(document, event) {
|
||||||
// M: 2020-11-01 21:33:35.025 YSF, received network end of transmission from DG2MAS to DG-ID 0, 7.7 seconds, 0% packet loss, BER: 0.0%
|
// M: 2020-11-01 21:33:35.025 YSF, received network end of transmission from DG2MAS to DG-ID 0, 7.7 seconds, 0% packet loss, BER: 0.0%
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
lines = event.data.split("\n");
|
lines = event.data.split("\n");
|
||||||
for (i = 0; i < lines.length; i++) {
|
lines.forEach(function(line, index, array) {
|
||||||
var line = lines[i];
|
logIt(line);
|
||||||
if (line.indexOf("Talker Alias") < 0 && line.indexOf("Downlink Activate") < 0 && line.indexOf("network watchdog") < 0 && line.indexOf("Preamble CSBK") < 0 && line.indexOf("Data Header") < 0 && line.indexOf("0000:") < 0&& line.length > 0) {
|
if (line.indexOf("Talker Alias") < 0 && line.indexOf("Downlink Activate") < 0 && line.indexOf("network watchdog") < 0 && line.indexOf("Preamble CSBK") < 0 && line.indexOf("data header") < 0 && line.indexOf("0000:") < 0 && line.length > 0 && line.indexOf("received") > 0 ) {
|
||||||
var rowIndexes = [],
|
var rowIndexes = [],
|
||||||
timestamp = getTimestamp(line),
|
timestamp = getTimestamp(line),
|
||||||
mode = getMode(line),
|
mode = getMode(line),
|
||||||
|
@ -231,7 +245,7 @@ function getLastHeard(document, event) {
|
||||||
] ).draw();
|
] ).draw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,10 +272,11 @@ function getLocalHeard(document, event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDapnetMessages(document, event) {
|
function getDapnetMessages(document, event) {
|
||||||
lines = event.data.split("\n");
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
for (i = 0; i < lines.length; i++) {
|
lines = event.data.split("\n");
|
||||||
var line = lines[i];
|
logIt("lines.length: " + lines.length);
|
||||||
|
lines.forEach(function(line, index, array) {
|
||||||
|
logIt(line);
|
||||||
if (line.indexOf("Sending") > 0 ) {
|
if (line.indexOf("Sending") > 0 ) {
|
||||||
t_dapnet.row.add( [
|
t_dapnet.row.add( [
|
||||||
getTimestamp(line),
|
getTimestamp(line),
|
||||||
|
@ -269,7 +284,23 @@ function getDapnetMessages(document, event) {
|
||||||
getRIC(line),
|
getRIC(line),
|
||||||
getMessage(line)
|
getMessage(line)
|
||||||
] ).draw();
|
] ).draw();
|
||||||
|
messagecount--;
|
||||||
|
if (messagecount < 0 ) {
|
||||||
|
messagecount = 0;
|
||||||
|
}
|
||||||
|
document.getElementById('messagesinqueue').innerHTML = "Messages in Queue: " + messagecount;
|
||||||
}
|
}
|
||||||
}
|
if (line.indexOf("Messages in Queue") > 0 ) {
|
||||||
|
getMessagesInQueue(line);
|
||||||
|
document.getElementById('messagesinqueue').innerHTML = "Messages in Queue: " + messagecount;
|
||||||
|
}
|
||||||
|
if (line.indexOf("Rejecting") > 0 ) {
|
||||||
|
messagecount--;
|
||||||
|
if (messagecount < 0 ) {
|
||||||
|
messagecount = 0;
|
||||||
|
document.getElementById('messagesinqueue').innerHTML = "Messages in Queue: " + messagecount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,15 +62,13 @@ def view_log(websocket, path):
|
||||||
content = conv.convert(content, full=False)
|
content = conv.convert(content, full=False)
|
||||||
lines = content.split("\n")
|
lines = content.split("\n")
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.find('received') >0 or line.find('Sending') > 0:
|
yield from websocket.send(line)
|
||||||
yield from websocket.send(line)
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
if content:
|
if content:
|
||||||
content = conv.convert(content, full=False)
|
content = conv.convert(content, full=False)
|
||||||
if content.find('received') >0 or content.find('Sending') > 0:
|
yield from websocket.send(content)
|
||||||
yield from websocket.send(content)
|
|
||||||
else:
|
else:
|
||||||
yield from asyncio.sleep(1)
|
yield from asyncio.sleep(1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue