Callback on XML gauge/3D animation events

For topics related to the creation of simulation objects (SimObjects). This includes development of aircraft, ground, and maritime vehicles.
Locked
soft.creator
Posts: 3
Joined: Tue Aug 29, 2017 8:59 pm

Callback on XML gauge/3D animation events

Post by soft.creator »

Hello everyone,

I am developing an aircraft model and I want to use XML gauges/3D animation as views (as they are supposed to be in MVC pattern), and implement systems logic (model part of MVC pattern) in C++ code in PDK DLLs.

The problem I am trying to solve is how to respond to various events that occur in views (XML gauges/3D animations). There is an old method of using (>L:Var) variables, but this method is not the one I want, for several reasons:
  • * It requires constant polling, which is rather inefficient
    * Some events may be lost if they use a single (>L:Var) and occur between two polls
Reading SDK (and prticularly PDK) documentation, I have found a nice RegisterProperty facility in ISimObject. This facility allows to define a C++ callback for any custom event. But this feature is only working for C++ code interaction now. See https://prepar3d.com/forum/viewtopic.ph ... 1&t=126516 for details.

Is there a way to define C++ callback or process some event in C++ code for any custom event in XML gauge/3D animation? Just for example, I want to process sound playback requests. They may be issued by XML gauge update code or in response for mouse clicks. I don't want to lose any of them so I need to get my callback called (or some event received) on every request. Is that possible at all (Panels SDK, PDK, SimConnect...)?
Locked