Setting Simulation Time (again)

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Locked
petesk8
Posts: 12
Joined: Thu Jan 05, 2012 10:10 am

Post by petesk8 »

Hi All,

Using P3d as an Image generator I have been trying to set time of day to have a night and day scenario.

Using the following based on others before me



SimConnect_MapClientEventToSimEvent(hSimConnect, EVENT_CLOCK_HOUR, "ZULU_HOURS_SET");





SimConnect_AddClientEventToNotificationGroup(hSimConnect,GROUP_1, EVENT_CLOCK_HOUR, FALSE);



SimConnect_SetNotificationGroupPriority(hSimConnect, GROUP_1, SIMCONNECT_GROUP_PRIORITY_STANDARD-1);



and



SimConnect_TransmitClientEvent(hSimConnect, 0, EVENT_CLOCK_HOUR ,hour_variable ,GROUP_1, SIMCONNECT_EVENT_FLAG_DEFAULT);



This didn't work and I tried all sorts of variations and still nothing.

It then occurred to be that as I was calling this from an external Sim dll module, loaded when a specific vehicle was loaded, it might not work .



Trying the above as a p3d client loaded via exe.xml or manually it worked fine.



However I would like to keep the number of intefaces to P3d down so I am wondering if there is anything I was doing wrong in the external Sim module that stopped me setting time ?

Any insight would be appreciated.

Cheers ,Pete

minime
Posts: 1198
Joined: Mon Jun 10, 2013 4:33 pm

Post by minime »

Did you try a higher group priority?



MapClientEventToSimEvent(Events.SET_SIM_TIME_HOURS, "ZULU_HOURS_SET");

TransmitClientEvent(SIMCONNECT_OBJECT_ID_USER, Events.SET_SIM_TIME_HOURS, (uint)SimTime.Hour, SimConnectGroupPriorities.SIMCONNECT_GROUP_PRIORITY_HIGHEST, SIMCONNECT_EVENT_FLAG.GROUPID_IS_PRIORITY);

petesk8
Posts: 12
Joined: Thu Jan 05, 2012 10:10 am

Post by petesk8 »

Hi minime,

Yes, I tried that but had no success.
petesk8
Posts: 12
Joined: Thu Jan 05, 2012 10:10 am

Post by petesk8 »

Hi minime,

Yes, I tried that but had no success.
minime
Posts: 1198
Joined: Mon Jun 10, 2013 4:33 pm

Post by minime »

Try setting breakpoints and make sure the code gets called. Then enable SimConnect logging and subscribe to the Exceptions. See what is being logged.



I have code like that in a C# DLL, a C # App and a C++ DLL, and SimConnect should not really care where the async network messages come from...
Locked