Skip to content

Commit 14c5307

Browse files
committed
feat(node-opal-orchestra): Add new OPAL-RT Orchestra node-type
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
1 parent 9b81d28 commit 14c5307

File tree

15 files changed

+1900
-50
lines changed

15 files changed

+1900
-50
lines changed

CMakeLists.txt

Lines changed: 52 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ find_package(Lua)
7676
find_package(LibDataChannel)
7777
find_package(re)
7878
find_package(OpenDSSC)
79+
find_package(OpalOrchestra)
80+
find_package(LibXml2)
7981

8082
# Check for tools
8183
find_program(PASTE NAMES paste)
@@ -158,55 +160,56 @@ else()
158160
endif()
159161

160162
# Build options
161-
cmake_dependent_option(WITH_DEFAULTS "Defaults for non required build options" ON "" OFF)
162-
163-
cmake_dependent_option(WITH_API "Build with remote control API" "${WITH_DEFAULTS}" "" OFF)
164-
cmake_dependent_option(WITH_CLIENTS "Build client applications" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
165-
cmake_dependent_option(WITH_CONFIG "Build with support for libconfig configuration syntax" "${WITH_DEFAULTS}" "LIBCONFIG_FOUND" OFF)
166-
cmake_dependent_option(WITH_FPGA "Build with support for VILLASfpga" "${WITH_DEFAULTS}" "FOUND_FPGA_SUBMODULES" OFF)
167-
cmake_dependent_option(WITH_GRAPHVIZ "Build with Graphviz" "${WITH_DEFAULTS}" "CGRAPH_FOUND; GVC_FOUND" OFF)
168-
cmake_dependent_option(WITH_HOOKS "Build with support for processing hook plugins" "${WITH_DEFAULTS}" "" OFF)
169-
cmake_dependent_option(WITH_LUA "Build with Lua" "${WITH_DEFAULTS}" "LUA_FOUND" OFF)
170-
cmake_dependent_option(WITH_OPENMP "Build with support for OpenMP for parallel hooks" "${WITH_DEFAULTS}" "OPENMP_FOUND" OFF)
171-
cmake_dependent_option(WITH_PLUGINS "Build plugins" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
172-
cmake_dependent_option(WITH_SRC "Build executables" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
173-
cmake_dependent_option(WITH_TESTS "Run tests" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
174-
cmake_dependent_option(WITH_TOOLS "Build auxilary tools" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
175-
cmake_dependent_option(WITH_WEB "Build with internal webserver" "${WITH_DEFAULTS}" "LIBWEBSOCKETS_FOUND" OFF)
176-
177-
cmake_dependent_option(WITH_NODE_AMQP "Build with amqp node-type" "${WITH_DEFAULTS}" "RABBITMQ_C_FOUND" OFF)
178-
cmake_dependent_option(WITH_NODE_CAN "Build with can node-type" "${WITH_DEFAULTS}" "" OFF)
179-
cmake_dependent_option(WITH_NODE_COMEDI "Build with comedi node-type" "${WITH_DEFAULTS}" "COMEDILIB_FOUND" OFF)
180-
cmake_dependent_option(WITH_NODE_ETHERCAT "Build with ethercat node-type" "${WITH_DEFAULTS}" "ETHERLAB_FOUND; NOT WITHOUT_GPL" OFF)
181-
cmake_dependent_option(WITH_NODE_EXAMPLE "Build with example node-type" "${WITH_DEFAULTS}" "" OFF)
182-
cmake_dependent_option(WITH_NODE_EXEC "Build with exec node-type" "${WITH_DEFAULTS}" "" OFF)
183-
cmake_dependent_option(WITH_NODE_FILE "Build with file node-type" "${WITH_DEFAULTS}" "" OFF)
184-
cmake_dependent_option(WITH_NODE_FPGA "Build with fpga node-type" "${WITH_DEFAULTS}" "WITH_FPGA" OFF)
185-
cmake_dependent_option(WITH_NODE_IEC61850 "Build with iec61850 node-types" "${WITH_DEFAULTS}" "LIBIEC61850_FOUND; NOT WITHOUT_GPL" OFF)
186-
cmake_dependent_option(WITH_NODE_IEC60870 "Build with iec60870 node-types" "${WITH_DEFAULTS}" "LIB60870_FOUND; NOT WITHOUT_GPL" OFF)
187-
cmake_dependent_option(WITH_NODE_INFINIBAND "Build with infiniband node-type" "${WITH_DEFAULTS}" "IBVerbs_FOUND; RDMACM_FOUND" OFF) # Infiniband node-type is currenly broken
188-
cmake_dependent_option(WITH_NODE_INFLUXDB "Build with influxdb node-type" "${WITH_DEFAULTS}" "" OFF)
189-
cmake_dependent_option(WITH_NODE_KAFKA "Build with kafka node-type" "${WITH_DEFAULTS}" "RDKAFKA_FOUND" OFF)
190-
cmake_dependent_option(WITH_NODE_LOOPBACK "Build with loopback node-type" "${WITH_DEFAULTS}" "" OFF)
191-
cmake_dependent_option(WITH_NODE_MODBUS "Build with modbus node-type" "${WITH_DEFAULTS}" "MODBUS_FOUND" OFF)
192-
cmake_dependent_option(WITH_NODE_MQTT "Build with mqtt node-type" "${WITH_DEFAULTS}" "MOSQUITTO_FOUND" OFF)
193-
cmake_dependent_option(WITH_NODE_NANOMSG "Build with nanomsg node-type" "${WITH_DEFAULTS}" "NANOMSG_FOUND" OFF)
194-
cmake_dependent_option(WITH_NODE_NGSI "Build with ngsi node-type" "${WITH_DEFAULTS}" "" OFF)
195-
cmake_dependent_option(WITH_NODE_REDIS "Build with redis node-type" "${WITH_DEFAULTS}" "HIREDIS_FOUND; REDISPP_FOUND" OFF)
196-
cmake_dependent_option(WITH_NODE_RTP "Build with rtp node-type" "${WITH_DEFAULTS}" "re_FOUND" OFF)
197-
cmake_dependent_option(WITH_NODE_SHMEM "Build with shmem node-type" "${WITH_DEFAULTS}" "HAS_SEMAPHORE; HAS_MMAN" OFF)
198-
cmake_dependent_option(WITH_NODE_SIGNAL "Build with signal node-type" "${WITH_DEFAULTS}" "" OFF)
199-
cmake_dependent_option(WITH_NODE_SOCKET "Build with socket node-type" "${WITH_DEFAULTS}" "LIBNL3_ROUTE_FOUND" OFF)
200-
cmake_dependent_option(WITH_NODE_STATS "Build with stats node-type" "${WITH_DEFAULTS}" "" OFF)
201-
cmake_dependent_option(WITH_NODE_TEMPER "Build with temper node-type" "${WITH_DEFAULTS}" "LIBUSB_FOUND" OFF)
202-
cmake_dependent_option(WITH_NODE_TEST_RTT "Build with test_rtt node-type" "${WITH_DEFAULTS}" "" OFF)
203-
cmake_dependent_option(WITH_NODE_ULDAQ "Build with uldaq node-type" "${WITH_DEFAULTS}" "LIBULDAQ_FOUND" OFF)
204-
cmake_dependent_option(WITH_NODE_WEBRTC "Build with webrtc node-type" "${WITH_DEFAULTS}" "WITH_WEB; LibDataChannel_FOUND" OFF)
205-
cmake_dependent_option(WITH_NODE_WEBSOCKET "Build with websocket node-type" "${WITH_DEFAULTS}" "WITH_WEB" OFF)
206-
cmake_dependent_option(WITH_NODE_ZEROMQ "Build with zeromq node-type" "${WITH_DEFAULTS}" "LIBZMQ_FOUND; NOT WITHOUT_GPL" OFF)
207-
cmake_dependent_option(WITH_NODE_OPENDSS "Build with opendss node-type" "${WITH_DEFAULTS}" "OpenDSSC_FOUND" OFF)
208-
209-
# set a default for the build type
163+
cmake_dependent_option(WITH_DEFAULTS "Defaults for non required build options" ON "" OFF)
164+
165+
cmake_dependent_option(WITH_API "Build with remote control API" "${WITH_DEFAULTS}" "" OFF)
166+
cmake_dependent_option(WITH_CLIENTS "Build client applications" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
167+
cmake_dependent_option(WITH_CONFIG "Build with support for libconfig configuration syntax" "${WITH_DEFAULTS}" "LIBCONFIG_FOUND" OFF)
168+
cmake_dependent_option(WITH_FPGA "Build with support for VILLASfpga" "${WITH_DEFAULTS}" "FOUND_FPGA_SUBMODULES" OFF)
169+
cmake_dependent_option(WITH_GRAPHVIZ "Build with Graphviz" "${WITH_DEFAULTS}" "CGRAPH_FOUND; GVC_FOUND" OFF)
170+
cmake_dependent_option(WITH_HOOKS "Build with support for processing hook plugins" "${WITH_DEFAULTS}" "" OFF)
171+
cmake_dependent_option(WITH_LUA "Build with Lua" "${WITH_DEFAULTS}" "LUA_FOUND" OFF)
172+
cmake_dependent_option(WITH_OPENMP "Build with support for OpenMP for parallel hooks" "${WITH_DEFAULTS}" "OPENMP_FOUND" OFF)
173+
cmake_dependent_option(WITH_PLUGINS "Build plugins" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
174+
cmake_dependent_option(WITH_SRC "Build executables" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
175+
cmake_dependent_option(WITH_TESTS "Run tests" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
176+
cmake_dependent_option(WITH_TOOLS "Build auxilary tools" "${WITH_DEFAULTS}" "TOPLEVEL_PROJECT" OFF)
177+
cmake_dependent_option(WITH_WEB "Build with internal webserver" "${WITH_DEFAULTS}" "LIBWEBSOCKETS_FOUND" OFF)
178+
179+
cmake_dependent_option(WITH_NODE_AMQP "Build with amqp node-type" "${WITH_DEFAULTS}" "RABBITMQ_C_FOUND" OFF)
180+
cmake_dependent_option(WITH_NODE_CAN "Build with can node-type" "${WITH_DEFAULTS}" "" OFF)
181+
cmake_dependent_option(WITH_NODE_COMEDI "Build with comedi node-type" "${WITH_DEFAULTS}" "COMEDILIB_FOUND" OFF)
182+
cmake_dependent_option(WITH_NODE_ETHERCAT "Build with ethercat node-type" "${WITH_DEFAULTS}" "ETHERLAB_FOUND; NOT WITHOUT_GPL" OFF)
183+
cmake_dependent_option(WITH_NODE_EXAMPLE "Build with example node-type" "${WITH_DEFAULTS}" "" OFF)
184+
cmake_dependent_option(WITH_NODE_EXEC "Build with exec node-type" "${WITH_DEFAULTS}" "" OFF)
185+
cmake_dependent_option(WITH_NODE_FILE "Build with file node-type" "${WITH_DEFAULTS}" "" OFF)
186+
cmake_dependent_option(WITH_NODE_FPGA "Build with fpga node-type" "${WITH_DEFAULTS}" "WITH_FPGA" OFF)
187+
cmake_dependent_option(WITH_NODE_IEC61850 "Build with iec61850 node-types" "${WITH_DEFAULTS}" "LIBIEC61850_FOUND; NOT WITHOUT_GPL" OFF)
188+
cmake_dependent_option(WITH_NODE_IEC60870 "Build with iec60870 node-types" "${WITH_DEFAULTS}" "LIB60870_FOUND; NOT WITHOUT_GPL" OFF)
189+
cmake_dependent_option(WITH_NODE_INFINIBAND "Build with infiniband node-type" "${WITH_DEFAULTS}" "IBVerbs_FOUND; RDMACM_FOUND" OFF) # Infiniband node-type is currenly broken
190+
cmake_dependent_option(WITH_NODE_INFLUXDB "Build with influxdb node-type" "${WITH_DEFAULTS}" "" OFF)
191+
cmake_dependent_option(WITH_NODE_KAFKA "Build with kafka node-type" "${WITH_DEFAULTS}" "RDKAFKA_FOUND" OFF)
192+
cmake_dependent_option(WITH_NODE_LOOPBACK "Build with loopback node-type" "${WITH_DEFAULTS}" "" OFF)
193+
cmake_dependent_option(WITH_NODE_MODBUS "Build with modbus node-type" "${WITH_DEFAULTS}" "MODBUS_FOUND" OFF)
194+
cmake_dependent_option(WITH_NODE_MQTT "Build with mqtt node-type" "${WITH_DEFAULTS}" "MOSQUITTO_FOUND" OFF)
195+
cmake_dependent_option(WITH_NODE_NANOMSG "Build with nanomsg node-type" "${WITH_DEFAULTS}" "NANOMSG_FOUND" OFF)
196+
cmake_dependent_option(WITH_NODE_NGSI "Build with ngsi node-type" "${WITH_DEFAULTS}" "" OFF)
197+
cmake_dependent_option(WITH_NODE_OPAL_ORCHESTRA "Build with the opal-orchestra node-type" "${WITH_DEFAULTS}" "OpalOrchestra_FOUND; LibXml2_FOUND" OFF)
198+
cmake_dependent_option(WITH_NODE_REDIS "Build with redis node-type" "${WITH_DEFAULTS}" "HIREDIS_FOUND; REDISPP_FOUND" OFF)
199+
cmake_dependent_option(WITH_NODE_RTP "Build with rtp node-type" "${WITH_DEFAULTS}" "re_FOUND" OFF)
200+
cmake_dependent_option(WITH_NODE_SHMEM "Build with shmem node-type" "${WITH_DEFAULTS}" "HAS_SEMAPHORE; HAS_MMAN" OFF)
201+
cmake_dependent_option(WITH_NODE_SIGNAL "Build with signal node-type" "${WITH_DEFAULTS}" "" OFF)
202+
cmake_dependent_option(WITH_NODE_SOCKET "Build with socket node-type" "${WITH_DEFAULTS}" "LIBNL3_ROUTE_FOUND" OFF)
203+
cmake_dependent_option(WITH_NODE_STATS "Build with stats node-type" "${WITH_DEFAULTS}" "" OFF)
204+
cmake_dependent_option(WITH_NODE_TEMPER "Build with temper node-type" "${WITH_DEFAULTS}" "LIBUSB_FOUND" OFF)
205+
cmake_dependent_option(WITH_NODE_TEST_RTT "Build with test_rtt node-type" "${WITH_DEFAULTS}" "" OFF)
206+
cmake_dependent_option(WITH_NODE_ULDAQ "Build with uldaq node-type" "${WITH_DEFAULTS}" "LIBULDAQ_FOUND" OFF)
207+
cmake_dependent_option(WITH_NODE_WEBRTC "Build with webrtc node-type" "${WITH_DEFAULTS}" "WITH_WEB; LibDataChannel_FOUND" OFF)
208+
cmake_dependent_option(WITH_NODE_WEBSOCKET "Build with websocket node-type" "${WITH_DEFAULTS}" "WITH_WEB" OFF)
209+
cmake_dependent_option(WITH_NODE_ZEROMQ "Build with zeromq node-type" "${WITH_DEFAULTS}" "LIBZMQ_FOUND; NOT WITHOUT_GPL" OFF)
210+
cmake_dependent_option(WITH_NODE_OPENDSS "Build with opendss node-type" "${WITH_DEFAULTS}" "OpenDSSC_FOUND" OFF)
211+
212+
# Set a default for the build type
210213
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
211214
set(CMAKE_BUILD_TYPE "Debug")
212215
endif()

cmake/FindOpalOrchestra.cmake

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# CMakeLists.txt.
2+
#
3+
# Author: Steffen Vogel <post@steffenvogel.de>
4+
# SPDX-FileCopyrightText: 2025, OPAL-RT Germany GmbH
5+
# SPDX-License-Identifier: Apache-2.0
6+
7+
find_path(OPAL_ORCHESTRA_INCLUDE_DIR
8+
NAMES RTAPI.h
9+
PATHS
10+
/usr/opalrt/common/bin
11+
)
12+
13+
find_library(OPAL_ORCHESTRA_LIBRARY
14+
NAMES OpalOrchestra
15+
PATHS
16+
/usr/opalrt/common/include
17+
)
18+
19+
include(FindPackageHandleStandardArgs)
20+
find_package_handle_standard_args(OpalOrchestra DEFAULT_MSG OPAL_ORCHESTRA_LIBRARY OPAL_ORCHESTRA_INCLUDE_DIR)
21+
22+
mark_as_advanced(OPAL_ORCHESTRA_INCLUDE_DIR OPAL_ORCHESTRA_LIBRARY)
23+
24+
set(OPAL_ORCHESTRA_LIBRARIES ${OPAL_ORCHESTRA_LIBRARY})
25+
set(OPAL_ORCHESTRA_INCLUDE_DIRS ${OPAL_ORCHESTRA_INCLUDE_DIR})
26+
27+
add_library(OpalOrchestra INTERFACE)
28+
target_link_libraries(OpalOrchestra INTERFACE ${OPAL_ORCHESTRA_LIBRARY})
29+
target_include_directories(OpalOrchestra INTERFACE ${OPAL_ORCHESTRA_INCLUDE_DIR})
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# SPDX-FileCopyrightText: 2025, OPAL-RT Germany GmbH
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
stats = 1
5+
6+
nodes = {
7+
domain1 = {
8+
type = "opal.orchestra"
9+
10+
# Path to the OPAL-RT Orchestra Data Defintion XML file (DDF).
11+
ddf = "orchestra.xml"
12+
13+
# Enable to overwrite the DDF file.
14+
# This is useful when you want to generate the DDF file from the configuration file
15+
# for importing it into RT-LAB or HYPERSIM.
16+
ddf_overwrite = true
17+
18+
# Orchestra domain name.
19+
domain = "domain1"
20+
21+
# Connection timeout in seconds.
22+
connect_timeout = 2
23+
24+
# Define the delay to wait when using flag synchronisation (XHP).
25+
# This will call the system function usleep and free the CPU.
26+
# In micro-seconds.
27+
flag_delay = 0
28+
29+
# Force the local Orchestra communication to be made with flag instead of semaphore when using an external communication process.
30+
# Define the delay to wait, this will call the system function usleep and free the CPU.
31+
# In micro-seconds.
32+
use_flag_with_tool = false
33+
skip_wait_to_go = false
34+
35+
rate = 500.0;
36+
37+
# The following parameters are used to generate the Orchestra DDF XML file.
38+
synchronous = false
39+
states = false
40+
multiple_publish_allowed = false
41+
42+
connection = {
43+
# One of: local, remote or dolphin
44+
type = "local"
45+
46+
# For 'local'
47+
extcomm = "udp";
48+
addrframework = "10.168.13.5";
49+
portframework = 10000
50+
coreframework = 0
51+
coreclient = 0
52+
nicframework = "eno2"
53+
nicclient = "eno1"
54+
55+
# For 'remote'
56+
card = "test"
57+
pciindex = 0
58+
59+
# For 'dolphin'
60+
nodeIdFramework = 0
61+
segmentId = 0
62+
}
63+
64+
in = {
65+
hooks = (
66+
{ type = "stats" },
67+
{ type = "print" }
68+
)
69+
70+
signals = (
71+
{
72+
name = "pub_signal1",
73+
type = "float"
74+
75+
orchestra_name = "pub_signal_float"
76+
orchestra_type = "float64"
77+
orchestra_index = 0
78+
},
79+
{
80+
name = "pub_signal2",
81+
type = "float"
82+
83+
orchestra_name = "pub_signal_float"
84+
orchestra_type = "float64"
85+
},
86+
{ name = "signal_float", orchestra_name = "some_bus/signal_float", orchestra_type = "float64", orchestra_index = 2 },
87+
{ name = "signal_bool", orchestra_name = "some_bus/signal_bool", orchestra_type = "boolean" },
88+
{ name = "signal_uint8", orchestra_name = "some_bus/some_nested_bus/signal_uint8", orchestra_type = "unsigned int8" },
89+
{ name = "signal_uint8_2", orchestra_type = "unsigned int8" }
90+
)
91+
}
92+
93+
out = {
94+
signals = (
95+
{ name="pub_signal_float", init = 1.2, orchestra_name = "sub_signal_float", type = "float" }
96+
)
97+
}
98+
}
99+
}
100+
101+
paths = (
102+
{
103+
in = "domain1"
104+
out = "domain1"
105+
}
106+
)

flake.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
};
1818

1919
outputs =
20-
{ self, nixpkgs, ... }:
20+
{
21+
self,
22+
nixpkgs,
23+
...
24+
}:
2125
let
2226
inherit (nixpkgs) lib;
2327

@@ -102,6 +106,7 @@
102106
# Third-party dependencies
103107

104108
opendssc = pkgs.callPackage (nixDir + "/opendssc.nix") { };
109+
orchestra = pkgs.callPackage (nixDir + "/orchestra.nix") { };
105110
};
106111
in
107112
{

0 commit comments

Comments
 (0)