Jump to content
The simFlight Network Forums

Programming weather


Recommended Posts

Hello Pete !

I'm trying to copy weather from one PC into an other, somehow in realtime. This is one of the tasks I try to implement in a comercial product. I'm aware that weather will not appear exact the same, but somehow the same.

As now I've only partly succeded by some uncontrolled weather setting or clearing weather (well I see something is happend :) )

Question:

Reference "NewWeather ReadMe.txt , NewWeather.h". Am I at all trying to do the right thing by read the "C000-C3FF (Area 0): Weather at aircraft", send that data and write it into next PC by "C800-CBFF (Area 2): Weather setting area" using uCommand=NW_SETEXACT and chICAO="GLOB" ?

Or what is the perfered method to use in "NewWeather ReadMe.txt" ?

Thanks and regards !

Link to comment
Share on other sites

As now I've only partly succeded by some uncontrolled weather setting or clearing weather (well I see something is happend :) )

I'm not sure what you mean there.

Am I at all trying to do the right thing by read the "C000-C3FF (Area 0): Weather at aircraft", send that data and write it into next PC by "C800-CBFF (Area 2): Weather setting area" using uCommand=NW_SETEXACT and chICAO="GLOB" ?

Well you might be able to accomplish something that way. I'm not too sure how the results would appear though. First you must make sure all weather is completely clear in the target FS -- use Clear Weather for that, and set the dynamics to 0.

If the weather hasn't been cleared, when you set "GLOBal" weather it will only affect those weather stations which don't already have their own weather. It simply acts as the "default" weather for such stations.

Unfortunately it still isn't that easy. After a while the stations which start with your global weather will have developed locally, and future global weather changes won't affect them -- they now have localised weather.

So, if you want to keep them all set with global weather all the time, you have to clear all the weather before setting it. every time. This looks horrible and is very jerky/stuttery as well.

The only proper way is to read weather at weather stations and set it to those weather stations in the target PC. You could read the aircraft's weather, as you are doing, and use that to set the surrounding weather stations. That might work too, but it isn't exactly the same -- interpolation produces the weather at the aircraft, and applying interpolated results to the weather stations may not then produce the same re-interpolated results back at the aircraft.

Regards,

Pete

Link to comment
Share on other sites

Thanks for answers !

As now I've only partly succeded by some uncontrolled weather setting or clearing weather

I just mean weather does not appear as expected but at least I see some changes.

The only proper way is to read weather at weather stations and set it to those weather stations in the target PC.

Questions:

Does this mean read "CC00-CFFF (Area 3): Weather reading area" and set "C800-CBFF (Area 2): Weather setting area" for several ICAO stations ?

Can I use those methods with ICAO code "GLOB" for both read and write, just to make more simply first tests ?

set the surrounding weather stations.

Question:

Are there any way to know which are the surrounding weather stations ICAO codes that make sence to read and write to copy the weater, are the surrounding weather stations ICAO codes available to read out ?

Thanks and regards !

Link to comment
Share on other sites

Does this mean read "CC00-CFFF (Area 3): Weather reading area" and set "C800-CBFF (Area 2): Weather setting area" for several ICAO stations ?

That would be the most accurate and most successful way, I think. Yes. The "several" stations would need to be those surrounding your aircraft's position. You'd need a database for that -- you can use the lists provided by FS (see the Weather folder, with updates in your flight sim documents folder).

Can I use those methods with ICAO code "GLOB" for both read and write, just to make more simply first tests ?

Well, yes, but the GLOB weather you read will not necessarily relate to any of the weather around your aircraft (as it is only the default for unset stations), and it won't necessarily set the weather at your aircraft in the target PC because that might be dictated by locally set weather too.

If you want to experiment with just one weather station before working out how to determine which ones to deal with, try just parking your aircraft at a known station/airport, and reading/writing that station.

This may still give slightly different results in the other PC if it has other nearby stations with different weather, but if you are as close to the WX station coordinates as possible, there should be notceable similarities. :?

Note that WX stations are not always exactly in the airport perimeter.

Are there any way to know which are the surrounding weather stations ICAO codes that make sence to read and write to copy the weater, are the surrounding weather stations ICAO codes available to read out ?

The ICAO ids, Lat/Long/Alt are available. Look at the files in FS's weather folder.

WXstationlist.BIN is just a complete list of 4-letter ICAO codes for weather stations. They are packed tight, 4 bytes to each. This file is the default -- if you ever use the FS Jeppesen weather downloads then an updated list will appear in the same folder as your FS9.CFG file.

WXmapping.bin just gives all the station names as far as I can see.

ICAO Pos.bin is the most useful. For every WX ICAO id it provides the Latitude, Longitude and Altitude. It is a binary file with 16 bytes per entry, thus:

char chICAO[4]

float fLatitude;

float fLongitude;

float fAltitude;

This is in C. "float" is a 32-bit floating point number.

Regards,

Pete

Link to comment
Share on other sites

THANKS A LOT :D :D :D

It acctually works to copy the weather !

And thanks for info about FS ICAO data, I'll use that later.

I copy one station only, and as you wrote, weather is not copied the same exact, but no doubt it come from the weather I did read.

I intend to have the weather copying to work no matter how the source PC weather are set, I mean no matter if source PC set it's weather by FS weather menu, or addons like ActiveSky.

One more question for now, conserning the task to copy weather:

When I have found out current relevant ICAO weather to copy, should I also copy the "GLOB" weather so that if source PC may not have the requested ICAO data, then the global weather will be used instead of requested ICAO ?

Link to comment
Share on other sites

One more question for now, conserning the task to copy weather:

When I have found out current relevant ICAO weather to copy, should I also copy the "GLOB" weather so that if source PC may not have the requested ICAO data, then the global weather will be used instead of requested ICAO ?

Yes, that would be a good idea for weather sources such as ActiveSky which I think does set sensible GLOB weather too. But it won't be so useful for FS default or FS downloads because the GLOB weather that provides doesn't seem to match much at all.

You could read and set the the nearest WX station(s) and also copy either the nearest station or the *aircraft* weather to GLOB on the other PC. That would cover your options better, I think.

Regards,

Pete

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.