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: use signal names from new signal definitions

This commit is contained in:
Steffen Vogel 2018-09-17 22:18:39 +02:00
parent 4223241ac9
commit 8ea70b541f
2 changed files with 45 additions and 34 deletions

View file

@ -33,42 +33,51 @@ nodes = {
signal = "mixed",
values = 5,
rate = 20,
hooks = (
{ type = "stats" }
)
},
stats = {
type = "stats",
node = "sig",
rate = 10,
in = {
hooks = (
{ type = "stats" }
)
}
},
ws_sig = {
type = "websocket",
description = "Demo Channel",
series = (
{ label = "Random walk", unit = "V" },
{ label = "Sine", unit = "A" },
{ label = "Rect", unit = "Var"},
{ label = "Ramp", unit = "°C" }
),
hooks = (
{ type = "stats" }
)
out = {
signals = (
{ name = "Random walk", unit = "V", type = "float" },
{ name = "Sine", unit = "A", type = "float" },
{ name = "Rect", unit = "Var", type = "float" },
{ name = "Ramp", unit = "°C", type = "float" }
),
}
in = {
signals = ( )
hooks = (
{ type = "stats" },
{ type = "print" }
)
}
},
ws_stats = {
ws_lo = {
type = "websocket",
description = "Statistics",
series = (
#{ label = "owd.total" }
{ label = "owd.last" },
{ label = "owd.highest" },
{ label = "owd.lowest" },
{ label = "owd.mean" },
{ label = "owd.variance", yaxis = 2 }
)
hooks = (
{ type = "stats" }
)
description = "Loopback",
out = {
signals = (
{ name = "slider", type = "float" },
{ name = "buttons", type = "float" }
),
}
in = {
signals = (
{ name = "slider", type = "float" },
{ name = "buttons", type = "float" }
)
hooks = (
{ type = "stats" },
{ type = "print" }
)
}
}
};
@ -80,7 +89,7 @@ paths = (
out = "ws_sig"
},
{
in = "stats.data[31-35]", # OWD
out = "ws_stats"
in = "ws_lo",
out = "ws_lo"
}
);

View file

@ -202,8 +202,10 @@ function updatePlot()
}
}
if (currentNode.series !== undefined && currentNode.series[i] !== undefined)
$.extend(true, data[i], currentNode.series[i]);
if (currentNode.out.signals !== undefined && currentNode.out.signals[i] !== undefined)
$.extend(true, data[i], {
label : currentNode.out.signals[i].name
});
}
var options = {