- Messages
- 531
- Country

I am building an alternative PFD for the Asobo A320 Neo in JavaScript, for training purpose. It works quite well but I still have questions about the interaction between the virtual cockpit and the instrument code in JS.
I found out some interactions works through local variables (L:vars) but I am more interested in the events. For example, my PFD receives an event named "BTN_LS" through the "onEvent" function when the LS button is pressed in the VC. This is perfect, I receive hte event and can take the necessary action. In that case, I toggle the LS display in my PFD.
The problem is that I don't understand why my PFD receives this event. My PFD class replaces the existing PFD, so the class name is A320_Neo_PFD, which extends the BaseAirliners class. I don't see any code that subscribes to the "BTN_LS" event.
For testing purpose, I created another instrument with my own class name, not replacing an existing one, which also extends BaseAirliners and it receives no event at all.
I guess the PFD is configured to receive this event, but how? Where?
I would also like to know where this event is triggered. I looked into the model behavior files and all other files and couldn't find the way it was triggered to be received by my PFD.
Any information is welcome.
Thanks,
Eric
I found out some interactions works through local variables (L:vars) but I am more interested in the events. For example, my PFD receives an event named "BTN_LS" through the "onEvent" function when the LS button is pressed in the VC. This is perfect, I receive hte event and can take the necessary action. In that case, I toggle the LS display in my PFD.
The problem is that I don't understand why my PFD receives this event. My PFD class replaces the existing PFD, so the class name is A320_Neo_PFD, which extends the BaseAirliners class. I don't see any code that subscribes to the "BTN_LS" event.
For testing purpose, I created another instrument with my own class name, not replacing an existing one, which also extends BaseAirliners and it receives no event at all.
I guess the PFD is configured to receive this event, but how? Where?
I would also like to know where this event is triggered. I looked into the model behavior files and all other files and couldn't find the way it was triggered to be received by my PFD.
Any information is welcome.
Thanks,
Eric
