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

FSX Help - XML Gauge MaskImage

Messages
5
Country
us-texas
Dear FS Developers:

I am designing and coding my own gauges for the Lear 45 cockpit. Frankly, I cannot afford the Jet45 cost although they are extremely fine instruments.

I am somewhat sophisticated in creating images and gauges and using FSUIPC to drive aircraft and FSX environmental data. I use Desktop Aviator’s circuit boards to communicate hardware with FSUIPC (www.desktopaviator.com) which work very well and are less expensive than other circuits. I am building a Lear 45 cockpit.

However, I am at a loss with using ESP’s Gauge DSK and Nick Pike’s Gauge Programming when it comes to dealing with the <MaskImage> XML Object. I hope someone at Hangar 45 can help. Is there a clear formula to align a tape bit map, the mask image and the shift expressions? I cannot find any on the internet. Mr. Pike’s explanation deals with a single gauge with one mask and one bit map. I have several.

The altitude tape works fine through trial and error. I cannot get the airspeed tape to align. The mask image, by itself lines up perfectly. The bit map will line up with the mask image. But I cannot get the zero position to align with the background. I have an image of what I mean. If I fiddle with the float positions, axes or nonlinearity entries, I can get two out of the three to align.

Can anyone help or at least point to significant documentation?

Thanks,
Dave Simmons
Sugar Land, Texas

SimmonsLearPFD.jpg


<!-- Airspeed Tape-->
<Element id="Airspeed Tape">
<FloatPosition>40.000,87.000</FloatPosition>
<Image id="pfd_speed_tape_normal.bmp"
Name="pfd_speed_tape_normal.bmp">
<Transparent>True</Transparent>
<Axis>0.000,-25.000</Axis>
<Bright>True</Bright>
</Image>
<MaskImage id="pfd_airspeed_tape_mask.bmp"
Name="pfd_airspeed_tape_mask.bmp">
<Transparent>True</Transparent>
</MaskImage>
<Shift id="Shift">
<Scale>0.000,-1.000</Scale>
<Expression id="Expression">
<Minimum>0.000</Minimum>
<Maximum>1000.000</Maximum>
<Script>(A:Airspeed select indicated or true, knots)</Script>
</Expression>
<FailureTable id="FailureTable">
<Failure id="Failure">
<Fail_Key>SYSTEM_ELECTRICAL_PANELS</Fail_Key>
<Fail_Action>Zero</Fail_Action>
</Failure>
</FailureTable>
<NonlinearityTable id="NonlinearityTable">
<NonlinearityEntry id="NonlinearityEntry">
<ExpressionResult>1000.000</ExpressionResult>
<FloatPosition>0.000,24.000</FloatPosition>
</NonlinearityEntry>
<NonlinearityEntry id="NonlinearityEntry">
<ExpressionResult>0.000</ExpressionResult>
<FloatPosition>0.000,2423.000</FloatPosition>
</NonlinearityEntry>
</NonlinearityTable>
</Shift>
</Element>
 
Please repost your XML script and make sure to wrap it in the
Code:
 tags so that the formatting and indents are preserved. The [code] box is the big [B][SIZE="3"]#[/SIZE][/B] button on the editor's toolbar.

So, instead of this:

  <Element>
    <Position X="113" Y="102"/>
    <FormattedText X="300" Y="35" Font="Glass Gauge" FontSize="10" LineSpacing="0" Adjust="Left" Color="White" Bright="Yes">
      <String>Ambient Pressure = %((A:AMBIENT PRESSURE,psi))%!3.4f! %((A:BAROMETER PRESSURE,psi))%!3.4f!</String>
    </FormattedText>
  </Element>

We can see this:
[code]  <Element>
    <Position X="113" Y="102"/>
    <FormattedText X="300" Y="35" Font="Glass Gauge" FontSize="10" LineSpacing="0" Adjust="Left" Color="White" Bright="Yes">
      <String>Ambient Pressure = 
            %((A:AMBIENT PRESSURE,psi))
            %!3.4f! 
            %((A:BAROMETER PRESSURE,psi))
            %!3.4f!
      </String>
    </FormattedText>
  </Element>
I'm sure you'll agree that it's much easier to read! :D

For the Nonlinearity table you will either have to specify at least the x,y coordinates for lowest and highest values, or if the scale is actually linear, it might be easier to simply specify a scalar value for the entire "moving strip."

I avoid the FSX XML schema like the plague, but here is an example of an airspeed tape for my G1000 PFD. Note especially that the order of entries for the non-linearity table is lowest to highest:
Code:
    <!--  =============  AIRSPEED INDICATOR TAPE  ==============  -->
    <Element>
      <Position X="212" Y="148"/>
      <MaskImage Name="G1000_PDF_Airspeed_Mask.bmp" Bright="Yes" ImageSizes="69,264">
        <Axis X="20" Y="142"/>
      </MaskImage>
      <Image Name="G1000_PFD_ASI_Strip.bmp" Bright="Yes" ImageSizes="75,1714">
        <Nonlinearity>
          <Item Value="0" X="18" Y="1714"/>
          <Item Value="350" X="18" Y="12"/>
        </Nonlinearity>
      </Image>
      <Shift>
        <Value Minimum="0" Maximum="350">(A:Airspeed select indicated or true, knots)</Value>
      </Shift>
    </Element>
 
Last edited:
Back
Top