How to get the METAR string in C#?

ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

How to get the METAR string in C#?

Postby ppp333ddd_ » Mon Feb 26, 2018 7:34 am

Hi,
I need to set the ambient temperature and wind. I have searched for sim vars and found the weather and wind info can be read but not settable. The only way I can imagine is to set the METAR. Also, I found the API I need to read METAR data from is WeatherRequestObservationAtStation, but I have trouble using the struct SIMCONNECT_RECV_WEATHER_OBSERVATION then as this is a C++ struct. Is there a similar struct in C# so that I can get the METAR string? Thanks.

maxaero
Posts: 15
Joined: Tue Oct 29, 2013 4:02 pm

Re: How to get the METAR string in C#?

Postby maxaero » Mon Feb 26, 2018 4:04 pm

Use the Object Browser in Visual Studio to look at SIMCONNECT_RECV_WEATHER_OBSERVATION You'll see that SIMCONNECT_RECV_WEATHER_OBSERVATION is a class with two fields, public uint dwRequestID and public string szMetar.

ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

Re: How to get the METAR string in C#?

Postby ppp333ddd_ » Thu Mar 01, 2018 8:35 am

Hi maxaero, thanks you are right.


Return to “Software Development Kit (SDK) Questions”

Who is online

Users browsing this forum: No registered users and 2 guests