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

nodes = {
    rtds_ss1 = {
        type = "socket",
        layer = "udp",
        format = {
            type = "gtnet"
            fake = true
        }

        in = { # Local address, i.e. address of villas instance
            address = "134.130.169.31:12000"

            signals = (
                { name="trigger", type="integer" },
                { name="if1_tx_phA_dp0_mag",   type="float" },
                { name="if1_tx_phA_dp0_phase", type="float" },
                { name="if1_tx_phA_dp1_mag",   type="float" },
                { name="if1_tx_phA_dp1_phase", type="float" },
                { name="if1_tx_phA_dp2_mag",   type="float" },
                { name="if1_tx_phA_dp2_phase", type="float" },
                { name="if1_tx_phA_dp3_mag",   type="float" },
                { name="if1_tx_phA_dp3_phase", type="float" },
                { name="if1_tx_phB_dp0_mag",   type="float" },
                { name="if1_tx_phB_dp0_phase", type="float" },
                { name="if1_tx_phB_dp1_mag",   type="float" },
                { name="if1_tx_phB_dp1_phase", type="float" },
                { name="if1_tx_phB_dp2_mag",   type="float" },
                { name="if1_tx_phB_dp2_phase", type="float" },
                { name="if1_tx_phB_dp3_mag",   type="float" },
                { name="if1_tx_phB_dp3_phase", type="float" },
                { name="if1_tx_phC_dp0_mag",   type="float" },
                { name="if1_tx_phC_dp0_phase", type="float" },
                { name="if1_tx_phC_dp1_mag",   type="float" },
                { name="if1_tx_phC_dp1_phase", type="float" },
                { name="if1_tx_phC_dp2_mag",   type="float" },
                { name="if1_tx_phC_dp2_phase", type="float" },
                { name="if1_tx_phC_dp3_mag",   type="float" },
                { name="if1_tx_phC_dp3_phase", type="float" }
            )
        }

        out = { # Remote address, i.e. address of GTNET card
            address = "134.130.169.97:12000" # GTNET#4 -> Rack5(GPC4)
        }
    }

    rtds_ss2 = {
        type = "socket",
        layer = "udp",
        format = {
            type = "gtnet"
            fake = true
        }

        in = {
             # Local address, i.e. address of villas instance
            address = "134.130.169.31:12001"

            signals = (
                { name="trigger", type="integer" },
                { name="if1_tx_phA_dp0_mag",   type="float" },
                { name="if1_tx_phA_dp0_phase", type="float" },
                { name="if1_tx_phA_dp1_mag",   type="float" },
                { name="if1_tx_phA_dp1_phase", type="float" },
                { name="if1_tx_phA_dp2_mag",   type="float" },
                { name="if1_tx_phA_dp2_phase", type="float" },
                { name="if1_tx_phA_dp3_mag",   type="float" },
                { name="if1_tx_phA_dp3_phase", type="float" },
                { name="if1_tx_phB_dp0_mag",   type="float" },
                { name="if1_tx_phB_dp0_phase", type="float" },
                { name="if1_tx_phB_dp1_mag",   type="float" },
                { name="if1_tx_phB_dp1_phase", type="float" },
                { name="if1_tx_phB_dp2_mag",   type="float" },
                { name="if1_tx_phB_dp2_phase", type="float" },
                { name="if1_tx_phB_dp3_mag",   type="float" },
                { name="if1_tx_phB_dp3_phase", type="float" },
                { name="if1_tx_phC_dp0_mag",   type="float" },
                { name="if1_tx_phC_dp0_phase", type="float" },
                { name="if1_tx_phC_dp1_mag",   type="float" },
                { name="if1_tx_phC_dp1_phase", type="float" },
                { name="if1_tx_phC_dp2_mag",   type="float" },
                { name="if1_tx_phC_dp2_phase", type="float" },
                { name="if1_tx_phC_dp3_mag",   type="float" },
                { name="if1_tx_phC_dp3_phase", type="float" }
            )
        }

        out = {
            # Remote address, i.e. address of GTNET card
            address = "134.130.169.98:12000" # GTNET#5 -> Rack1(GPC4)
        }
    }

    rtds_ss1_monitoring = {
        type = "socket"
        layer = "udp"
        format = {
            type = "gtnet"
            fake = true
        }

        in = { # Local address, i.e. address of villas instance
            address = "134.130.169.31:12002"

            signals = (
                { name="orgn_V3phRMSintrf", type="float", unit="V"   },
                { name="orgn_Pintrf", type="float", unit="W"   },
                { name="orgn_Qintrf", type="float", unit="Var" },
                { name="orgn_Sintrf", type="float", unit="VA"  },
                { name="if1_V3phRMS", type="float", unit="V"   },
                { name="if1_I3phRMS", type="float", unit="A"   },
                { name="if1_P",       type="float", unit="W"   },
                { name="if1_Q",       type="float", unit="Var" },
                { name="if1_S",       type="float", unit="VA"  }
            )
        }

        out = { # Remote address, i.e. address of GTNET card
            address = "134.130.169.97:12000"
        }
    }


    web_monitoring = {
        type = "websocket"

        destinations = [
            "https://villas.k8s.eonerc.rwth-aachen.de//ws/relay/lab17"
        ]
    }
}

paths = (
    {
        in = "rtds_ss1",
        out = "rtds_ss2",
        reverse = true
    },
    {
        enabled = false,
        in = "rtds_ss1_monitoring",
        out = "web_monitoring",
        reverse = true
    }
)
