Skip to main content

msfs.mfwasm.add_observed_data()

msfs.mfwasm.add_observed_data(def_array)

This function registers MSFS internal data as expressed in RPN for observing. It triggers the specified events in response to changes in the values of the registered data expressed in RPN. In this case, the Event Value corresponds to the result of evaluating the RPN.

Note

If you use this function, you need to have MobiFlight WASM Module installed.

Parameters

ParameterTypeDescription
def_arraytableThis parameter specifies the data to be observed as an array of Observed Data Definition.

Observed Data Definition

KeyTypeDescription
eventnumberEvent ID for the event triggered when the observed data changes
rpnstringRPN expression representing the observed data
initial_valuenumberThe initial value of the observed data.
fsmapper trigers an event with the initial value as the Event Value.
This parameter is optional. The default is 0.
epsilonnumberIf the change in the observed data does not exceed this value, no event will be triggered. Choosing an appropriate value helps prevent unnecessary event generation, reducing system load.
This parameter is optional. The default is 0

Return Values

This function doesn't return any value.

See Also