1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

web: do not filter incoming websocket messages on id

This commit is contained in:
Steffen Vogel 2018-05-07 18:31:50 +02:00
parent c99c95a558
commit 71d1323e9b
2 changed files with 1 additions and 7 deletions

View file

@ -117,7 +117,6 @@ function sendData()
var msg = new Msg({
timestamp : Date.now(),
sequence : sequence++,
id : currentNode.id,
data : data
});
@ -287,10 +286,7 @@ function wsConnect(node)
for (var j = 0; j < msgs.length; j++) {
var msg = msgs[j];
console.log('Received message with ' + msg.data.length + ' values from id ' + msg.id + ' with timestamp ' + new Date(msg.timestamp).toString());
if (msg.id !== currentNode.id)
continue;
console.log('Received message with ' + msg.data.length + ' values from id ' + msg.id + ' with timestamp ' + new Date(msg.timestamp).toString() + ': '+ msg.data);
// add empty arrays for data series
while (plotData.length < msg.length)

View file

@ -37,7 +37,6 @@ function Msg(c)
this.length = typeof c.length === 'undefined' ? 0 : c.length;
this.version = typeof c.version === 'undefined' ? Msg.prototype.VERSION : c.version;
this.type = typeof c.type === 'undefined' ? Msg.prototype.TYPE_DATA : c.type;
this.id = typeof c.id === 'undefined' ? -1 : c.id;
this.timestamp = typeof c.timestamp === 'undefined' ? Date.now() : c.timestamp;
if (Array.isArray(c.data)) {
@ -113,7 +112,6 @@ Msg.prototype.toArrayBuffer = function()
var nsec = (this.timestamp - sec * 1e3) * 1e6;
view.setUint8( 0x00, bits, true);
view.setUint8( 0x01, this.id, true);
view.setUint16(0x02, this.length, true);
view.setUint32(0x04, this.sequence, true);
view.setUint32(0x08, sec, true);