Events question

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Locked
nshahzad
Posts: 2
Joined: Sat Mar 28, 2015 7:05 pm

Events question

Post by nshahzad »

Hi all,

Reading the docs, for the events, it says:
when getting the value it is returned in the dwData parameter of the SIMCONNECT_RECV_EVENT

However, I'm seeing the dwData event being 0 and not changing for many events. I'm getting the event, just not the state, for example, any of the lights (beacon, strobes). So far, only the system events are working as expected.

Handler Got event: SIM_RUNNING, data: 1, flags: 0
Handler Got event: PAUSE, data: 0, flags: 0
Handler Got event: STROBES_TOGGLE, data: 0, flags: 0
Handler Got event: STROBES_TOGGLE, data: 0, flags: 0
Handler Got event: STROBES_TOGGLE, data: 0, flags: 0
Handler Got event: STROBES_TOGGLE, data: 0, flags: 0
Handler Got event: STROBES_TOGGLE, data: 0, flags: 0
Handler Got event: TOGGLE_MASTER_BATTERY, data: 0, flags: 0
Handler Got event: TOGGLE_MASTER_BATTERY, data: 0, flags: 0

This is in C#, if that matters.

What's the workflow supposed to be here to get the values?

I have the client data sent every second, but I'd rather not have to add all of these different values to that data structure and then parse all those out. Should I have a separate data structure with these values, with the SIMCONNECT_PERIOD set to ONCE, and just make that call whenever I get an event? I think that's more what I'm leaning towards.

Thanks!
nshahzad
Posts: 2
Joined: Sat Mar 28, 2015 7:05 pm

Re: Events question

Post by nshahzad »

So, I decided to just create a separate data request on any changes, this works out much better, actually, since I can just feed that entire structure into a state machine.

But if there's a better way, I'd def like to know
Locked