Display external data in an applet¶
Combine UDP and an applet to build a small telemetry display. The external program owns the data; the applet owns its presentation.
- Complete the UDP quickstart and leave
status.pyrunning on the MATRIC PC. - Install the Hello applet and set Variable to display to
hobby_temperature. - Save and load that deck on a client. It should display
23.5. - In your Python copy, replace
23.5inSETVARIABLESwith a value from a sensor, game or local service. Send another update when the value changes.
The route is:
Sensor or game → Python → UDP SETVARIABLES → MATRIC server variable
↓
Applet VARIABLESUPDATE → displayed value
In the applet, the lookup is simply:
const name = params.VariableToDisplay;
const value = variables[name];
output.textContent = value == null ? 'Waiting for value' : String(value);
Use value == null, rather than a truthiness check, so 0 and false remain visible. Render text with textContent rather than treating external data as HTML.
For the return path, an applet emits an event and the deck binds an appropriate action. Your UDP integration can observe the resulting ControlInteraction notification and filter its deck, control and event name. Emitting an applet event does not send an arbitrary UDP packet or call a desktop function directly.
For a display with no custom drawing, you can also bind a built-in control property to the server variable in the editor. Use an applet when you need your own layout or interaction.
A real-world integration¶
DCS-BIOS-MATRIC-Middleware applies this idea to a flight simulator: cockpit state updates MATRIC indicators and displays, and MATRIC controls send commands back to DCS-BIOS. Its README explains the DCS-BIOS requirements and connection setup.