• 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.

FS2004 Three way switch problem

Messages
1,468
Country
italy
As mentioned in another thread I have an oxygen flow meter (a bar that rises and falls above 5000ft) see second code.
I also have a three way switch representing "mask test" / "normal" / "emergency"
I want the oxygen flow meter bar to also work in "test" and "emergency" (see first code)regardless of the height. I have fiddled with the switch code but can't get the L:var to work inside the flow meter gauge.
vololiberista
Code:
<Gauge Name="Oxygen Test Switch" Version="1.0">
   <Element>
      <Select>
         <Value>(G:Var1)</Value>
         <Case Value="1">
            <Image Name="OX_TEST_UP.bmp" ImageSizes="24,36"/>
         </Case>
         <Case Value="0">
            <Image Name="OX_TEST_MIDDLE.bmp" ImageSizes="24,36"/>
         </Case>
         <Case Value="2">
            <Image Name="OX_TEST_DOWN.bmp" ImageSizes="24,36"/>
         </Case>
      </Select>
   </Element>
   <Mouse>
      <Area Top="0" Bottom="35">
         <Cursor Type="Hand"/>
         <Click>1 (&gt;G:Var1)  1 (>L:oxygen_test,number)   1 (>L:Sound_click,enum)</Click>
      </Area>
      <Area Top="36" Bottom="71">
         <Cursor Type="Hand"/>
         <Click>0 (&gt;G:Var1)  -1 (>L:oxygen_test,number)   1 (>L:Sound_click,enum)   0 (>L:Sound_click,enum)</Click>
      </Area>
      <Area Top="72" Bottom="110">
         <Cursor Type="Hand"/>
         <Click>2 (&gt;G:Var1)  1 (>L:oxygen_test,number)   1 (>L:Sound_click,enum)</Click>
      </Area>
   </Mouse>
</Gauge>
Code:
<Gauge Name="Oxygen Flow Indicator" Version="1.0">
   <Image Name="oxy_flow_indicator_bg3.bmp"/>
   <Element>
      <Position X="15" Y="43"/>
      <Image Name="oxy_flow_indicator3.bmp"/>
      <Shift>
        <Value>
         (L:oxygen_test,number) 1 == if{ 2 } els{ (A:Fuel total quantity,gallons) 0 &gt; if{ (A:Indicated Altitude,feet) 5000 &gt; if{ (P:Local time,seconds) 2 % } }
         </Value>
         <Nonlinearity>
            <Item Value="0" X="11" Y="63"/>
            <Item Value="1" X="11" Y="45"/>
            <Item Value="2" X="11" Y="63"/>
         </Nonlinearity>
      </Shift>
   </Element>
   <Element>
      <Position X="0" Y="58"/>
      <Image Name="oxy_flow_indicator_cover3.bmp"/>
   </Element>
   <Mouse>
      <Tooltip ID="">Oxygen Flow Indicator</Tooltip>
   </Mouse>
</Gauge>
 
You seem to be inputing to the G:Var1 correctly {&gt;} but you're using ">" for the L: variables.
 
@Chris, it makes absolutely no difference whether > or &gt; is used. Only the < character is invalid...

Why are you setting 1 instead of 2 here?
Code:
      <Area Top="72" Bottom="110">
         <Cursor Type="Hand"/>
         <Click>2 (&gt;G:Var1)  1 (>L:oxygen_test,number)   1 (>L:Sound_click,enum)</Click>
      </Area>

Since you're never setting (L:oxygen_test,number) to be 2, it's no wonder your other gauge doesn't work when it's expecting that variable to be 2...

And I have to ask again, why use those G:Vars??? They do not pass from gauge-to-gauge, and are just another place to go wrong, with confidence...

You could just as easily used the (L:oxygen_test,number) instead of (G:Var1)...
 
Last edited:
@Chris, it makes absolutely no difference whether > or &gt; is used. Only the < character is invalid...

I've always (for the last few weeks I've been playing with XML anyway) used &gt; since I'm learning by looking at other people's gauges. Why is &gt; used at all? Throwback to FS9 or something?
 
I've always (for the last few weeks I've been playing with XML anyway) used &gt; since I'm learning by looking at other people's gauges. Why is &gt; used at all? Throwback to FS9 or something?

No, "technically" both the < and > characters are supposedly "illegal," but the reality is that the > character works just fine in this context...

The only reason I use it for >K: type constructs is because it's faster and "cleaner looking" when I glance at the script.
 
I have tried > &gt: with G:var + L:var or L:var alone and various other permutations but the flow indicator gauge never sees or doesn't act on the L:var input.
Currently for the switch I have:-
Code:
 <Click>1  (>L:oxygen_test,number)   1 (>L:Sound_click,enum)</Click>
      </Area>
      <Area Top="26" Bottom="81">
         <Cursor Type="Hand"/>
         <Click>-0   (>L:oxygen_test,number)   1 (>L:Sound_click,enum)   0 (>L:Sound_click,enum)</Click>
      </Area>
      <Area Top="82" Bottom="110">
         <Cursor Type="Hand"/>
         <Click>2  (>L:oxygen_test,number)   1 (>L:Sound_click,enum)</Click>

and for the gauge:-
Code:
 <Value> (L:oxygen_test,number) 1 == if{ 2 } els{ (A:Fuel total quantity,gallons) 0 &gt; (A:Indicated Altitude,feet) 5000 &gt; and if{ (P:Local time,seconds) 2 % } } </Value>

The gauge works perfectly above 5000ft but I still can't get it to work on the ground by using the 3 way switch to "test" it.
vololiberista
 
Hi,

Are you using the fabulous blackbox gauge to read your variables realtime in the sim?
If not, do it, it is invaluable!
It really is a great way to find out what your L:Var's and A:Var's are doing in your gauges.
You could for instance see whether or not L:oxygen_test,number is actually changing values when you click indicating that that part of the gauge is okay. This way you can quite easily find where the flaw is located.

Very, very recommended tool!!
It is free and you can find it here:
http://www.robbiemcelrath.com/blackbox/?home

Apart from that i see (>L:Sound_click,enum) being set to 1 and then immediately to 0 within the same line. I don't think you will see any change in (>L:Sound_click,enum) "netto". However this shouldn't prevent the gauge from working.
One thing i do see is more than one space before (>L:oxygen_test,number), throughout your code, and there is -0 as shown below.
Code:
 <Click>-0   (>L:oxygen_test,number)   1 (>L:Sound_click,enum)   0 (>L:Sound_click,enum)</Click>
      </Area>

I would first check whether (>L:oxygen_test,number) is actually changing when clicked, and take it from there.
If it's not i would look at the mouse click areas, the left="xx" and right="xx" are missing there, only top="xx" and bottom="xx" are mentioned. May not be a problem though, i don't know.

grt
Willem

grt
Willem
 
Hi,

Are you using the fabulous blackbox gauge to read your variables realtime in the sim?
If not, do it, it is invaluable!
It really is a great way to find out what your L:Var's and A:Var's are doing in your gauges.
You could for instance see whether or not L:oxygen_test,number is actually changing values when you click indicating that that part of the gauge is okay. This way you can quite easily find where the flaw is located.

Very, very recommended tool!!
It is free and you can find it here:
http://www.robbiemcelrath.com/blackbox/?home

Apart from that i see (>L:Sound_click,enum) being set to 1 and then immediately to 0 within the same line. I don't think you will see any change in (>L:Sound_click,enum) "netto". However this shouldn't prevent the gauge from working.
One thing i do see is more than one space before (>L:oxygen_test,number), throughout your code, and there is -0 as shown below.
Code:
 <Click>-0   (>L:oxygen_test,number)   1 (>L:Sound_click,enum)   0 (>L:Sound_click,enum)</Click>
      </Area>

I would first check whether (>L:oxygen_test,number) is actually changing when clicked, and take it from there.
If it's not i would look at the mouse click areas, the left="xx" and right="xx" are missing there, only top="xx" and bottom="xx" are mentioned. May not be a problem though, i don't know.

grt
Willem

grt
Willem

Hi Willem,
Yes I do use the blackbox gauge. It's very useful. I do in fact have a minor problem with the switch in that it is silent when switched to the central position. I'll have a closer look at the code as you have suggested. The intention of the switch is top "test/""emergency" centre "normal supply" bottom "mask test" so that's why you don't see anything for the centre!
vololiberista
 
Back
Top