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

FSXA DME issues

euroastar350

Resource contributor
Messages
863
Country
us-delaware
Hi guys,

So does anyone have experience in coding this type of DME? For the life of me, this DME gauge does not display any info nor does the test function work as expected. The gauge is part of my Sikorsky S76 project and is one of my last major items to fix before release. I am attaching the gauge itself in hopes that someone may look at it and hopefully point out any errors it might contain. Any help is appreciated.
dme_bgrnd.jpg
 

Attachments

Took a look at it -
  1. The big thing. When using visibility for a string element do not use a visibility tag within the string element. Instead surround the string element with another element along with the visibility. The text string must load into memory within its own element otherwise it will not show.
  2. While it will work it serves no purpose. You were evaluating your click commands with "or"'s ( || ) when it wasn't needed at all.
  3. Just an idea, when working with large gauges like this it may be a good idea to name each element & area. Makes it worlds easier to find what you're looking for.
Starting modifying it, then just kept going until it could be tested.
Removed all the <Failure> records as the display is already being controlled by a surrounding <Element><Visible>(A:CIRCUIT AVIONICS ON, bool). You had nothing in the failure attributes to do anything anyway.
Rewrote it in my "style" so to speak, just to understand what you were trying to accomplish.
It works but you might find under certain situations it may give erroneous results. The FS DME system is very finicky, some other checks may have to be made such as -
(A:NAV1 HAS DME, bool) and (A:NAV2 HAS DME, bool), just tried to get it working is all.

Hope this helps -

Code:
<Gauge Name="DME">
    <Image Name="dme_bgrnd.bmp" Luminous="Yes"/>

    <Element Name="ON WHEN POWERED">
        <Visible>(A:CIRCUIT AVIONICS ON, bool)</Visible>


        <Element Name="DME CHANNEL 1">
            <Visible>(L:dme select,bool) ! (L:test, bool) ! and</Visible>
            <Element Name="ENSURE STRING DISPLAYS">
                <Position X="138" Y="34"/>
                <Text X="200" Y="80" Length="4" Fixed="Yes" Font="Quartz" Adjust="Center" VerticalAdjust="Center" Color="#FF8665" Bright="Yes">
                    <String>%((L:disp, number))%{case}%{:0}%((A:HSI distance,nautical mile) 9999 min d 99 &lt;=)%{if}%!04.1f!%{else}%!4d!%{end}%{:1}%((A:GPS DRIVES NAV1,bool))%{if}%((A:GPS ETE,minute))%!d!%{else}%((A:NAV1 DME, nmiles) (A:NAV1 DMESPEED, knots) / 60 * 240 min)%!4d!%{end}%{:2}%((A:HSI SPEED,knot))%!4d!%{end}%</String>
                </Text>
            </Element>
        </Element>


        <Element Name="DME CHANNEL 2">
            <Visible>(L:dme select,bool) (L:test, bool) ! and</Visible>
            <Element Name="ENSURE STRING DISPLAYS">
                <Position X="138" Y="34"/>
                <Text X="200" Y="80" Length="4" Fixed="Yes" Font="Quartz" Adjust="Center" VerticalAdjust="Center" Color="#FF8665" Bright="Yes">
                    <String>%((L:disp, number))%{case}%{:0}%((A:NAV2 DME, nmiles) 9999 min d 99 &lt;=)%{if}%!04.1f!%{else}%!4d!%{end}%{:1}%((A:NAV2 DME, nmiles) (A:NAV2 DMESPEED, knots) / 60 * 240 min)%!4d!%{:2}%((A:NAV2 DMESPEED, knots))%!4d!%{end}%</String>
                </Text>
            </Element>
        </Element>


        <Element Name="TEST">
            <Visible>(L:test, bool)</Visible>
            <Element Name="ENSURE STRING DISPLAYS">
                <Position X="138" Y="34"/>
                <Text X="200" Y="80" Length="4" Fixed="Yes" Font="Quartz" Adjust="Center" VerticalAdjust="Center" Color="#FF8665" Bright="Yes">
                    <String>8888</String>
                </Text>
            </Element>
        </Element>

        <!-- END ON WHEN POWERED -->
    </Element>


    <Element Name="1/2 SELECT KNOB">
        <Position X="407" Y="96"/>
        <Image Name="dme_knob.bmp" Luminous="Yes">
            <Axis X="26.5" Y="26.5"/>
        </Image>
        <Rotate>
            <Value>(L:dme select,bool)</Value>
            <Nonlinearity>
                <Item Value="0" X="373" Y="77"/>
                <Item Value="1" X="405" Y="60"/>
            </Nonlinearity>
            <Delay DegreesPerSecond="100"/>
        </Rotate>
    </Element>


    <Element Name="NM BUTTON">
        <Position X="108" Y="154"/>
        <Select>
            <Value>(L:disp, number) 0 == (L:test,bool) ! and</Value>
            <Case Value="0">
                <Image Name="dme_button_out.bmp" Luminous="Yes"/>
            </Case>
            <Case Value="1">
                <Image Name="dme_button_in.bmp" Luminous="Yes"/>
            </Case>
        </Select>
    </Element>


    <Element Name="MIN BUTTON">
        <Position X="174" Y="154"/>
        <Select>
            <Value>(L:disp, number) 1 == (L:test,bool) ! and</Value>
            <Case Value="0">
                <Image Name="bme_button_out.bmp" Luminous="Yes"/>
            </Case>
            <Case Value="1">
                <Image Name="dme_button_in.bmp" Luminous="Yes"/>
            </Case>
        </Select>
    </Element>


    <Element Name="KTS BUTTON">
        <Position X="239" Y="154"/>
        <Select>
            <Value>(L:disp, number) 2 == (L:test,bool) ! and</Value>
            <Case Value="0">
                <Image Name="bme_button_out.bmp" Luminous="Yes"/>
            </Case>
            <Case Value="1">
                <Image Name="dme_button_in.bmp" Luminous="Yes"/>
            </Case>
        </Select>
    </Element>


    <Element Name="TEST BUTTON">
        <Position X="304" Y="154"/>
        <Select>
            <Value>(L:test, bool)</Value>
            <Case Value="0">
                <Image Name="bme_button_out.bmp" Luminous="Yes"/>
            </Case>
            <Case Value="1">
                <Image Name="dme_button_in.bmp" Luminous="Yes"/>
            </Case>
        </Select>
    </Element>

    <Mouse>

        <Area Name="DME 1/2 SELECT"  Left="380" Right="432" Top="70" Bottom="124">
            <Cursor Type="Hand"/>
            <Click>(L:dme select,bool) ! (>L:dme select,bool)</Click>
        </Area>

        <Area Name="NM SELECT" Left="108" Right="172" Top="154" Bottom="186">
            <Cursor Type="Hand"/>
            <Click>0 (>L:disp, number) 0 (>L:test,bool)</Click>
        </Area>

        <Area Name="MIN SELECT" Left="172" Right="237" Top="154" Bottom="186">
            <Cursor Type="Hand"/>
            <Click>1 (>L:disp, number) 0 (>L:test,bool)</Click>
        </Area>

        <Area Name="KTS SELECT" Left="237" Right="302" Top="154" Bottom="186">
            <Cursor Type="Hand"/>
            <Click>2 (>L:disp, number) 0 (>L:test,bool)</Click>
        </Area>

        <Area Name="TEST SELECT" Left="302" Right="367" Top="154" Bottom="186">
            <Cursor Type="Hand"/>
            <Click>1 (>L:test,bool)</Click>
        </Area>

    </Mouse>
 
</Gauge>
 
Last edited:
Thank you @spokes2112 , although I didn't write the original code, I did however tried a different method, but didn't work as intended. Your code works quite well and my testers are happy with the results.
 
Back
Top