1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Gauge to display Metar data

Discussion in 'Gauges' started by Geoff_D, 16/8/12.

  1. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    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
  2. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    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 !!
  3. ddawson

    ddawson Resource contributor

    Joined:
    27/9/06
    Messages:
    390
    Country:
    canada
    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. :eek: This just isn't something that XML should ever get anywhere close to...

    Doug
  4. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    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
  5. vololiberista

    vololiberista

    Joined:
    24/8/09
    Messages:
    724
    Country:
    italy
  6. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    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.
  7. taguilo

    taguilo Resource contributor

    Joined:
    20/10/06
    Messages:
    934
    Country:
    argentina
    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
  8. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    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.
  9. taguilo

    taguilo Resource contributor

    Joined:
    20/10/06
    Messages:
    934
    Country:
    argentina
    Oh c'mon, dont tell me that you're scared by a simple string full of "&" and "@"!:D:D
    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
  10. ollyau

    ollyau Resource contributor

    Joined:
    5/1/08
    Messages:
    683
    Country:
    us-california
    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: 24/8/12
  11. taguilo

    taguilo Resource contributor

    Joined:
    20/10/06
    Messages:
    934
    Country:
    argentina
    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 Files:

  12. ollyau

    ollyau Resource contributor

    Joined:
    5/1/08
    Messages:
    683
    Country:
    us-california
    Out of curiosity, I'd be interested in seeing the code.
  13. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    Tom

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

    Geoff
  14. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    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 ?
  15. ddawson

    ddawson Resource contributor

    Joined:
    27/9/06
    Messages:
    390
    Country:
    canada
    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


  16. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    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
  17. ddawson

    ddawson Resource contributor

    Joined:
    27/9/06
    Messages:
    390
    Country:
    canada
    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... :eek:

    Doug
  18. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    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.

    [​IMG]
    Last edited: 6/9/12
  19. taguilo

    taguilo Resource contributor

    Joined:
    20/10/06
    Messages:
    934
    Country:
    argentina
    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
  20. Geoff_D

    Geoff_D

    Joined:
    5/2/07
    Messages:
    358
    Country:
    unitedstates
    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 !!

Share This Page