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

Almost Done!

Messages
1,468
Country
italy
If I can crack this last problem then I'll be able to concentrate on writing up the manuel for a new cockpit.
Below is the code for an oxygen flow indicator. What I would like to be able to do is to add a test facility. That is to click on a switch and that to trigger the flow meter into action. It would I assume be an L:var function and and OR function but I'm not sure how to do it.
vololiberista
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>(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="15" Y="63"/>
            <Item Value="1" X="15" Y="47"/>
            <Item Value="2" X="15" 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>
 
Hi,

hmm, i assume you know how to make a test switch, right?

Say that gives (a newly created L:Var) L:OxyTest, enum a value of 1 when pressed and 0 when released.

Next, in your Oxy flow indicator you test for the value of L:OxyTest,enum. If it's value is 1, you return the value of 2 (or whatever the value is you want to use for the oxyflow indicator test value ) into the value above your non-linearity table:
Code:
<Value> (L:OxyTest,enum) 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>

So in pseudo code:

IF L:OxyTest,enum equals 1 (test switch operated)
THEN
value 2 is returned for non-linearity, (oxyflow indicator test value)
ELSE (so L:OxyTest,enum does not equal 1 ie test switch released)
IF A:Fuel total quantity, gallons is more than 0
AND
A:Indicated Altitude is larger than 5000
THEN
the value of the P:Local time, seconds modulus magical thingy Which-I-Don't-Really-Understand-But-I-Suppose-It-Works is returned for non-linearity.

I'm not sure whether if{ 2 } will work like this though, and also i changed the nested If statement for fuel quantity and altitude into an And statement for easier reading.

If it doesn't work with the if{ 2 } you may consider creating a new Element in your gauge with yet another new L:Var which stores the above value:

Code:
  <Element>
   <Select>
   <Value>(L:OxyTest,enum) 1 == if{ 2 (&gt;L:OxyFlow,enum) } 
          els{ (A:Fuel total quantity,gallons) 0 &gt; (A:Indicated Altitude,feet) 5000 &gt; and 
              if{ (P:Local time,seconds) 2 % (&gt;L:OxyFlow,enum) } }</Value>
   </Select>
   </Element>

and you use that L:Var in the value above your non-linearity table:
Code:
<Shift>
         <Value> (L:OxyFlow,enum) </Value>
         <Nonlinearity>
            <Item Value="0" X="15" Y="63"/>
            <Item Value="1" X="15" Y="47"/>
            <Item Value="2" X="15" Y="63"/>
         </Nonlinearity>
      </Shift>

hope this helps!!

grt
Willem
 
Last edited:
Ok,

just out of curiosity, why do you include fuel quantity in the gauge?

An oxygen flow indicator is there to show errr well, oxygen flow, showing to the crew that they are using oxygen and are not breathing some other gasses.

The aircraft i know have a seperate crew oxygen bottle for that, is the VC10 different in that respect?

grt
Willem
 
Ok,

just out of curiosity, why do you include fuel quantity in the gauge?

An oxygen flow indicator is there to show errr well, oxygen flow, showing to the crew that they are using oxygen and are not breathing some other gasses.

The aircraft i know have a seperate crew oxygen bottle for that, is the VC10 different in that respect?

grt
Willem

As you know if there is an explosive decompression at altitude the temperature also drops rapidly so the crew also have to breath the fuel which they ignite in the event of a decompression and so are able to keep warm!!! :)

Actually without that fuel quantity equation the gauge doesn't work. Don't ask me why.
The gauge shows a rising and falling bar (a blinker) thus indicating oxygen is flowing to the cabin/ masks etc.


vololiberista
 

Attachments

  • blk on.jpg
    blk on.jpg
    16.1 KB · Views: 464
  • blk off.jpg
    blk off.jpg
    16.2 KB · Views: 430
Last edited:
Actually without that fuel quantity equation the gauge doesn't work. Don't ask me why.
The gauge shows a rising and falling bar (a blinker) thus indicating oxygen is flowing to the cabin/ masks etc.

vololiberista

As far as I'm aware, there are no oxygen variables in the SDK. All the aircraft I've seen that 'use' oxygen are the same;

oxygen flow = fuel flow
oxygen tank = fuel tank
 
I always code up my own oxy system using custom variables...
 
I always code up my own oxy system using custom variables...

Now you've got me thinking...
Initialise L:oxytank
update frequency = 1
if altitude 15000 &gt; L:oxytank .0005 - >L:oxytank 1 > L:flowtrue

Drat, just when I thought the project had been completed, zipped and archived.

How do you reset? key_refuel_repair? mmmm....
 
First, in an initialization section:

Code:
          <!-- SET OXYGEN SUPPLY VARIABLES -->
          120 (>L:OxyPressure,enum)
          100 (>L:OxyQty,enum)

In an <Update> section, I check the status for the Oxy-Low annunciator and reset as required when system is refilled, as well as the script to decrease Oxy Qty and Oxy Pressure when turned on (very simplistic system!):
Code:
    <!-- SET/RESET "OXY LOW" ANNUNCIATOR -->
    (L:OxyQty,enum) 20 &lt;
    (L:OxyLowFlag,bool) 0 == and
    if{ 1 (>L:OxyQtyLow,bool) 1 (>L:OxyLowFlag,bool) }

    (L:OxyQty,enum) 20 &gt;
    (L:OxyLowFlag,bool) 1 == and
    if{ 0 (>L:OxyQtyLow,bool) 0 (>L:OxyLowFlag,bool) }


    <!-- OXYGEN SYSTEM -->
    (L:T38_OxyFlowSwitch,bool)
    (P:Absolute time,seconds) 1 % 1.0 > !
    and
    if{
    (L:OxyPressure,enum) 0.001 - (>L:OxyPressure,enum)
    (L:OxyQty,enum) 0.0001 - (>L:OxyQty,enum)
    }

To "refill" I have an otherwise unused knob that may be clicked on to refill the system. Since all the needles have <Lag>, the movement is slowed down as the system "refills..." :)

Code:
  <PartInfo>
    <Name>T38_OxyFillKnob</Name>
    <AnimLength>50</AnimLength>
    <MouseRect>
      <Cursor>Hand</Cursor>
      <TooltipText>Refill Oxygen</TooltipText>
      <CallbackCode>
        120 (>L:OxyPressure,enum)
        100 (>L:OxyQty,enum)
        1 (>L:XMLSND21,bool)
      </CallbackCode>
    </MouseRect>
  </PartInfo>

Oh, btw thanks for asking. While looking stuff up I remembered that I hadn't added the timer for the "oxy use blinker". In theory, it's supposed to only display when the "demand valve" is activated (meaning the pilot took a breath!), and should be faster/slower in "blink rate" depending on the pilot's degree of stress and/or anxiety, particularly with high-G manuvers...

...but, the reality is that's far and away too bloody much effort for something it's likely NO ONE WOULD EVER NOTICE! :rotfl:

I've just added a "blink timer" for a 1 second "blink rate" and called it done!

Code:
  <PartInfo>
    <Name>T38_OxyFlowLight_ON</Name>
    <Visibility>
      <Parameter>
        <Code>
          (A:ELECTRICAL MASTER BATTERY,bool)
          (P:Absolute time,seconds) 1 % 1.0 > !
          and
          (L:T38_OxyFlowSwitch,bool)
          and
          if{ 1 } els{ 0 }
        </Code>
      </Parameter>
    </Visibility>
  </PartInfo>
 
Last edited:
So...
Vololiberista, did you get it to work then?

Just make sure there is always a little bit of fuel reserve left for the crew then!! :D

btw in my first answer i kinda asked myself a question:
I'm not sure whether if{ 2 } will work like this though, and also i changed the nested If statement for fuel quantity and altitude into an And statement for easier reading.

Well judging from Fr. Bill's last answer it seems that should work:
Code:
 <Code>
          (A:ELECTRICAL MASTER BATTERY,bool)
          (P:Absolute time,seconds) 1 % 1.0 > !
          and
          (L:T38_OxyFlowSwitch,bool)
          and
          if{ 1 } els{ 0 }
        </Code>

grt
Willem.
 
So...
Vololiberista, did you get it to work then?

Just make sure there is always a little bit of fuel reserve left for the crew then!! :D

btw in my first answer i kinda asked myself a question:


Well judging from Fr. Bill's last answer it seems that should work:


grt
Willem.

Not as yet! I'm putting together various ideas and hopefully will come up with a result in a day or two as time permits. I'm going to assume that the tank is charged on the ground. I have some graphs that indicate for how long and at what altitude the oxygen supply can be used dependent on pax number. So I will endeavour to emulate those as well.
I have to say it doesn't appear quite as complicated as your cabin pressurisation gauges! That was a super human effort on your part! But they work fantastically!
vololiberista
 
Last edited:
I have to say it doesn't appear quite as complicated as your cabin pressurisation gauges! That was a super human effort on your part! But they work fantastically!
vololiberista

So you are actually using them?
That's great to hear! Thanks for the compliment!:D

And no it's not super human, just start with the basics and keep expanding the code, adding new functionality every time.
That's not unlike your oxygen system: "hmmm what if i added altitude and crew number compensation in the oxygen usage..." ;). So what's next on the list??

Mind you, i could have given a bit more effort in keeping the code tidy instead of one big blurb of if's and elses :stirthepo, so look out for that.

grt
Willem
 
Attached, are your gauges in operation!! with the exception of the cabin height gauge they're not authentic to the VC10. And are displayed on the overhead instead of the EO's panel. Your gauges are better suited to single (sim) pilot operations!! Hope you like them. When I have the night panel running there is a great light reflection off the glass.

As regards the oxygen. I went with your original suggestion which works well. I have added a "hiss" sound to the "mask test!!" All I have to do now is to work in other parameters such as reducing pressure/temperature etc.,
Thanks for your help as always.
vololiberista
Code:
<Value>(L:oxygen_test,number) 1 == if{ 2 (A:Fuel total quantity,gallons) 0 &gt; (A:Indicated Altitude,feet) and if{ (P:Local time,seconds) 2 % } } els{ (A:Fuel total quantity,gallons) 0 &gt; (A:Indicated Altitude,feet) 5000 &gt; and if{ (P:Local time,seconds) 2 % } } </Value>
 

Attachments

  • ch.jpg
    ch.jpg
    3.7 KB · Views: 445
  • ci.jpg
    ci.jpg
    10.2 KB · Views: 476
Back
Top