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

Placing Needles

Messages
70
Country
unitedkingdom
good morning

I hope everyone had a nice Christmas/holiday.

I was going through sdgau36, and I am trying to get my needles placements right. But they are all over the place or not rotating correctly.

Is their an easier way to get the placement right?

so far I have tried to use the figures Gimp gives me when i move the mouse to the location I want.

I have also tried using the algorithms used in sdgau36.

and the hit and miss guess by changing numbers re compiling and then reloading the aircraft. (i have had success from this).

It seems to me that it is using the temporary texture from $sd360.bmp. But I am not 100% sure.

Thank you and have a happy new year
Daniel
 
Here is some xml code for a brake pressure gauge with two needles. The left one rotates clockwise and the right one anti-clockwise. The needle rotation is controlled by the <Nonlinearity> sections.

As for placing the needles you need to look here
<Position X="35" Y="155"/>
<Image Name="hydr_press_left_needle.bmp" PointsTo="East" UseTransparency="Yes" Luminous="1">
<Axis X="-64" Y="6"/>
</Image>

The position is the xy point on the face of the gauge that you want to place the needle. PointsTo="East" refers to the bmp image of the needle. In this case the bmp needle image points to the right. <Axis X="-64" Y="6"/> <Axis X="120" Y="6"/> refers to the point on the needle bmp that is the rotation axis. As I am using the same needle bmp to point in different directions I have to use a negative number for one of them as you can see.

Code:
<Gauge Name="brake_pressure" Version="1.0">
  <Image Name="hydraulic_pressure_background.bmp"  Luminous="1"/>
 
  <!-- ========================= Brake Pressure Gauge ========== -->
  <Element>
    <Position X="35" Y="155"/>
    <Image Name="hydr_press_left_needle.bmp" PointsTo="East" UseTransparency="Yes"  Luminous="1">
      <Axis X="-64" Y="6"/>
    </Image>
    <Rotate>
      <Value Minimum="0" Maximum="100">(A:Brake Left Position, percent)</Value>
      <Nonlinearity>
         <Item Value="100" X="121" Y="69"/>
         <Item Value="50" X="156" Y="156"/>
         <Item Value="0" X="121" Y="243"/>
      </Nonlinearity>
<Delay DegreesPerSecond="60"/>
    </Rotate>
  </Element>
 
    <Element>
      <Position X="275" Y="155"/>
      <Image Name="hydr_press_right_needle.bmp" PointsTo="West" UseTransparency="Yes"  Luminous="1">
        <Axis X="120" Y="6"/>
      </Image>
      <Rotate>
        <Value Minimum="0" Maximum="100">(A:Brake Right Position, percent)</Value>
        <Nonlinearity>
           <Item Value="0" X="188" Y="243"/>
           <Item Value="50" X="156" Y="156"/>
           <Item Value="100" X="188" Y="69"/>
        </Nonlinearity>
<Delay DegreesPerSecond="60"/>
      </Rotate>
    </Element>
 
  <Mouse>
    <Tooltip>Brake hydraulic pressure</Tooltip>
  </Mouse>
</Gauge>
 
good morning
I hope everyone had a nice Christmas/holiday.
I was going through sdgau36, and I am trying to get my needles placements right. But they are all over the place or not rotating correctly.
Is their an easier way to get the placement right?
so far I have tried to use the figures Gimp gives me when i move the mouse to the location I want.
I have also tried using the algorithms used in sdgau36.
and the hit and miss guess by changing numbers re compiling and then reloading the aircraft. (i have had success from this).
It seems to me that it is using the temporary texture from $sd360.bmp. But I am not 100% sure.
Thank you and have a happy new year
Daniel

C/C++ gauges are generally compiled using a needle bitmap that is oriented horizontally, the "Points to: East" that Vololiberista refers to.
If you take this example:
Code:
MAKE_NEEDLE(Needle1,Rec1,NULL,NULL,IMAGE_USE_ERASE | IMAGE_USE_TRANSPARENCY | BIT7,0,
151,151,
4,11,
TURB_ENGINE_1_N1,
needle_callback1,Nonlin2,5)
The 151,151 numbers refer to the point on the background bitmap around which the needle will rotate, the first is the X coordinate, counted in pixels, from the left hand edge. The second is the Y coordinate, again in pixels, counted from the top.
The second set of numbers, in this case 4,11 refer to the points on the needle bitmap around which it will rotate, again, the first is the X coordinate, counted from the left, and the second is the Y coordinate, counted from the top.
Also keep in mind that non-linearity tables, read from top to bottom, always describe clockwise rotation around the gauge face, so if you have a gauge whose "normal" rotation is from higher numbers to lower numbers, then that is how your non-linearity table should be constructed (highest value first, lowest value last.)

Doug
 
Back
Top