I have been spending hours to figure out what is wrong with this defunt DME gauge. It should connect to NAV1 and display DME distance in kilometers by three numbers. Any other DME gauge does work correctly so it has something to with the XML coding. Could some of your experts take a look and figure out what is wrong? I have attached the gauge materials and the XML code below.
Code:
<Gauge Name="DME" Version="1.0">
<Image Name="DME_background.bmp" ImageSizes="152,152,0,0"/>
<Element>
<Select>
<Value>(L:TSBN,bool) if{ (A:NAV1 DME, kilometers) (G:Var2) == ! if{ (A:NAV1 DME, kilometers) 100 * (>G:Var1) } els{ (G:Var1) (A:NAV1 DMESPEED,meter/second) 180 / + (>G:Var1) }
(A:NAV1 DME, kilometers) (>G:Var2)}</Value>
</Select>
</Element>
<Element>
<Position X="0" Y="0"/>
<MaskImage Name="DME_mask.bmp" ImageSizes="152,152,0,0">
<Axis X="26" Y="34"/>
</MaskImage>
<Image Name="DME_numbers.bmp" Luminous="Yes" ImageSizes="22,367,0,0">
<Nonlinearity>
<Item Value="0" X="0" Y="334"/>
<Item Value="10" X="0" Y="0"/>
</Nonlinearity>
</Image>
<Shift>
<Value>(G:Var1) 100000 + 100000 % d 100 % 100 / r 100 / flr d 100 / flr r 100 % 99 == if{ + }</Value>
<Delay PixelsPerSecond="500"/>
</Shift>
</Element>
<Element>
<Position X="0" Y="0"/>
<MaskImage Name="DME_mask.bmp" ImageSizes="152,152,0,0">
<Axis X="60" Y="34"/>
</MaskImage>
<Image Name="DME_numbers.bmp" Luminous="Yes" ImageSizes="22,367,0,0">
<Nonlinearity>
<Item Value="0" X="0" Y="334"/>
<Item Value="10" X="0" Y="0"/>
</Nonlinearity>
</Image>
<Shift>
<Value>(G:Var1) 100000 + 100000 % d 100 % 100 / r 100 / flr d 10 / 10 % flr r 10 % 9 == if{ + } </Value>
<Failures>
<SYSTEM_ELECTRICAL_AVIONICS Action="Freeze"/>
</Failures>
<Delay PixelsPerSecond="500"/>
</Shift>
</Element>
<Element>
<Position X="0" Y="0"/>
<MaskImage Name="DME_mask.bmp" ImageSizes="152,152,0,0">
<Axis X="93" Y="34"/>
</MaskImage>
<Image Name="DME_numbers.bmp" Luminous="Yes" ImageSizes="22,367,0,0">
<Nonlinearity>
<Item Value="0" X="0" Y="334"/>
<Item Value="10" X="0" Y="0"/>
</Nonlinearity>
</Image>
<Shift>
<Value>(G:Var1) 100000 + 100000 % d 10 % 10 / r 10 / flr d 10 / 10 % flr r 10 % 9 == if{ + } </Value>
<Failures>
<SYSTEM_ELECTRICAL_PANELS Action="0"/>
</Failures>
<Delay PixelsPerSecond="500"/>
</Shift>
</Element>
<Element>
<Position X="0" Y="0"/>
<Image Name="DME_frame.bmp" ImageSizes="152,152,0,0"/>
</Element>
<Mouse>
<Tooltip>DME</Tooltip>
</Mouse>
</Gauge>