Digital Adapter for the WLDT (White Label Digital Twin) framework that streams Digital Twin data - state, properties, relationships and events - towards PlotJuggler for real-time visualization. The adapter is visualization-only: it is strictly one-directional (Digital Twin -> PlotJuggler) and never models any action back into the twin.
It is built around three independent, pluggable concerns:
- a transport (how bytes reach PlotJuggler)
- wire format (how the payload is encoded)
- and channels (what data is sent, under which name).
Any transport can be combined with any wire format, and channels are configured independently of both.
- Channels - the four channel types, and how to reshape outgoing data with custom payload functions.
- Supported protocols - MQTT, WebSocket, UDP: configuration options and transport-specific behavior.
- Supported formats - JSON, CBOR, MessagePack, BSON, Protobuf (experimental).
- Usage example - a full worked example, plus the ready-to-run test scenarios
under
src/test. - Extending the adapter - how to add a new connection/transport or a new message format.
- Architecture reference - class diagram and runtime flow.
DigitalTwin digitalTwin = new DigitalTwin("my-digital-twin", new DefaultShadowingFunction());
// Add a Physical Adapter to the DT
[...]
PlotJugglerDigitalAdapterConfiguration configuration = PlotJugglerDigitalAdapterConfiguration
.builder(new UdpConnectionConfiguration("127.0.0.1", 9870), PlotJugglerMessageFormat.JSON)
.withStateChannel("dt-state")
.addPropertyChannel("x", "state/properties/x")
.addEventChannel("alarm", "state/events/alarm")
.build();
digitalTwin.addDigitalAdapter(new PlotJugglerDigitalAdapter("plotjuggler-da", configuration));
DigitalTwinEngine digitalTwinEngine = new DigitalTwinEngine();
digitalTwinEngine.addDigitalTwin(digitalTwin);
digitalTwinEngine.startAll();The shape of every configuration is always the same:
- Pick a transport by instantiating its configuration class (
MqttConnectionConfiguration,WebSocketConnectionConfigurationorUdpConnectionConfiguration) and aPlotJugglerMessageFormat, and pass both toPlotJugglerDigitalAdapterConfiguration.builder(...). - Declare channels on the returned builder:
withStateChannel(...)(at most one), and any number ofaddPropertyChannel(...),addRelationshipChannel(...),addEventChannel(...)calls - see docs/channels.md for the full list and custom payload functions. .build()the configuration and pass it tonew PlotJugglerDigitalAdapter(id, configuration), then attach it to yourDigitalTwinas usual.
| plotjuggler-digital-adapter | wldt-core 0.4.0 |
|---|---|
| 0.1.0 | ✅ |
