• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

3 Parameters Groups; How?

Messages
10,158
Country
us-arizona
If one wished to have a gauge have 3 equasions, and they have outside parameters (Temps/RPM), how does one go about doing the 'bracketry' for such a gauge.

The Element would be called Engine OverLimit and is part of an Annunciator panel of lights. This light would come on when you peak limits on the ITT, Torque, and Turbine N2%.

The following is the code for the Visibility parameters.


Code:
(L:TURB ENG ITT, celcius) 870 > 

(L:TURB ENG MAX TORQUE PERCENT) 4000 >

(L:TURB ENG N2, percent) 101 >

Sorry for bothering you all with this. I am not sure on how many Brackets to use, nor what style of them either as their are 2 that are used, and you usually have 'and' at the end before </Visibility). Thought I had best ask rather then spend 3 days trying to get it to work, lol. Oh to be in kindergarten again.. arrghh.


Bill
LHC
 
If I understand you right, you want to test all three conditions are true and execute something depending on that?

If so, then it goes like this:

<Value>
(L:TURB ENG ITT, celcius) 870 &gt;
(L:TURB ENG MAX TORQUE PERCENT) 4000 &gt; &amp;&amp;
(L:TURB ENG N2, percent) 101 &gt; &amp;&amp;
if{
..do the biz here..
}
</Value>

This is like in C saying:

if (( ITT > 870) && (torque > 4000) && (n2 > 101))
{
..do magic..
}

Where && means logical AND, so "do magic" if first equation is true AND second equation is true AND third equation is true. But remember that it's postfix so my XML above is evaluating the first two conditions, checking them both against true and then evaluating the third and checking that against the outcome of the first AND. So it's really like: if ( (A and B) and C ) then do magic.

It gets more complicated where you have ORs in there as well and you have to start nesting brackets. It's easy to sort out in normal postfix but only a real masochist would enjoy it in XML. (It beats me why MS promote this methodology, but there you go...)

You really do need to get InfixToPostfix from the FSX Deluxe SDK. Even if you're developing for FS9, it'd be worth buying FSX if you can get it cheap and install it just for that SDK tool, if you really want to get into XML.

Personally, I spent about two weeks making gauges in XML before I couldn't stand the pain any longer and dived straight into C. But then I write C for a living so perhaps I'd have found that learning curve steeper than XML if I'd started from scratch.

Oh, I'm rambling. Sorry, it's late. Hope I answered your question!

Si
 
Last edited:
Here's a "cleaner way" to write the same script:

Code:
<Value>
  (L:TURB ENG ITT, celcius) 870 &gt; 
  (L:TURB ENG MAX TORQUE PERCENT) 4000 &gt;
  (L:TURB ENG N2, percent) 101 &gt;
  and
  and
  if{
     ..do the biz here..
    }
</Value>

I find it much easier to read and interpret by placing the "operators" at the end of the stack. The first "and" works on the first two expressions, and the final "and" works on the results of the previous operation and the third expression.

Of course Si is correct, that tool is terrific...

...if you actually know "C# like in-fix notation." :mischievo

If you don't have any background in any C-like language though, it's not really much of a help. :eek:
 
Last edited:
It's easy to sort out in normal postfix but only a real masochist would enjoy it in XML. (It beats me why MS promote this methodology, but there you go...)

They recognize the difficulty, so LUA will be an alternative for FSvNext... ;)
 
Ugh.. I hate scripting languages. Are they all sandal-wearing script-hippies in Seattle? Gimme C or assembler any day. If they drop C gauge support in favour of LUA then I'm outta here!

Si
 
Many thanks Simon and Bill.

I would simply put in 'bool' then in the 'biz' section between the { and } brackets.

Ok, I have opened up Infix. Looks impressive. The 'InFixHelp' file text explains some things well just in the sample/translation. The part (where I have been running into now and then) like the last equasion actually 'hurts' my mind, lol.. But the translation made it totally logical. Good to see....

My next question must now be 'use of brackets....' In Algebra, we would put all works of 'one' equation in brackets, and another in brackets, where those two equations are done 'in the brackets first), then against each other 'bracket section against bracket section'. So I am going to assume that ( and ) are used in normal circumstances. But when does one use { and } and 'why' would one use these? What is their purpose?

............and dare I ask about this thing ' % ' Why can it be found 'acting' like a bracket?


(reminds me of breaking down sentences into sentence structures.. eeeeks! ).


Bill
 
Ugh.. I hate scripting languages. Are they all sandal-wearing script-hippies in Seattle? Gimme C or assembler any day. If they drop C gauge support in favour of LUA then I'm outta here!

Si

No one said a thing about dropping C. If it appears at all, LUA will simply be another option from which to choose... :rolleyes:
 
Ok.. I think I have it now. I even added another parameter as well.


Code:
<Visible>
(A:TURB ENG ITT, celsius) 870 &gt; 
(A:TURB ENG MAX TORQUE PERCENT, foot pounds) 2500 &gt; 
(A:TURB ENG1 N1, percent) 99 &gt; 
(A:Prop1 RPM,RPM) 1721 &gt; 
and 
and 
and
</Visible>

I changed it from a Value to a Visible, thus it didnt need a Bool.. (temporarily ludicrous I guess), and I slipped in another 'and' in the deck of bits.

Wooo hoooo!


Bill
LHC
 
I changed it from a Value to a Visible, thus it didnt need a Bool.. (temporarily ludicrous I guess), and I slipped in another 'and' in the deck of bits.

LHC

Well, <Visible> actually returns a "bool" value to make the element visible ( if it is >=1 or <= -1 ) or not (if it is < 1 and > -1)

Tom
 
No one said a thing about dropping C. If it appears at all, LUA will simply be another option from which to choose..
I was just thinking about a thread I read on Avsim about it. But I shouldn't have wandered off topic anyway. Apologies to the original poster.

Si
 
No worries Simon.

Learning alot here. I know the big thing is C. Good to know the direction that FS is going, be it bitmaps, mesh limits, or gauge formats.


Bill
LHC
 
Back
Top