Interacting with PPE status by code
- Last UpdatedDec 06, 2023
- 1 minute read
The localAvatar_dpi struct summarizes the equippable/unequippable item state.
-
For each DPI item, it contains a field named exactly like the DPI. For example, h2s_detector.
-
For each instrument DPI, it contains a field named dpi_value. For example, h2s_detector_value.
It is the correct node to interact with the DPI state for both reading and for setting.
Code example
A code example for interacting with PPE Status.
<!-- executing a command when the torch is turned of-->
<route from="localAvatar_dpi.torch" to="torchTurnedOn.execute" condition="@localAvatar_dpi.torch@" />
<Command name="torchTurnedOn">
<!--...-->
</Command>
<!-- setting the value of the measured h2s detector --> <Var name="calculatedH2S" type="sfloat" value="0"> <route from="calculatedH2S.value" to="localAvatar_dpi.h2s_detector_value" value="[*'{0:0.00}',n:@calculatedH2S.value@]" />