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

Help needed

Messages
39
Country
finland
Hello:wave:
I am a newbie on gauges.:cool:
I am trying to make an airspeed indicator but i can´t get the gauge to appear in fs9.
Is this xml-code correct?
 
Last edited:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
I'm not surprised. You must use the ENGLISH XML names and tokens, and Capitalization is critical.

Image - not image
X - not x
North - not north
Rotate - not rotare
Value - not vaule
mile per hour, miles per hour, mph - not mp/h
Cursor Type= - not cursor type=

Code:
<Gauge Name="spd_test_mph" Version="1.0">
 <Image name="erc_spd_01.bmp"/>

 <Element>
  <Position X="200" Y="202"/>
   <image name="erc_spd_02.bmp">
    <Axis x="14" y="152" PointsTo="north"/>
   </image>
  <rotare>
   <vaule minimum="0" Maximum="300">(A:Airspeed indicated, mp/h) 100 /</vaule>
    <Nonlinearity>
     <Item vaule="0" X="200" Y="60"/>
     <Item vaule="40" x="227" Y="48"/>
     <Item vaule="75" x="338" Y="126"/>
     <Item vaule="100" x="357" Y="222"/>
     <Item vaule="140" x="273" Y="344"/>
     <Item vaule="200" x="91" y="321"/>
     <Item vaule="250" x="41" y="182"/>
     <Item vaule="300" X="113" Y="67"/>
    </Nonlinearity>
   </rotare>
 </Element>

 <Mouse>
  <Area Left="75" Right="350" Top="70" Bottom="340">
   <Tooltip ID="TOOLTIPTEXT_AIRSPEED_MPH"/>
     <cursor type="arrow"/>
  </Area>
 </Mouse>
</Gauge>
 
Messages
39
Country
finland
Thanks for the answer! Is the code correct now?
Code:
<Gauge Name="spd_test_mph" Version="1.0">
 <Image name="erc_spd_01.bmp"/>

 <Element>
  <Position X="200" Y="202"/>
   <Image name="erc_spd_02.bmp">
    <Axis X="14" Y="152" PointsTo="North"/>
   </Image>
  <Rotate>
   <Value minimum="0" Maximum="300">(A:Airspeed indicated, mph) 100 /</Value>
    <Nonlinearity>
     <Item Value="0" X="200" Y="60"/>
     <Item Value="40" X="227" Y="48"/>
     <Item Value="75" X="338" Y="126"/>
     <Item Value="100" X="357" Y="222"/>
     <Item Value="140" X="273" Y="344"/>
     <Item Value="200" X="91" Y="321"/>
     <Item Value="250" X="41" Y="182"/>
     <Item Value="300" X="113" Y="67"/>
    </Nonlinearity>
   </Rotate>
 </Element>

 <Mouse>
  <Area Left="75" Right="350" Top="70" Bottom="340">
   <Tooltip ID="TOOLTIPTEXT_AIRSPEED_MPH"/>
     <Cursor Type="arrow"/>
  </Area>
 </Mouse>
</Gauge>
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
As far as I can tell from just looking at the code, except for this:

<Cursor Type="arrow"/>

"Hand", "UpArrow" or "DownArrow" - not "arrow"

Since I don't have your graphics I can't test it... :D

The question is, does it show up on your panel now?
 
Messages
39
Country
finland
As far as I can tell from just looking at the code, except for this:
<Cursor Type="arrow"/>
"Hand", "UpArrow" or "DownArrow" - not "arrow"
Ok, that is changed now.:)
The question is, does it show up on your panel now?
No, it doesn´t, but in FS Panel Studio i can see the gauge.
 
Messages
39
Country
finland
What can be wrong in the gauge?:confused: I can´t see the gauge on my panel, but in FS Panel Studio I can see the gauge.
Can someone please test the gauge and test if it shows up on your panel? here is the files:
 
Last edited:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
PointsTo"North" doesn't work reliably, rotate your needle 90º clockwise, change the axis as shown in the code below.

Remember I mentioned Capitalization was critical? You had "name" instead of "Name" in both <Image> statements. This is what prevented the gauge from displaying in FS... ;)

Also, the variable names are critical. You can't leave out anything.

All corrections/additions are highlighted in red. I took the time to test and verify this in the Sim.

Keep the faith! You're making good progress, but everyone stubs their toe now and again. Lord knows I've tripped myself more than once over the past two weeks! :D

Code:
<Gauge Name="erc_spd" Version="1.0">
 <Image [COLOR="Red"]Name[/COLOR]="erc_spd_01.bmp"/>
 <Element>
  <Position X="200" Y="200"/>
   <Image [COLOR="red"]Name[/COLOR]="erc_spd_02.bmp">
    <Axis X="[COLOR="red"]14[/COLOR]" Y="[COLOR="red"]15[/COLOR]" PointsTo="[COLOR="red"]East[/COLOR]"/>
   </Image>
  <Rotate>
   <Value [COLOR="Red"]Minimum[/COLOR]="0" Maximum="300">(A:[COLOR="red"]Airspeed select indicated or true[/COLOR], mph)</Value>
    <Nonlinearity>
     <Item Value="0" X="200" Y="31"/>
     <Item Value="40" X="229" Y="42"/>
     <Item Value="75" X="341" Y="124"/>
     <Item Value="100" X="357" Y="222"/>
     <Item Value="140" X="273" Y="344"/>
     <Item Value="200" X="91" Y="321"/>
     <Item Value="250" X="41" Y="182"/>
     <Item Value="300" X="113" Y="67"/>
    </Nonlinearity>
    [COLOR="red"]<Delay DegreesPerSecond="12"/>[/COLOR]
   </Rotate>
 </Element>
 <Mouse>
  <Area Left="75" Right="350" Top="70" Bottom="340">
   <Tooltip ID="TOOLTIPTEXT_AIRSPEED_MPH"/>
     <Cursor Type="[COLOR="red"]Hand[/COLOR]"/>
  </Area>
 </Mouse>
</Gauge>
 
Last edited:

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Thanks for all your help!!!:)
The gauge is working now.:D

You are quite welcome! We were all beginners at one time, and I remember well my initial frustrations... :D

By the way, the <Delay DegreesPerSecond="12"/> isn't strictly required, but what it does is "slow down the needle's response" a bit so it doesn't "snap" from one position to another. You can increase/decrease the number as you desire to achive a smoother operation.
 
Messages
516
Bill,
I don't suppose you know whether that Degrees per Second functionality is supported in C gauges do you? I've not succeeded in finding a method to get it working yet, without writing my own delay loop.

Si
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
Bill,
I don't suppose you know whether that Degrees per Second functionality is supported in C gauges do you? I've not succeeded in finding a method to get it working yet, without writing my own delay loop.

Si

No, it is not. Actually, the XML script is translated by the parser in the flightsim executable to 'pure ANSI C and GDI' drawing code. I've often wished it were possible to at least view the translated code! It would be instructive to see how <Delay DegreesPerSecond="12"/> is translated! :D
 
Top