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

rotation absent gauge engine

Messages
126
Country
italy
I tried to model a gauge EPR compared to the value of N1.
Unfortunately, after several tests and modifications not working. Can you help me figure out what is wrong? I'm trying to be more than 6 months .........:banghead::banghead::banghead::banghead:


<Image Name="ENG_ND.bmp" Luminous="Yes" PointsTo="East" ImageSizes="78,16">
<Axis X="11" Y="8" />
</Image>
- <Rotate>
<Value Minimum="1.0" Maximum="1.8">
(L:Epr, number) 1.164 &lt;=
if{ (L:Epr, number) 69.091 * 5.7273 - (>L:N1_Value, number) }
els{ (L:Epr, number) 348.98 * 331.65 - (>L:N1_Value, number) }
</Value>
- <Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0" />
</Failures>
- <Nonlinearity>
<Item Value="1.0" X="9" Y="43" />
<Item Value="1.1" X="30" Y="19" />
<Item Value="1.2" X="59" Y="5" />
<Item Value="1.3" X="91" Y="5" />
<Item Value="1.4" X="119" Y="19" />
<Item Value="1.5" X="141" Y="44" />
<Item Value="1.6" X="146" Y="74" />
<Item Value="1.7" X="139" Y="105" />
<Item Value="1.8" X="119" Y="130" />
</Nonlinearity>
 
Potential problems:

No space in (L:Epr, number) 1.164 &lt;= between &lt; and =
Lines like - <Rotate> should perhaps not have a - at the start.
If the command (>L:N1_Value, number) removes that value from the stack (I don't know this), then there is no value left in the <Value> statement. If so, then you would need to add a (L:N1_Value, number) just before the </Value> statement. Unless you need to use this L: variable somewhere else, there is no reason to store the Value in there.
 
I may be wrong, often am when it comes to gauge coding, yet I was under the impression <= didn't work. It isn't listed in the SDK.

Maybe try...

(L:Epr, number) 1.165 <

cheers,
Lane
 
I may be wrong, often am when it comes to gauge coding, yet I was under the impression <= didn't work. It isn't listed in the SDK.

Maybe try...

(L:Epr, number) 1.165 <

cheers,
Lane
&lt;= is a proper XML operator for less than or equal to.

You are right that the XML parser objects to a "<" used in an operator. It expects that what follows is tag name like <Element>. The parser doesn't have the same objection to the use of ">", which works for greater than, and to write an L:Var, (>L:Variable, number).

In my opinion, it's a best practice to write &lt; for less than and &gt; for greater than, just for the sake of consistency.
 
My question is, where is (L:Epr, number) getting a value? There is no sim variable (A:simvar,unit) anywhere in your script. :scratchch
 
You need to provide a duplicated (L:Epr, number) value in line 6 for the Nonlinearity table to work with. Play with this:-


Code:
<Gauge Name="testepr" Version="3.1" Author="Edward Cook">

    <Image Name="ENG_NDbak.bmp" ImageSizes="154,154"/>  (* Just for testing *)

  <Element>
      <Position X="72" Y="72"/>

    <Image Name="ENG_ND.bmp" Luminous="Yes"  ImageSizes="78,16">
      <Axis X="11" Y="8" />
    </Image>
   <Rotate>
     <Value Minimum="1.0" Maximum="1.8">
     (L:Epr, number) d 1.164 &lt;=      (* duplicate Epr to get a value to read *)
         if{ (L:Epr, number) 69.091 * 5.7273 - (>L:N1_Value, number) }
         els{ (L:Epr, number) 348.98 * 331.65 - (>L:N1_Value, number) }
     </Value>
     <Nonlinearity>
        <Item Value="1.0" X="9" Y="43" />
        <Item Value="1.1" X="30" Y="19" />
        <Item Value="1.2" X="59" Y="5" />
        <Item Value="1.3" X="91" Y="5" />
        <Item Value="1.4" X="117" Y="14" />
        <Item Value="1.5" X="138" Y="37" />
        <Item Value="1.6" X="148" Y="67" />
        <Item Value="1.7" X="144" Y="96" />
        <Item Value="1.8" X="130" Y="121" />
     </Nonlinearity>
   </Rotate>
  </Element>

<Mouse>   (* Just for testing *)
   <Tooltip>eprNo> (%((L:Epr, number))%!2.2f!)%</Tooltip>
    <Cursor Type="Hand" />
  <Click Repeat="Yes">(L:Epr, number) 0.01 + 1 max 1.8 min (>L:Epr, number)</Click>
</Mouse>

</Gauge>

Hope this helps, Ted.
 
Back
Top