Solving "empty line in LH" (first throw)
This commit is contained in:
parent
ff19ca888b
commit
2e03c3ae3e
2 changed files with 31 additions and 23 deletions
|
@ -105,7 +105,7 @@
|
||||||
<th>QSO</th>
|
<th>QSO</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tr>
|
<!--<tr>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>-->
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -307,6 +307,7 @@ function getLastHeard(document, event) {
|
||||||
// I: 2020-12-03 20:07:45.973 TX Frequency: 439812500Hz
|
// I: 2020-12-03 20:07:45.973 TX Frequency: 439812500Hz
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
lines = event.data.split("\n");
|
lines = event.data.split("\n");
|
||||||
|
var duration = 0;
|
||||||
lines.forEach(function(line, index, array) {
|
lines.forEach(function(line, index, array) {
|
||||||
logIt(line);
|
logIt(line);
|
||||||
|
|
||||||
|
@ -365,8 +366,11 @@ function getLastHeard(document, event) {
|
||||||
} else {
|
} else {
|
||||||
ts2TXing = null;
|
ts2TXing = null;
|
||||||
}
|
}
|
||||||
|
txing = false;
|
||||||
|
|
||||||
if (line.indexOf("network watchdog") > 0) {
|
if (line.indexOf("network watchdog") > 0) {
|
||||||
logIt("Network Watchdog!");
|
logIt("Network Watchdog!");
|
||||||
|
|
||||||
var rowIndexes = [];
|
var rowIndexes = [];
|
||||||
t_lh.rows( function ( idx, data, node ) {
|
t_lh.rows( function ( idx, data, node ) {
|
||||||
if (getMode(line) == "DMR Slot 1" ) {
|
if (getMode(line) == "DMR Slot 1" ) {
|
||||||
|
@ -380,11 +384,10 @@ function getLastHeard(document, event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var duration = 0;
|
|
||||||
if (getMode(line) == "DMR Slot 1" ) {
|
if (getMode(line) == "DMR Slot 1" ) {
|
||||||
duration = Math.round((Date.now() - Date.parse(ts1timestamp.replace(" ","T")+".000Z"))/1000);
|
duration = Math.round(Date.parse(getRawTimestamp(line).replace(" ","T")+".000Z")/1000 - Date.parse(ts1timestamp.replace(" ","T")+".000Z")/1000);
|
||||||
} else {
|
} else {
|
||||||
duration = Math.round((Date.now() - Date.parse(ts2timestamp.replace(" ","T")+".000Z"))/1000);
|
duration = Math.round(Date.parse(getRawTimestamp(line).replace(" ","T")+".000Z")/1000 - Date.parse(ts2timestamp.replace(" ","T")+".000Z")/1000);
|
||||||
}
|
}
|
||||||
if (rowIndexes[0]) {
|
if (rowIndexes[0]) {
|
||||||
if (t_lh.row(rowIndexes[0]).data[0] != null) {
|
if (t_lh.row(rowIndexes[0]).data[0] != null) {
|
||||||
|
@ -399,29 +402,29 @@ function getLastHeard(document, event) {
|
||||||
"",
|
"",
|
||||||
getAddToQSO(line)
|
getAddToQSO(line)
|
||||||
]
|
]
|
||||||
t_lh.row(rowIndexes[0]).data( newData ).draw(false);
|
$('#lastHeard').dataTable().fnUpdate(newData,t_lh.data().rowIndexes[0],undefined,false);
|
||||||
} else {
|
} else {
|
||||||
logIt("Problem replacing watchdog! Indices: " + rowIndexes);
|
logIt("Problem replacing watchdog! Indices: " + rowIndexes);
|
||||||
t_lh.row(rowIndexes[0]).remove().draw(false);
|
t_lh.row(rowIndexes[0]).remove().draw(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logIt("TS1: " + ts1TXing + "|" + ts1timestamp);
|
logIt("TS1: " + ts1TXing + "|" + ts1timestamp);
|
||||||
logIt("TS2: " + ts2TXing + "|" + ts2timestamp);
|
logIt("TS2: " + ts2TXing + "|" + ts2timestamp);
|
||||||
getCurrentTXing();
|
getCurrentTXing();
|
||||||
|
|
||||||
if (line.indexOf("network watchdog") < 0) {
|
if (line.indexOf("network watchdog") < 0 ) {
|
||||||
var rowIndexes = [],
|
var rowIndexes = [],
|
||||||
timestamp = getTimestamp(line),
|
timestamp = getTimestamp(line),
|
||||||
mode = getMode(line),
|
mode = getMode(line),
|
||||||
callsign = getCallsign(line),
|
callsign = getCallsign(line),
|
||||||
target = getTarget(line),
|
target = getTarget(line),
|
||||||
source = getSource(line),
|
source = getSource(line),
|
||||||
duration = getDuration(line),
|
duration = getDuration(line),
|
||||||
loss = getLoss(line),
|
loss = getLoss(line),
|
||||||
ber = getBER(line),
|
ber = getBER(line),
|
||||||
addToQSO = getAddToQSO(line);
|
addToQSO = getAddToQSO(line);
|
||||||
if (txing) {
|
if (txing) {
|
||||||
duration = "TXing";
|
duration = "TXing";
|
||||||
loss = "";
|
loss = "";
|
||||||
|
@ -456,12 +459,6 @@ function getLastHeard(document, event) {
|
||||||
addToQSO
|
addToQSO
|
||||||
]
|
]
|
||||||
t_lh.row(rowIndexes[0]).data( newData ).draw(false);
|
t_lh.row(rowIndexes[0]).data( newData ).draw(false);
|
||||||
var row = t_lh.row(rowIndexes[0]).node();
|
|
||||||
if (txing) {
|
|
||||||
$(row).addClass('red');
|
|
||||||
} else {
|
|
||||||
$(row).removeClass('red');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
t_lh.row.add( [
|
t_lh.row.add( [
|
||||||
timestamp,
|
timestamp,
|
||||||
|
@ -476,6 +473,17 @@ function getLastHeard(document, event) {
|
||||||
] ).draw(false);
|
] ).draw(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (rowIndexes[0]) {
|
||||||
|
var row = t_lh.row(rowIndexes[0]).node();
|
||||||
|
if (txing) {
|
||||||
|
$(row).addClass('red');
|
||||||
|
} else {
|
||||||
|
$(row).removeClass('red');
|
||||||
|
}
|
||||||
|
var temp = t_lh.row(rowIndexes[0]).data();
|
||||||
|
temp[5] = duration;
|
||||||
|
$('#lastHeard').dataTable().fnUpdate(temp,rowIndexes[0],undefined,false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue