• 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 2D gauges

euroastar350

Resource contributor
Messages
839
Country
us-delaware
Hi guys,

I'm looking for ways to improve my XML gauges and most of my turbine gauges uses degrees to rotate the needle.

An example of my gauge code:

Code:
<Element>
      <Position X="250" Y="250"/>
      <Image Name="oil_condition_needle.bmp" Luminous="No" PointsTo="East">
         <Axis X="30" Y="10"/>
      </Image>
      <Rotate>
         <Value Minimum="0" Maximum="150">(A:General Eng1 Oil Temperature, celsius)</Value>
         <Nonlinearity>
            <Item Value="0" Degrees="-36"/>
            <Item Value="50" Degrees="-70"/>
            <Item Value="100" Degrees="-113"/>
            <Item Value="150" Degrees="-145"/>
         </Nonlinearity>
         <Delay DegreesPerSecond="25"/>
      </Rotate>
   </Element>

Some gauges use the X & Y positions to rotate the needle in the gauge, but I have zero idea on getting the X & Y position so I can make them rotate and half of my gauges don't behave like they should when using the above method. Is there a tutorial anywhere that explains setting gauge needles using the X & Y positions? I am using photoshop to get the number of degrees the needle(s) are set at a given value on the gauge, but it's more time consuming as the gauges sometime don't behave as they should. Any help is greatly appreciated.
 
I want my gauges to use X & Y coordinates for needle rotation.

An example gauge code

Code:
<Element>
        <Position X="102" Y="133"/>
        <Image Name="hc412_smgauge_needle_1.bmp" Luminous="No" PointsTo="East">
            <Axis X="13.5" Y="13.5"/>
        </Image>
        <Rotate>
            <Value Minimum="-5" Maximum="150">
            (A:Circuit general panel on, bool) 1 ==
            if{
            (A:General Eng2 Oil Temperature, celsius)
            }
            els{ -5.0 }
            </Value>
            <Nonlinearity>
                <Item Value="-5" X="85" Y="195"/>
                <Item Value="0" X="57" Y="173"/>
                <Item Value="50" X="44" Y="137"/>
                <Item Value="150" X="82" Y="77"/>
            </Nonlinearity>
            <Delay DegreesPerSecond="25"/>
        </Rotate>
    </Element>
 
Since you use Photoshop, just hover the cursor over the point where you wish to read the coordinates, and then look in the upper right corner to read the precise x and y coordinate values. Granted, this is not a dial, but it does show where the x,y coordinates may be seen in the Info tab of Photoshop. Using this Info box, hover the mouse cursor over one of the major index lines, and write down the x and y values. Use these values to construct your Non-Linearity table:
oCwwm.jpg
 
To slightly expand on how I do this with steam gauges, load the gauge background bitmap into your paint program. Then point to the 0 tick mark with your mouse, and write down 0 and the x and y pixel location numbers. Then move the mouse to the next major tick mark (let's call it 5) and write down 5 and those x and y numbers. I use the middle of each tick mark, but it's not critical. Continue around the gauge until you are back at the 0 tick. Now enter all of these into your Nonlinearity table.
 
Here's an example of a P7 gauge with two dial faces. One measures the pressure in inches and the smaller in tenths. The smaller dial obviously therefore spins faster. <Position X="675" Y="451"/> indicates the pivot point of the needle (not shown) on the main dial face. <Axis X="32" Y="115"/> is the pivot point of the needle image itself.
The </Nonlinearity> values are those calculated within the <Value> lines. The numbers in " " are the tested values and the x y numbers are the x y positions on the main dial face.
Code:
<Gauge Name="Engine 1 P7" Version="1.0">
   <Image Name="P7_back.bmp" Luminous="1"/>
//-------------------------------------
    <Element>
      <Position X="675" Y="451"/>
      <Image Name="needle_p7_small.bmp" Luminous="1" PointsTo="North">
         <Axis X="32" Y="115"/>
      </Image>
      <Rotate>
         <Value>(L:Eng_1_P7,number)</Value>
         <Nonlinearity>
            <Item Value="0" X="671" Y="339"/>
            <Item Value="9.9" X="665" Y="339"/>
         </Nonlinearity>
        
      </Rotate>
   </Element>

<Element>
      <Position X="437" Y="451"/>
      <Image Name="Needle_P7_large.bmp" Luminous="1" PointsTo="South">
         <Axis X="89" Y="102"/>
      </Image>
      <Rotate>
         <Value>(L:Eng_1_P7,number)</Value>
         <Nonlinearity>
<Item Value="0" X="820" Y="451"/> 
<Item Value="20" X="606" Y="776"/>
<Item Value="40" X="203" Y="729"/>
<Item Value="60" X="80" Y="337"/>
<Item Value="80" X="395" Y="71"/>
<Item Value="100" X="766" Y="263"/>     
         </Nonlinearity>
         <Delay DegreesPerSecond="70"/>       
      </Rotate>
   </Element>
 
//--------------------------------------
   <Mouse>   
         <Tooltip>Engine 1 P7: %((L:Eng_1_P7,number))%!4.2f! ins%</Tooltip> 
   </Mouse>
</Gauge>

face.jpg
 
Back
Top