From 5252d07e9ee587c5ca99741576aec9b068655ebb Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 8 Jul 2017 14:57:52 +0200 Subject: [PATCH] use new signal node-type to simplify demo setup --- docker-compose.yml | 17 +--------- etc/node/websocket-demo.conf | 60 ++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 16 deletions(-) create mode 100644 etc/node/websocket-demo.conf diff --git a/docker-compose.yml b/docker-compose.yml index 3cf77bf..58f4b4e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -61,22 +61,7 @@ services: node: image: villas/node:latest privileged: true - command: node /etc/villas/node/websocket.conf - expose: - - "12000/udp" - ports: - - "8081:80/tcp" - volumes: - - "./etc/node/:/etc/villas/node/" - networks: - villas: - - # Generate random data and send it via UDP to the 'node' service - signal: - image: villas/node:latest - privileged: true - entrypoint: bash - command: -c 'villas signal mixed -v4 | villas pipe -x /etc/villas/node/websocket.conf udp_1' + command: node /etc/villas/node/websocket-demo.conf volumes: - "./etc/node/:/etc/villas/node/" networks: diff --git a/etc/node/websocket-demo.conf b/etc/node/websocket-demo.conf new file mode 100644 index 0000000..11dbe01 --- /dev/null +++ b/etc/node/websocket-demo.conf @@ -0,0 +1,60 @@ +/** Example configuration file for VILLASnode. + * + * The syntax of this file is similar to JSON. + * A detailed description of the format can be found here: + * http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files + * + * @author Steffen Vogel + * @copyright 2017, Institute for Automation of Complex Power Systems, EONERC + * @license GNU General Public License (version 3) + * + * VILLASnode + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + *********************************************************************************/ + +nodes = { + sig_1 = { + type = "signal", + + signal = "mixed", + values = 4, + rate = 25 + }, + ws_1 = { + type = "websocket", + description = "Demo Channel", + vectorize = 10, + source = { + simulator = "OP5600", + location = "ACS lab" + }, + series = ( + { label = "Random walk", unit = "V" }, + { label = "Sine", unit = "A" }, + { label = "Rect", unit = "Var"}, + { label = "Ramp", unit = "°C" } + ) + } +}; + +############ List of paths ############ + +paths = ( + { + in = "sig_1", + out = "ws_1", + reverse = false + } +);