Hello Pete
I'm playing around a little bit with FSUIPC and want to set the weather using the new FS2004 interface. However, I have troubles understanding the documentation and the general procedure to set weather.
Here is what I do, pseudocode:
Weather.SetAllToZero;
Weather.ICAO = 'GLOB';
Weather.Command = NW_DYNAMICS;
FSUIPC_Write(Weather, 0xC800);
Weather.Command = NW_CLEAR;
FSUIPC_Write(Weather, 0xC800);
FSUIPC_Process;
sleep(2000);
So far so good, the Weather is reset every time i do this. After that:
Weather.MakeItRain;
Weather.ICAO = 'GLOB';
Weather.Command = NW_SET_PENDING;
FSUIPC_Write(Weather, 0xC800);
FSUIPC_Process;
sleep(for_ages, see below);
Weather.Command = NW_ACTIVATE;
FSUIPC_Write(Weather, 0xc800);
FSUIPC_Process;
When executing my program step by step everything is just fine. I could manage to get it running after adding a ton of sleep()'s, without them I usually crash FSUIPC and FS. It definitely is a timing problem.
The documentation writes:
I take it I have to wait for a new timestamp when using NW_SET_PENDING too.
But: Which Timestamp? I know there is a Timestamp in the Weather structure, but I don't know when or where to read it, and what to compare it to.
That timestamp-thingie seems to be a common concept in FSUPC, thus I feel a little stupid because I just don't get it.
Help me, please!