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
Parameter | Type | Description |
---|---|---|
def_array | table | This parameter specifies the data to be observed as an array of Observed Data Definition. |
Observed Data Definition
Key | Type | Description |
---|---|---|
event | number | Event ID for the event triggered when the observed data changes |
rpn | string | RPN expression representing the observed data |
initial_value | number | The 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 . |
epsilon | number | If 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.