FSDeveloper Community

Go Back   FSDeveloper Community > Microsoft Flight Simulator development > Aircraft Design > Gauges

Gauges Use this forum for all your gauges related discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 16 Aug 2012, 18:54
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
Gauge to display Metar data

I am looking for a way to display "current location" Cloud levels, in my own XML Gauge.

A more general purpose Gauge to display weather at any Airport would beeven better.

Note: I am looking for FSX weather, not from metars downloaded from some external source.

Initially, I am looking for a way to get Cloud Base, into a L:Var, that I can then display in my own XML gauge.

Any Ideas or Pointers (short ow writting a very comlex simconnect application , to read FSX metars !!! not an easy task -- !! )

Geoff
Reply With Quote
  #2  
Old 18 Aug 2012, 10:14
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
In hindsight, decoding FSX metars as obtained by simconnect, would appear to be one of the most COMPLEX Simconnect application, one could imagine.

Probably explains why so few have tried it, or have expereinece in this subject.

Just getting, say a simple 1st Cloud base height, into an XML Gauge, would appear to be a Massive task !!
__________________
______________________________________

Geoff



The FS-MP FSX & P3D Multiplayer Servers provide a realistic environment,
for both Pilots and Controllers to experience the challenges of flying together,
( FSMP Servers with S.A.F.E. © - Server Automatic Flood Elimination)
Reply With Quote
  #3  
Old 18 Aug 2012, 10:56
ddawson's Avatar
ddawson ddawson is offline
  canada
Location: Ottawa, Canada
Join Date: Sep 2006
Posts: 273
You're right, this is not a trivial task. I have a block of code, somewhere, to do it. Never got as far as moving the data in to XML. The efficient (although rather complex) way to do that would be to use a module, built on the Cabin Comfort example; the alternative would be to declare a few hundred L:Vars.
I'm goint to go out on a limb here, and offend all the XML programmers present. This just isn't something that XML should ever get anywhere close to...

Doug
Reply With Quote
  #4  
Old 23 Aug 2012, 11:58
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
Quote:
Originally Posted by ddawson View Post
You're right, this is not a trivial task. I have a block of code, somewhere, to do it. Never got as far as moving the data in to XML. The efficient (although rather complex) way to do that would be to use a module, built on the Cabin Comfort example; the alternative would be to declare a few hundred L:Vars.
I'm goint to go out on a limb here, and offend all the XML programmers present. This just isn't something that XML should ever get anywhere close to...

Doug
Doug

LOL .. I think most XML programmers are THICK SKINNED. (They would have to be to deal with FSX's XML !!)

Anyway... What I was wanting to do was simply add a numeical display of CLOUDBASE to a simple "GROUND RADAR" XML gauge that was already able to display other MET data, like Wind, Temperature, Viz, Rain/snow etc.

These are all readly avaiable to XML. But CLOUD info is NOT.

In Hindsight, another more UNIVERSA: solution would be to obtrain those parameters from FSUIP. ( let FSUIP do all the hard Simconnect weather decodeing)

One is then left with the problem "How to display FSUIPC variables in XML".

Maybe the answer is a more simple C++ module, that reads a Config file, containing FSUIP variables, and LVAR names, and then keeps those LVARS updated with the FSUIPC values.

(Or am I missing some easier way to read FSUIPC variables with XML ? )

If not, maybe someone already has developed a FSUIP2XML module. ?

Geoff
__________________
______________________________________

Geoff



The FS-MP FSX & P3D Multiplayer Servers provide a realistic environment,
for both Pilots and Controllers to experience the challenges of flying together,
( FSMP Servers with S.A.F.E. © - Server Automatic Flood Elimination)
Reply With Quote
  #5  
Old 23 Aug 2012, 12:22
vololiberista's Avatar
vololiberista vololiberista is offline
  italy
Location: LIMZ
Join Date: Aug 2009
Posts: 529
There is available for Fs9 a module http://library.avsim.net/search.php?...root&Go=Search

If you're any good at untangling the code within it might give you some ideas.
vololiberista
Reply With Quote
  #6  
Old 23 Aug 2012, 14:49
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
Quote:
Originally Posted by vololiberista View Post
There is available for Fs9 a module http://library.avsim.net/search.php?...root&Go=Search

If you're any good at untangling the code within it might give you some ideas.
vololiberista
File Description:
METARlive is a FS 2004 add-on module that allows you to quickly access real-world metar (weather) information for any airport that offers weather observations. METARlive appears as a single or multi-line display at the top of the main window. This module was mainly implemented due to FS's lack of ATIS availability during multiplayer sessions.

Thanks, but
NO, that gets REAL WORLD WEATHER METARS -- I am looking to get the weather that is currently in FSX, and get it out into my own XML gauge.
__________________
______________________________________

Geoff



The FS-MP FSX & P3D Multiplayer Servers provide a realistic environment,
for both Pilots and Controllers to experience the challenges of flying together,
( FSMP Servers with S.A.F.E. © - Server Automatic Flood Elimination)
Reply With Quote
  #7  
Old 23 Aug 2012, 15:19
taguilo taguilo is offline
  argentina
Location: San Isidro-BsAs
Join Date: Oct 2006
Posts: 617
Quote:
Originally Posted by Geoff_D View Post
... I am looking to get the weather that is currently in FSX, and get it out into my own XML gauge.
I think you can accomplish that just by making a C++ gauge with Simconnect calls to METAR data retrieving, then having two options for the XML side that handles the info: a bunch of single LVars or, better in my opinion, an array of XMLVars -instantiated within the C++ gauge-. Perhaps it seems quite difficult but I believe the logic should not be so complex.
Simconnect works well -in general- inside a gauge though I never tested the METAR functions; it is supposed that they should work like the rest, but....with FSX you never know till you try

Tom
Reply With Quote
  #8  
Old 23 Aug 2012, 21:45
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
Quote:
Originally Posted by taguilo View Post
I think you can accomplish that just by making a C++ gauge with Simconnect calls to METAR data retrieving, then having two options for the XML side that handles the info: a bunch of single LVars or, better in my opinion, an array of XMLVars -instantiated within the C++ gauge-. Perhaps it seems quite difficult but I believe the logic should not be so complex.
Simconnect works well -in general- inside a gauge though I never tested the METAR functions; it is supposed that they should work like the rest, but....with FSX you never know till you try

Tom
Thanks ..

Yes, you obviously have not looked at the FSX "enhansed/non-standard" metar format. A real PITA to decode !!
Thats why I was favouring going the FSUIPC way .. Clever Mr Pete has already decoded them nicely into FSUIPC variables.
__________________
______________________________________

Geoff



The FS-MP FSX & P3D Multiplayer Servers provide a realistic environment,
for both Pilots and Controllers to experience the challenges of flying together,
( FSMP Servers with S.A.F.E. © - Server Automatic Flood Elimination)
Reply With Quote
  #9  
Old 23 Aug 2012, 22:33
taguilo taguilo is offline
  argentina
Location: San Isidro-BsAs
Join Date: Oct 2006
Posts: 617
Quote:
Originally Posted by Geoff_D View Post
Thanks ..

Yes, you obviously have not looked at the FSX "enhansed/non-standard" metar format. A real PITA to decode !!
Thats why I was favouring going the FSUIPC way .. Clever Mr Pete has already decoded them nicely into FSUIPC variables.
Oh c'mon, dont tell me that you're scared by a simple string full of "&" and "@"!
IF it works, and I hope it does, shouldn't be much difficult to parse in the C++ gauge using proper functions. As I stated before, the logic should be simple even though it may need a lot of (tedious) coding.

Tom
Reply With Quote
  #10  
Old 23 Aug 2012, 22:56
ollyau ollyau is offline
  us-california
Join Date: Jan 2008
Posts: 450
Doesn't Tim (Beatle)'s SimConnect library come with a sample that can read the local METAR from FSX? Or is the issue more of decoding it?

Edit: I recalled a thread (http://www.fsdeveloper.com/forum/showthread.php?t=30290) with some code to decode a FSX METAR, but it appears the file is no longer available. Further down the thread there's a post by AndyWoz with a Pascal project intended for that purpose, though.

Last edited by ollyau; 23 Aug 2012 at 23:01.
Reply With Quote
  #11  
Old 25 Aug 2012, 12:43
taguilo taguilo is offline
  argentina
Location: San Isidro-BsAs
Join Date: Oct 2006
Posts: 617
Quote:
Originally Posted by Geoff_D View Post
I am looking for a way to display "current location" Cloud levels, in my own XML Gauge.
...
Initially, I am looking for a way to get Cloud Base, into a L:Var, that I can then display in my own XML gauge.
Ok, FSX's METAR extraction with Simconnect works fine, and it's very simple to code. Although the resulting string is a mess of numbers and control chars, the basic variables -clouds, winds, etc - are not difficult to parse at all in C++. Even they could be parsed as well using XMLVars in an XML gauge, but that's another story.
I've bult a small invisible C++ gauge that retrieves nearest airport METAR and parses its cloud types and levels, just for testing purposes. If you're interested I can send you the .dll and/or the code so you can have a reference point for your project. Or, if you are more specific on your needs, I can assign Lvar variables with METAR info inside the C++ gauge so that you can get them in your own XML code.

Tom
Attached Thumbnails
Click image for larger version

Name:	METAR.jpg
Views:	59
Size:	84.8 KB
ID:	12733  
Reply With Quote
  #12  
Old 25 Aug 2012, 21:33
ollyau ollyau is offline
  us-california
Join Date: Jan 2008
Posts: 450
Out of curiosity, I'd be interested in seeing the code.
Reply With Quote
  #13  
Old 26 Aug 2012, 07:57
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
Quote:
Originally Posted by taguilo View Post
Ok, FSX's METAR extraction with Simconnect works fine, and it's very simple to code. Although the resulting string is a mess of numbers and control chars, the basic variables -clouds, winds, etc - are not difficult to parse at all in C++. Even they could be parsed as well using XMLVars in an XML gauge, but that's another story.
I've bult a small invisible C++ gauge that retrieves nearest airport METAR and parses its cloud types and levels, just for testing purposes. If you're interested I can send you the .dll and/or the code so you can have a reference point for your project. Or, if you are more specific on your needs, I can assign Lvar variables with METAR info inside the C++ gauge so that you can get them in your own XML code.

Tom
Tom

Thanks for your generous offer of assistance. I sent you a PM with my email address.

Geoff
__________________
______________________________________

Geoff



The FS-MP FSX & P3D Multiplayer Servers provide a realistic environment,
for both Pilots and Controllers to experience the challenges of flying together,
( FSMP Servers with S.A.F.E. © - Server Automatic Flood Elimination)
Reply With Quote
  #14  
Old 02 Sep 2012, 17:06
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
Quote:
Originally Posted by ddawson View Post
You're right, this is not a trivial task. I have a block of code, somewhere, to do it. Never got as far as moving the data in to XML. The efficient (although rather complex) way to do that would be to use a module, built on the Cabin Comfort example; the alternative would be to declare a few hundred L:Vars.
I'm goint to go out on a limb here, and offend all the XML programmers present. This just isn't something that XML should ever get anywhere close to...

Doug
Doug

Having started the process of decoding the FSX metar staring, as obtained from FSX, by Simconnect, it is my impression, that the returned string does NOT contain, all the expected weather parameters, that wone would expect, even though they are displayed in the sim ??

ie The I or VC (weather conditions), Cloud Layer Thickness.

ie. If FSX airport clearly has a massive Thunderstorm overhead, there is no report of that in the returned metar string !!


Were you able to decode thses, and did you ever get any of these set, when you obtained a Weather Stations weather, via simconnect ?
__________________
______________________________________

Geoff



The FS-MP FSX & P3D Multiplayer Servers provide a realistic environment,
for both Pilots and Controllers to experience the challenges of flying together,
( FSMP Servers with S.A.F.E. © - Server Automatic Flood Elimination)
Reply With Quote
  #15  
Old 02 Sep 2012, 17:55
ddawson's Avatar
ddawson ddawson is offline
  canada
Location: Ottawa, Canada
Join Date: Sep 2006
Posts: 273
Geoff,

One thing I discovered is that all of the possible sections of the extended METAR string are not necessarily present in any given retrieved string.
I haven't looked at this project in a good long while, but I seem to recall that the data being returned were at least reasonable. I'll see if I can find the thing.

Doug


Quote:
Originally Posted by Geoff_D View Post
Doug
Having started the process of decoding the FSX metar staring, as obtained from FSX, by Simconnect, it is my impression, that the returned string does NOT contain, all the expected weather parameters, that wone would expect, even though they are displayed in the sim ??
ie The I or VC (weather conditions), Cloud Layer Thickness.
ie. If FSX airport clearly has a massive Thunderstorm overhead, there is no report of that in the returned metar string !!
Were you able to decode thses, and did you ever get any of these set, when you obtained a Weather Stations weather, via simconnect ?
Reply With Quote
  #16  
Old 02 Sep 2012, 20:52
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
Quote:
Originally Posted by ddawson View Post
Geoff,

One thing I discovered is that all of the possible sections of the extended METAR string are not necessarily present in any given retrieved string.
I haven't looked at this project in a good long while, but I seem to recall that the data being returned were at least reasonable. I'll see if I can find the thing.

Doug
While I understand that "all of the possible sections of the extended METAR string are not necessarily present in any given retrieved string", one would expect SOMWHERE in the returned string, there would be a reference to "Severe Thunderstorms", if the weather was displaying a Thunderdstom, and the ATIS for that Airport in FSX, was also reporting the thunderstorm.

It appears that while a lot of weather conditions are SETTABLE by simconnect, a much smaller subset actually get returned in a read metar string.

Will be interested to hear if you experience the same, if you find your decoder

Geoff
__________________
______________________________________

Geoff



The FS-MP FSX & P3D Multiplayer Servers provide a realistic environment,
for both Pilots and Controllers to experience the challenges of flying together,
( FSMP Servers with S.A.F.E. © - Server Automatic Flood Elimination)
Reply With Quote
  #17  
Old 02 Sep 2012, 22:25
ddawson's Avatar
ddawson ddawson is offline
  canada
Location: Ottawa, Canada
Join Date: Sep 2006
Posts: 273
Quote:
Originally Posted by Geoff_D View Post
While I understand that "all of the possible sections of the extended METAR string are not necessarily present in any given retrieved string", one would expect SOMWHERE in the returned string, there would be a reference to "Severe Thunderstorms", if the weather was displaying a Thunderdstom, and the ATIS for that Airport in FSX, was also reporting the thunderstorm.
It appears that while a lot of weather conditions are SETTABLE by simconnect, a much smaller subset actually get returned in a read metar string.
Will be interested to hear if you experience the same, if you find your decoder
Geoff
Unless I have messed up the coding, it would appear that the "Present Conditions" blocks are not being returned. You will likely have to use the "Sky Conditions" extension blocks to get the information. Those are working.

You might want to write the METAR data out to a file, and decode it by hand, just to get an idea of is being returned.

I can certainly send you the source code for the class that I wrote. It will be heavy going though - its only 2200 lines...

Doug
Reply With Quote
  #18  
Old 03 Sep 2012, 23:37
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
Quote:
Originally Posted by ddawson View Post
Unless I have messed up the coding, it would appear that the "Present Conditions" blocks are not being returned. You will likely have to use the "Sky Conditions" extension blocks to get the information. Those are working.

You might want to write the METAR data out to a file, and decode it by hand, just to get an idea of is being returned.

I can certainly send you the source code for the class that I wrote. It will be heavy going though - its only 2200 lines...

Doug
The only Parameter I see in the Metar SDK to indicate Thunderstorm, is in the PRESENT CONDITIONS IDDPP where DD can be TS for Thunderstorm.

SKY CONDITIONS CCCNNN has no parameter to indicate Thunderstorm.

Neither does it's FS Extention &TT000FTPQBBBI
"Frustrationg" when PRESENT CONDITIONS is never returned !!

------------------------------
Progress -- so far. Radar Airport Information Gauge.

__________________
______________________________________

Geoff



The FS-MP FSX & P3D Multiplayer Servers provide a realistic environment,
for both Pilots and Controllers to experience the challenges of flying together,
( FSMP Servers with S.A.F.E. © - Server Automatic Flood Elimination)

Last edited by Geoff_D; 06 Sep 2012 at 09:36.
Reply With Quote
  #19  
Old 05 Sep 2012, 12:47
taguilo taguilo is offline
  argentina
Location: San Isidro-BsAs
Join Date: Oct 2006
Posts: 617
Quote:
Originally Posted by Geoff_D View Post
The only Parameter I see in the Metar SDK to indicate Thunderstorm, is in the PRESENT CONDITIONS IDDPP where DD can be TS for Thunderstorm.

SKY CONDITIONS CCCNNN has no parameter to indicate Thunderstorm.

Neither does it's FS Extention &TT000FTPQBBBI
"Frustrationg" when PRESENT CONDITIONS is never returned !!
You can infer that a thunderstorm is present by checking the cloud type in
NTT&TT000FTPQBBBI for TT = CB, and N = broken or greater.

In the CCCNNN format , when Cumulonimbus are present the string changes to CCCNNNCB

Tom
Reply With Quote
  #20  
Old 06 Sep 2012, 10:40
Geoff_D Geoff_D is offline
  unitedstates
Join Date: Feb 2007
Posts: 366
Quote:
Originally Posted by taguilo View Post
You can infer that a thunderstorm is present by checking the cloud type in
NTT&TT000FTPQBBBI for TT = CB, and N = broken or greater.

In the CCCNNN format , when Cumulonimbus are present the string changes to CCCNNNCB

Tom
Thanks Tom.

But Ewwwwwwwwww.. Nasty !!!
So in FSX, EVERY "broken or Overcast" Cumulonimbus is causing an active Thunderstorm ??

FSX Atis seems to be able to determine if the Thunderstorm is Moderate or Severe.

Is it a case that if ANY Cumulonimbus is set in the weather, to be "broken or Overcast", it will always cause FSX to produce the Thunder/Lightening effect, or is there really a more precise control ?

The more I look at FSX weather, the less I am impressed. Hopefully Lockheed will consider correcting some of these features in later versions of P3D.

So, for the time being, I will assume, if there is "broken or Overcast" Cumulonimbus, then it is probably a Thunderstorm "in the Vicinity"

I guess this is what REAL Pilots assume as well, to be safe !!
__________________
______________________________________

Geoff



The FS-MP FSX & P3D Multiplayer Servers provide a realistic environment,
for both Pilots and Controllers to experience the challenges of flying together,
( FSMP Servers with S.A.F.E. © - Server Automatic Flood Elimination)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FSX] Display Gauge on separate screen Speedbird SimConnect 5 01 Jul 2011 11:52
[FS2004] RPM gauge show wrong data Bambi_007 Gauges 7 22 May 2011 05:32
Creating a gauge for a mission? Want my C# application to display variable on gauge! joeysipos Gauges 1 18 Aug 2009 15:11
Display a gauge in external view rightnumberone Gauges 1 22 Jan 2009 20:52
Converting Raw Digital Elevation Data Aquired aquired from USGS for FSX joeysipos FSX terrain 15 09 May 2008 20:17


All times are GMT -4. The time now is 16:05.

Kirsch designed by Andrew & Austin


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.