<Gauge Name="TRI">
  <Image Name="TRI_backgrnd.bmp" ImageSizes="120,120,0,0"/>
  <Element>
    <Position X="0" Y="0"/>
    <Image Name="TRI_Card.bmp" ImageSizes="120,120,0,0" Luminous="1"/>
  </Element>
  <Element>
    <Element>
      <Position X="19" Y="26"/>
      <MaskImage Name="TRI_mask.bmp" ImageSizes="80,80,0,0">
        <Axis X="40" Y="40"/>
      </MaskImage>
      <Image Name="TRI_needle.bmp" ImageSizes="80,80,0,0" Luminous="1">
        <Axis X="40" Y="40"/>
      </Image>
      <Rotate>
        <Value>(A:Avionics master switch,bool) if{ (A:Plane heading degrees gyro,radians) (A:NAV1 OBS,radians) - } els{ 0.01 }</Value>
        <Delay DegreesPerSecond="90"/>
        <Failures>
          <SYSTEM_ELECTRICAL_PANELS Action="0"/>
          <SYSTEM_ELECTRICAL_AVIONICS Action="0"/>
          <GAUGE_GYRO_HEADING Action="Freeze"/>
        </Failures>
      </Rotate>
    </Element>
    <Element>
      <Position X="19" Y="26"/>
      <MaskImage Name="TRI_mask.bmp" ImageSizes="80,80,0,0"/>
      <Image Name="TRI_L_needle.bmp" ImageSizes="2,68,0,0" Luminous="1">
        <Axis X="1" Y="35"/>
      </Image>
      <Shift>
        <Value Minimum="-120" Maximum="220">(A:HSI CDI needle valid, bool) if{ (A:HSI CDI needle, number) } els{ 220 }</Value>
        <Nonlinearity>
          <Item Value="-120" X="31" Y="66"/>
          <Item Value="0" X="59" Y="66"/>
          <Item Value="120" X="86" Y="66"/>
          <Item Value="220" X="115" Y="66"/>
        </Nonlinearity>
      </Shift>
      <Failures>
        <SYSTEM_ELECTRICAL_PANELS Action=""/>
      </Failures>
    </Element>
    <Element>
      <Position X="19" Y="26"/>
      <MaskImage Name="TRI_mask.bmp" ImageSizes="80,80,0,0"/>
      <Image Name="TRI_G_needle.bmp" ImageSizes="72,2,0,0" Luminous="1">
        <Axis X="36" Y="1"/>
      </Image>
      <Shift>
        <Value Minimum="-120" Maximum="220">(A:HSI GSI needle valid, bool) if{ (A:HSI GSI needle, number) } els{ 220 }</Value>
        <Nonlinearity>
          <Item Value="-120" X="59" Y="38"/>
          <Item Value="0" X="59" Y="66"/>
          <Item Value="120" X="59" Y="92"/>
          <Item Value="220" X="115" Y="95"/>
        </Nonlinearity>
      </Shift>
      <Failures>
        <SYSTEM_ELECTRICAL_PANELS Action=""/>
      </Failures>
    </Element>
    <Element>
      <Position X="44" Y="14"/>
      <MaskImage Name="TRI_Mask1.bmp" ImageSizes="10,12,0,0">
        <Axis X="0" Y="0"/>
      </MaskImage>
      <Image Name="TRI_Strip.bmp" ImageSizes="10,177,0,0" Luminous="1">
        <Nonlinearity>
          <Item Value="0" X="0" Y="15"/>
          <Item Value="10" X="0" Y="152"/>
        </Nonlinearity>
      </Image>
      <Shift>
        <Value>(A:NAV1 OBS,degrees) 100 &lt; if{ 0 } els{ (A:NAV1 OBS,degrees) 100 / flr }</Value>
      </Shift>
      <Failures>
        <SYSTEM_ELECTRICAL_PANELS Action=""/>
      </Failures>
    </Element>
    <Element>
      <Position X="55" Y="14"/>
      <MaskImage Name="TRI_Mask1.bmp" ImageSizes="10,12,0,0">
        <Axis X="0" Y="0"/>
      </MaskImage>
      <Image Name="TRI_Strip.bmp" ImageSizes="10,177,0,0" Luminous="1">
        <Nonlinearity>
          <Item Value="0" X="0" Y="15"/>
          <Item Value="10" X="0" Y="152"/>
        </Nonlinearity>
      </Image>
      <Shift>
        <Value>(A:NAV1 OBS,degrees) 100 &lt; if{ (A:NAV1 OBS,degrees) 10 / flr } els{ (A:NAV1 OBS,degrees) 100 / flr 100 * s0 (A:NAV1 OBS,degrees) l0 - 10 / flr }</Value>
      </Shift>
      <Failures>
        <SYSTEM_ELECTRICAL_PANELS Action=""/>
      </Failures>
    </Element>
    <Element>
      <Position X="66" Y="14"/>
      <MaskImage Name="TRI_Mask1.bmp" ImageSizes="10,12,0,0">
        <Axis X="0" Y="0"/>
      </MaskImage>
      <Image Name="TRI_Strip.bmp" ImageSizes="10,177,0,0" Luminous="1">
        <Nonlinearity>
          <Item Value="0" X="0" Y="15"/>
          <Item Value="10" X="0" Y="152"/>
        </Nonlinearity>
      </Image>
      <Shift>
        <Value>(A:NAV1 OBS,degrees) 10 &lt; if{ (A:NAV1 OBS,degrees) flr } els{ (A:NAV1 OBS,degrees) 10 / flr 10 * s0 (A:NAV1 OBS,degrees) l0 - flr }</Value>
        <Failures>
          <SYSTEM_ELECTRICAL_PANELS Action=""/>
        </Failures>
      </Shift>
    </Element>
    <Element>
      <Position X="15" Y="105"/>
      <Image Name="TRI_Knob.bmp" ImageSizes="24,24,0,0">
        <Axis X="15" Y="15"/>
      </Image>
      <Rotate>
        <Value>(A:NAV1 OBS,radians) 3 *</Value>
      </Rotate>
    </Element>
    <Element>
      <Position X="19" Y="55"/>
      <Select>
        <Value>(A:HSI GSI needle valid,bool)</Value>
        <Case Value="0">
          <Image Name="TRI_G_flag.bmp" ImageSizes="7,19,0,0" Luminous="1">
            <Axis X="0" Y="0"/>
          </Image>
        </Case>
      </Select>
    </Element>
    <Element>
      <Position X="51" Y="94"/>
      <Select>
        <Value>(A:HSI CDI needle valid,bool)</Value>
        <Case Value="0">
          <Image Name="TRI_L_flag.bmp" ImageSizes="21,7,0,0" Luminous="1">
            <Axis X="0" Y="0"/>
          </Image>
        </Case>
      </Select>
    </Element>
  </Element>
  <Mouse>
    <Area Left="0" Right="30" Top="90" Bottom="120">
      <Tooltip>CRS select</Tooltip>
      <Area Left="15">
        <Cursor Type="UpArrow"/>
        <Click Event="VOR1_OBI_INC" Repeat="Yes"/>
      </Area>
      <Area Right="15">
        <Cursor Type="DownArrow"/>
        <Click Event="VOR1_OBI_DEC" Repeat="Yes"/>
      </Area>
    </Area>
  </Mouse>
</Gauge>