XML gauge help
Results 1 to 5 of 5

Thread: XML gauge help

  1. #1

    XML gauge help

    Can someone help me understand the structure of XML a little bit more ? Specifically, in the IF / ELS structure can you have another IF / ELS structure within it ? It seems like you can't have an ELS within a larger IF / ELS construct, but I'm thinking you can have multiple and if statement within one.

    Also when it comes to the command (S0:, etc) 'subroutines', is there an equivalent 'return' command once the subroutine finishes, or is it automatically returned back to the original routine just after the S0: command was run ? Does it return at all ?
    "May fortune favor the foolish"
    MaddogK

  2. #2
    Redding Army Airfield Allen's Avatar
    Join Date
    Dec 2007
    Location
    O85 Benton Field Airport
    Age
    36
    Posts
    5,462
    Those are English words but they don't make since to me in that order. I, eh Maybe someone over on FSDeveloper can help?
    "Let Being Helpful Be More Important Than Being Right!" Some SOH Founder.

  3. #3
    MANY cobwebs here, but I recall something with regards to the "S0" commands.

    They basically "store" the information, if I recall correctly. You can have up to 10 commands or data instructions (S0 - S9) which can then be "recalled" by using the "L0" script.

    The "S" is for "store" while the "L" is for "Load" in the case of these xml gauges. Just remember that in many cases it's written as "s0" and "l0" where the letters are lower-case.

    Let's say you run a multiplier like 2 x 4 = 8 in your script. You could then write the s0 command after it to store the answer. Then, when you needed the answer in a further line down the road, you'd place l0 at the beginning of that line where you needed the answer to be used. If you needed it to be used further down the line, then you would just place the l0 further down the equation.

    My syntax probably stinks, but here goes:

    * 2 4 s0

    That should "store" the number 8 in your xml. When you're ready to use the answer you could write:

    / 16 l0

    which would give you an answer of "2" in the end.

    At least I think that's the way to do it, anyway.

    The "store" and "load" are well suited for the "logic" stuff since they can help you compare numbers/values by calling up the answer to a previous equation. Nice for performance, if you have failures, navigation information, etc.

    As for the "logic" statements, well, that's another story. I did some work with folks to put out a LORAN gauge for FS9 a while back, but my work was mostly the manual and the graphics. The gist I remember for the "if/else" statements and lines is that "if" is followed by what you want to test (i.e. whether a station is in range of the aircraft). The "else" is what you would like if the value isn't what you want in the "if" statement (i.e. if the aircraft is within 500 nm then the station is in range, else it is not and you don't have a signal).

    If I remember correctly, you can "store" the answer of one if/else statement and then "load" it down the line with another if/else statement to have a sort of "compound" statement. Just can't really remember the how.

    Again, I'm VERY, VERY rusty on this since it's been a while. With stuff going on at home I barely have time to contribute any more, but thought I'd try to help with what little I remember.

    Like Allen said, you're better off trying to see if FSDeveloper folks can help on this since this is right down their alley.

    Good luck!

    Jorge
    Miami, FL

  4. #4
    Quote Originally Posted by MaddogK View Post
    Can someone help me understand the structure of XML a little bit more ? Specifically, in the IF / ELS structure can you have another IF / ELS structure within it ? It seems like you can't have an ELS within a larger IF / ELS construct, but I'm thinking you can have multiple and if statement within one.

    Also when it comes to the command (S0:, etc) 'subroutines', is there an equivalent 'return' command once the subroutine finishes, or is it automatically returned back to the original routine just after the S0: command was run ? Does it return at all ?
    Maddog, 2 masters of xml who i can think of are Hiroshi Igami, and Edward Cox. Theyre your best bet. Hiroshi can be a bit diffcult to understand sometimes due to his native language, but once you know what hes talking about it all makes sense.

    Ed will give out advice, but only if youre willing to listen and learn, he also doesnt reply as often as H does. You can contact them both via Facebook.
    Alex

    Brisbane, Australia

  5. #5
    Thanks guys, I do appreciate the help. I have never attempted something as complex as what I'm trying to do, so 'stacking' these commands is a bit tricky for me, and I've started to learn what works and what doesn't. Basically I'm taking the state of two variables (on/off from 2 switches) to control 3 sound sequences, and my second sound sequence triggers a counter that once expires triggers the third sequence. What I discovered is:
    1. the entire sequence has to be contained in 1 element
    2. If{ bla bla bla) starts the sequence.
    3. An and if{ bla bla bla} following the If{} only seems to trigger the first argument in the 'and if{}' statement
    4. an Els{bla bla bla} MUST be the last statement in the sequence
    5. Then the entire element starts over again which many times resets the second sound thats currently playing back to the first sound that already played.
    Truth be told, I'm not a coder but I was pretty good with basic back in the day and I'm hesitant about asking at FSDeveloper and showing I'm a complete noob (or worse, an idiot).
    "May fortune favor the foolish"
    MaddogK

Members who have read this thread: 30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •