Dear Support Forum,
I am having troubles setting the simulation time via SimConnect from a remote machine. I am using the SDK 1.2. I send those values and the time of day is not changing at all.
Code snippet:
int todHours = 23;
int todMinutes = 59:
hr = SimConnect_TransmitClientEvent( _simHandle.simConnectHandle, 1, EVENT_KEY_CLOCK_HOURS_SET, todHours, GROUP_1, SIMCONNECT_EVENT_FLAG_DEFAULT);
hr = SimConnect_TransmitClientEvent( _simHandle.simConnectHandle, 1, EVENT_KEY_CLOCK_MINUTES_SET, todMinutes, GROUP_1, SIMCONNECT_EVENT_FLAG_DEFAULT);
Can I debug this somehow on the machine where P3D is running?
Regards,
DevSim
Setting the simulation time of day, date of year
From the SimConnect.log debug output on the Prepar3d machine, I get:
> 1853.50712 [ 0, 1394]TransmitClientEvent:ObjectID=1, EventID=10, dwData=23, GroupID=0, Flags=0
< 1853.50732 [0] >>>>> EXCEPTION=1, SendID=1394, Index=2 <<<<<
> 1853.50740 [ 0, 1395]TransmitClientEvent:ObjectID=1, EventID=11, dwData=59, GroupID=0, Flags=0
< 1853.50762 [0] >>>>> EXCEPTION=1, SendID=1395, Index=2 <<<<<
So the new time of day is obviously causing exceptions.
> 1853.50712 [ 0, 1394]TransmitClientEvent:ObjectID=1, EventID=10, dwData=23, GroupID=0, Flags=0
< 1853.50732 [0] >>>>> EXCEPTION=1, SendID=1394, Index=2 <<<<<
> 1853.50740 [ 0, 1395]TransmitClientEvent:ObjectID=1, EventID=11, dwData=59, GroupID=0, Flags=0
< 1853.50762 [0] >>>>> EXCEPTION=1, SendID=1395, Index=2 <<<<<
So the new time of day is obviously causing exceptions.
And I figured out why the exceptions occured - the mapping of the event was wrong (forgot to omit the KEY_ prefix):
With:
hr = SimConnect_MapClientEventToSimEvent(_simHandle.simConnectHandle, EVENT_KEY_CLOCK_HOURS_SET, "CLOCK_HOURS_SET" );
I don't get exceptions during the mapping of the client to sim event.
I also don't get exceptions during transmiting the client event.
The time of day, however, doesn't change.
Regards,
DevSim
With:
hr = SimConnect_MapClientEventToSimEvent(_simHandle.simConnectHandle, EVENT_KEY_CLOCK_HOURS_SET, "CLOCK_HOURS_SET" );
I don't get exceptions during the mapping of the client to sim event.
I also don't get exceptions during transmiting the client event.
The time of day, however, doesn't change.
Regards,
DevSim
-
- Lockheed Martin
- Posts: 1382
- Joined: Mon Sep 20, 2010 6:17 pm
Hi DevSim,
N4GIX is correct. Whenever the time is changed using SimConnect you will end up experiencing the ‘Loading…’ screen for a brief moment. This is the same functionality that occurs when you change the time using the ‘Time and Seasons’ settings in application.
N4GIX is correct. Whenever the time is changed using SimConnect you will end up experiencing the ‘Loading…’ screen for a brief moment. This is the same functionality that occurs when you change the time using the ‘Time and Seasons’ settings in application.
Prepar3D® Engineering Project Manager