• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

XML Weather Guage

Messages
131
Country
unitedstates
Is it possible to make a weather gauge with XML? I know it would need to use SimConnect, and be limited compared to real life instruments, but would like to try it out anyways.

I don't even know where to begin with SimConnect as I have never used, but I am up for the challenge I think.

Thanks!
 
I could probably build the XML->C->SimConnect interface for you. Your choices for getting 4096 distinct values into an XML gauge are probably limited to L:Vars or the storage module I just put together.

Here is the abridged blurb from the SDK on the cloud state structure:

SimConnect_WeatherRequestCloudState
The SimConnect_WeatherRequestCloudState function requests cloud density information on a given area.
Syntax
HRESULT SimConnect_WeatherRequestCloudState(
HANDLE hSimConnect,
SIMCONNECT_DATA_REQUEST_ID RequestID,
float minLat,
float minLon,
float minAlt,
float maxLat,
float maxLon,
float maxAlt,
DWORD dwFlags = 0
);

Parameters

hSimConnect
[in] Handle to a SimConnect object.
RequestID
[in] Specifies the client-defined request ID.
minLat
[in] Specifies the minimum latitude of the required area. This should simply be the lower of the two latitude numbers.
minLon
[in] Specifies the minimum longitude of the required area. This should simply be the lower of the two longitude numbers.
minAlt
[in] Specifies the minimum altitude of the required area, in feet.
maxLat
[in] Specifies the maximum latitude of the required area.
maxLon
[in] Specifies the maximum longitude of the required area.
maxAlt
[in] Specifies the maximum altitude of the required area, in feet.
dwFlags
[in, optional] Double word containing any flags. Reserved for future use.

Remarks:
The main purpose of this function is to enable weather radar.
If the call is successful, the cloud state information will be returned in a SIMCONNECT_RECV_CLOUD_STATE structure. This structure will contain a two dimensional array of byte data. The array will be 64 x 64 bytes in size, and each byte will contain a value indicating the cloud density for each cell. A value of zero would mean no clouds, to a maximum of 255. The area defined in this call is divided into 64 by 64 cells, so the size of each cell will be determined by the values given for the parameters above. Note that the entire World's weather is not simulated all the time, but only a region around the user aircraf, with a radius of approximately 128 kilometers, is modeled at any one time. A request for cloud data outside this region will simply return zeros.
The defined area can cross the Equator or the Greenwich Meridian, but it cannot cross the Poles or the International Date Line.


Doug
 
Project Storm Scope to MSFSX

I am developing a Scope to MSFSX Storm, but I can not get the status of the cloud.
I'm using SimConnect for data and function: SimConnect_WeatherRequestCloudState
Below is the code, note that the "pWxData-> rgbData" is always zero.
Please friends, can someone save me?
 

Attachments

Last edited:
Hello friends.

I tried everything to get the power status of the cloud around the aircraft to create a StormScope, but so far without success.
Below is the code, everything works normally step around the range and altitude of the aircraft of the same, but the array of 64x64 rgbData always been zero. I do not know what else to do. Any hint or help will be very grateful. My little one StormScope project is stopped because of it. After all have any other way to get the status of the clouds by FSUIPC or other library?
I need help from friends.

//----------------------------------------------------------

case SIMCONNECT_RECV_ID_CLOUD_STATE:
{
SIMCONNECT_RECV_CLOUD_STATE* pWxData = (SIMCONNECT_RECV_CLOUD_STATE*) pData;

printf("%d\n", pWxData->dwArraySize); // OK. Returns 4096 = 64x64

for (int x=0; x < pWxData->dwArraySize; x++ )
{
if ( pWxData->rgbData[x] != 0 )
{
printf("pos:%d, val:%d :]\n", x, pWxData->rgbData[x]);
}
}
break;
}
 
A developer I hove done some work for has brought this subject up to me again. They currently have a psuedo weather gauge, and are able to provide weather data to LVars via SimConnect.

What they are looking for is a cloud overlay on a moving map gauge. The moving map is done with the FSX gps CustomDraw.

Anyone have any thoughts as to a good approach to take the weather data and "draw" it over an XML gauge? The only approach I have though of so far would be to create an rectangle element for each pixel of the overlay, and adjust the color of the rectangle based on the LVars populated via SimConnect. However, to get a 64x64 resolution for the overlay, this would require almost 4100 elements, with a condition statement for the color of each one. Even if undertaking that task would be feasible, I would think the performance hit to the system would be VAST!

Any thoughts?
 
Last edited:
Well, you probably don't have to process each row in the array on each gauge update/frame.
You could certainly save yourself some CPU cycles by processing 1 or 2 rows per frame. Depending on how you were doing things, you might even save yourself declaring all 4096 L:Vars.

Doug
 
Has anyone found any other value than 0 being returned in the array rgbData?
 
Back
Top