IWeatherSystem Service issue

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Post Reply
tauseefAhmed
Posts: 38
Joined: Wed Jul 31, 2019 4:56 pm

IWeatherSystem Service issue

Post by tauseefAhmed »

Hello,
Its been a few days since I started working on PDK IWeatherSystem service. I've followed the other samples to learn how to Query a service and use it.
I'm able to query the service successfully using the following line.

Code: Select all

CComPtr<IWeatherSystemV430> m_spWeatherSystem;
PdkServices->GetPdk()->QueryService(SID_WeatherSystem, IID_WeatherSystem, (void**)&m_spWeatherSystem);
Then I called

Code: Select all

m_spWeatherSystem->SetMetarData(metar String)
.
At first, it applied the weather when I built the dll. But when I did the same for the second time, It didn't work.
I tried other functions as well but all of them return false. There's no error log as well. Just the function returning False everytime.

Note: I can remember during my R&D on this a few weeks back, SetMetarData was working fine. It's just a random behavior I think. Sometimes it works, sometimes it won't.

Can someone from Lockheed Martin take a look at this issue? Am I the only one facing the problem or others have also run into this one. Is this a SDK issue or something I need to check at my application side?


Thank you very much for your time.
BenBaron
Posts: 80
Joined: Fri Jan 16, 2015 7:51 am

Re: IWeatherSystem Service issue

Post by BenBaron »

Hi Ahmed,

I don't know if that helps, but why do you query for the legacy IID_IWeatherSystem and not directly for the current version IID_IWeatherSystemV430 of the interface?

Greets, Benny
tauseefAhmed
Posts: 38
Joined: Wed Jul 31, 2019 4:56 pm

Re: IWeatherSystem Service issue

Post by tauseefAhmed »

Hello Benny,

Thank you for your answer.
I forgot to mention in the post but I've tried it with IID_WeatherSystemV430 but it didn't help.
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: IWeatherSystem Service issue

Post by Clifton Crane »

Hi tauseefAhmed,

Can you post an example METAR string? Are you near the weather station you are trying to set? Are you passing in a valid Unicode string into the function?

Thanks.
Clifton Crane
Prepar3D® Software Engineer Sr.
tauseefAhmed
Posts: 38
Joined: Wed Jul 31, 2019 4:56 pm

Re: IWeatherSystem Service issue

Post by tauseefAhmed »

Hello Clifton,

I am using the Metar provided within the P3D. I'm usimg GLOB as the weather station for this METAR to be a Global one and not specific to a particular Weather station.

GLOB 030405Z 27007KT 15SM SKC 17/13 A2992
Post Reply