# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0

http = {
    port = 8080
}

nodes = {
    api_node = {
        type = "api"

        in = {
            signals = (
                {
                    name = "sig1_in",
                    type = "float",
                    unit = "V",
                    description = "Signal 1",
                    rate = 100,
                    readable = true,
                    writable = false,
                    payload = "samples"
                },
                {
                    name = "sig2_in",
                    type = "float",
                    unit = "A",
                    description = "Signal 1",
                    rate = 100,
                    readable = true,
                    writable = false,
                    payload = "samples"
                },
                {
                    name = "sig3_in",
                    type = "float",
                    unit = "A",
                    description = "Signal 1",
                    rate = 100,
                    readable = true,
                    writable = false,
                    payload = "samples"
                }
            )
        }

        out = {
            signals = (
                # Output signals have no name, type and unit settings as those are implicitly
                # derived from the signals which are routed to this node
                {
                    description = "Signal 1",
                    rate = 100,
                    readable = true,
                    writable = false,
                    payload = "samples"
                },
                {
                    description = "Signal 1",
                    rate = 100,
                    readable = true,
                    writable = false,
                    payload = "samples"
                },
                {
                    description = "Signal 1",
                    rate = 100,
                    readable = true,
                    writable = false,
                    payload = "samples"
                }
            )
        }
    }

    signal_node = {
        type = "signal"

        signal = "mixed"
        values = 5
        rate = 1.0
    }
}

paths = (
    {
        in = [
            "api_node"
        ],
        hooks = (
            "print"
        )
    },
    {
        in = [
            "signal_node"
        ]
        out = [
            "api_node"
        ]
        hooks = (
            "print"
        )
    }
)
