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

DC-9 apu in XML problem

Messages
73
Country
yugoslavia
Hi guys!
I'm working on DC-9 panel for FS2004 as a practice for xml code learning.
Anyway I have created 3 new gauges which supposed to start APU-RPM sequence.
For that purpose I have created one non visible gauge which looks like this:

Code:
<Gauge Name="APU-RPM-CONNECTING" Version="1.0">
   <Image Name="isklj.bmp"/>
   <Value>
  1 (&gt;L:startpump,number); 
  1 (&gt;L:cutof,number);
  1 (&gt;L:starterapu,number);
  and
  and
  if{(L:APURPM,number) 1 &gt}
</Value>
</Gauge>

There I wanted to achieve that if all three variables (L:startpump,number L:cutof,number L:starterapu,number) are equal to 1 L:APURPM,number also equals to 1.
That code supposed to start needle rotation in next gauge which code looks like this:
Code:
<Gauge Name="ENG2-N1" Version="1.0">
   <Image Name="N1-N2.bmp" Luminous="Yes"/>
   <Element>
      <Position X="37" Y="27"/>
      <Image Name="N1-N2-MALA.bmp" Luminous="Yes" PointsTo="North">
         <Axis X="2.5" Y="8"/>
      </Image>
      <Rotate>
        <Value Minimum="0" Maximum="1">(L:APURPM,number) / </Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Nonlinearity>
            <Item Value="0" Degrees="0"/>
            <Item Value=".1" Degrees="-180"/>
            <Item Value=".2" Degrees="0"/>
			<Item Value=".3" Degrees="-180"/>
			<Item Value=".4" Degrees="0"/>
			<Item Value=".5" Degrees="-180"/>
			<Item Value=".6" Degrees="0"/>
			<Item Value=".7" Degrees="-180"/>
			<Item Value=".8" Degrees="0"/>
			<Item Value=".9" Degrees="-180"/>
			<Item Value="1" Degrees="0"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="130"/>
      </Rotate>
   </Element>
   <Mouse>
      <Tooltip>APU-RPM</Tooltip>
   </Mouse>
   <Element>
      <Position X="51" Y="52"/>
      <Image Name="N1-N2-VELIKA.bmp" Luminous="Yes" PointsTo="North">
         <Axis X="10" Y="47"/>
      </Image>
      <Rotate>
         <Value Minimum="0" Maximum="1">(L:APURPM,number) / </Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Nonlinearity>
            <Item Value="0" X="52" Y="7"/>
            <Item Value=".1" X="73" Y="13"/>
            <Item Value=".2" X="88" Y="27"/>
			<Item Value=".3" X="95" Y="46"/>
			<Item Value=".4" X="94" Y="66"/>
			<Item Value=".5" X="81" Y="82"/>
			<Item Value=".6" X="63" Y="93"/>
			<Item Value=".7" X="42" Y="94"/>
			<Item Value=".8" X="23" Y="85"/>
			<Item Value=".9" X="11" Y="69"/>
			<Item Value="1" X="7" Y="50"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="40"/>
      </Rotate>
   </Element>
   <Mouse>
      <Tooltip>APU-RPM</Tooltip>
   </Mouse>
</Gauge>

The problem is that needles in second gauge are not rotating.
I just want someone to check those two codes for me please, and tell me what am I doing wrong here.
And here is one small present for U :

PANEL.jpg


overhead-rasha.jpg


Hope some of you are going to help me since this is my first serious panel project and because I have already done a lot of hard work...

Thanks in advance

Rasha
 
There is nothing in your script that will increment your {(L:APURPM,number) from 0 to 1 in +0.1 increments...

Although why you choose to use tenths instead of whole numbers is a mystery, you must still have a section that will increment the variable... ;)

Code:
<Value>
  (L:startpump,number) 1 ==
  (L:cutof,number) 1 ==
  (L:starterapu,number) 1 ==
  (L:APURPM,number) 0.9 &lt;
  and
  and
  and
  if{ (L:APURPM,number) 0.1 + (>L:APURPM,number) }
</Value>

The above will check the three conditions you've set, as well as the condition of the L:APURPM,number variable. If all conditions are TRUE, then the L:APURPM,number variable will increase by 0.1 every cycle (18Hz).

This will be about 5.5 seconds which is a bit fast! To slow the sequence down a bit, simply change the incremental amount to say 0.05 which will double the time. Change the target of the condition to 0.95 in such case.

You do not really need a third "hidden" gauge for this section, as it could easily be included in either one of the "real" display gauges... ;)

OTOH, if your intention was to rely on the <Delay> to provide the animation, simply fixing the syntax errors in your original code should work also:

Code:
<Value>
  (L:startpump,number) 1 ==
  (L:cutof,number) 1 ==
  (L:starterapu,number) 1 ==
  and
  and
  if{ 1 (>L:APURPM,number) }
</Value>
 
Last edited:
Oh yes, I should point out that you are allowed to have only ONE <Mouse> section in any gauge...
 
Thanks Bill!
I'll try those codes to see what is going to happened.
I'm still new in gauge design and trying to gather as much information from various sites, forums etc., anyway I learned some new tricks reading your reply.:cool:
 
Problem again

Hy guys!
Here's one more thing that I just don't understand.
I was trying Bill's way of creating gauges that will respond to value change but I just don't get the proper result.
My idea was to create indication light which will indicate that APU is active and produces electricity (with delay).
To achieve that I have created two gauages.

This is the code of my first gauge which I have placed on main panel:
Code:
<Gauge Name="APU-electricity" Version="DC9" Author="RASHA">
   <Image Name="isklj.bmp" ImageSizes="24,24"/>
     <Element>
      <Element>
         <Position X="1" Y="0"/>
         <Value>
  (L:startpump,number) 1 ==
  (L:cutof,number) 0 ==
  (L:starterapu,number) 1 ==
  (L:APUELECTRIC,number) 0.9 &lt;
  and
  and
  and
  if{ (>L:APUELECTRIC,number) 0.1 +) }
</Value>
      </Element>
 </Element>

   <copyright>RASHA</copyright>
</Gauge>


Following gauge is an indication light:

Code:
<Gauge Name="APU-electricity-awailable" Version="DC9" Author="RASHA">
   <Image Name="APU-PWR-AWAIL0.bmp" ImageSizes="38,35"/>
   <Element>
      <Visible>(A:Circuit general panel on, bool)</Visible>
      <Element>
         <Position X="1" Y="0"/>
         <Select>
            <Value>(L:APUELECTRIC,number)</Value>
            <Case Value="1">
               <Image Name="APU-PWR-AWAIL.bmp" Bright="Yes" ImageSizes="38,35"/>
            </Case>
         </Select>
      </Element>
   </Element>
   <copyright>RASHA</copyright>
</Gauge>

Anyway indication light doesn't appear when following variables are correct. Seams like FS doesn't read my first gauge. Why is this happening? What am I doing wrong?

I have one more question.
Is there a way to make blinking light which will indicate that autopilot is "off". To make it simpler.... what is the way to create a blinking gauge?

Guys please don't be mad at me because I maybe ask stupid questions? Please keep in mind that I'm learning xml code by reading tutorials, reading forums, editing some gauges... It sometimes get too confusing.
TNX for understanding me.
 
<Value>
(L:startpump,number) 1 ==
(L:cutof,number) 0 ==
(L:starterapu,number) 1 ==
(L:APUELECTRIC,number) 0.9 &lt;
and
and
and
if{ (>L:APUELECTRIC,number) 0.1 +) }
</Value>

The part of the code in bold is wrong. You must write

if{ (L:APUELECTRIC,number) 0.1 + (>L:APUELECTRIC,number) }

Is there a way to make blinking light which will indicate that autopilot is "off". To make it simpler.... what is the way to create a blinking gauge?

Just look here:

http://forums.flightsim.com/fswiki/index.php/Code_Samples:_Blink_Timer#To_Script _a_Blink_Timer:


Tom
 
Hi Tom!
I have just tested your correction but my gauges still doesn't work.
First gauge now looks like this:
Code:
<Gauge Name="APU-electricity" Version="DC9" Author="RASHA">
   <Image Name="isklj.bmp" ImageSizes="24,24"/>
     <Element>
      <Element>
         <Position X="1" Y="0"/>
         [COLOR="Red"]<Value>
  (L:startpump,number) 1 ==
  (L:cutof,number) 0 ==
  (L:starterapu,number) 1 ==
  (L:APUELECTRIC,number) 0.9 &lt;
  and
  and
  and
  if{ (L:APUELECTRIC,number) 0.1 + (>L:APUELECTRIC,number) }
</Value>[/COLOR]
      </Element>
 </Element>

   <copyright>RASHA</copyright>
</Gauge>

Second one looks the same:

Code:
<Gauge Name="APU-electricity-awailable" Version="DC9" Author="RASHA">
   <Image Name="APU-PWR-AWAIL0.bmp" ImageSizes="38,35"/>
   <Element>
      <Visible>(A:Circuit general panel on, bool)</Visible>
      <Element>
         <Position X="1" Y="0"/>
         <Select>
            <Value>(L:APUELECTRIC,number)</Value>
            <Case Value="1">
               [COLOR="Red"]<Image Name="APU-PWR-AWAIL.bmp" Bright="Yes" ImageSizes="38,35"/>[/COLOR]
            </Case>
         </Select>
      </Element>
   </Element>
   <copyright>RASHA</copyright>
</Gauge>

So when I turn on (L:startpump,number) and (L:starterapu,number)switches, and (L:cutof,number) remains in off position second gauge still doesn't show APU-PWR-AWAIL.bmp.

Anyway tnx for the blinking gauge tutorial.
 
This is happening because (L:APUELECTRIC,number) get stuck at 0.9 so <Case Value="1"> never applies.

Check your code and make the proper change :)

Tom
 
Does it mean that I need to change this lines of code:

Code:
 <Value>
  (L:startpump,number) 1 ==
  (L:cutof,number) 0 ==
  (L:starterapu,number) 1 ==
  (L:APUELECTRIC,number) 0.9 &lt; [COLOR="Blue"][B]1 &lt instead of 0.9 &lt[/B][/COLOR]
  and
  and
  and
  if{ (L:APUELECTRIC,number) 0.1 + (>L:APUELECTRIC,number) }
</Value>

After getting frustrated with the firs example I have tried different approach with Bill's example code:
Code:
<Value>
  (L:startpump,number) 1 ==
  (L:cutof,number) 0 ==
  (L:starterapu,number) 1 ==
  and
  and
  if{ 1 (>L:APUELECTRIC,number) }
</Value>
With no results of course!!!! OMG!!!
Why?!?!?!
:mad:
 
I have finally found the cause of strange gauge behavior, to be more precise I found where I have made mistakes.
Now I have working APU and APU annunciation lights!!!! YEAH!!!
TNX million times!!!
:wave::wave::wave::wave::wave::wave:
 
Back
Top