<Gauge Name="L188 HSI" Version="1.0">
   <Image Name="HSI_Background.bmp" ImageSizes="118,112"/>

    <Element>
      <Select>
         <Value>(A:Light panel,bool)</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Case Value="0">
           <Image Name="HSI_Background.bmp" ImageSizes="100,100"/>
         </Case>
         <Case Value="1">
           <Image Name="HSI_Background.bmp" ImageSizes="118,112" Luminous="1"/>
         </Case>
      </Select>
    </Element>

  <Element>
      <Position X="0" Y="0"/>
      <MaskImage Name="HSI_Card_Outside_Mask.bmp" ImageSizes="118,112">
         <Axis X="58" Y="57"/>
      </MaskImage>
       <Select>
        <Value>(A:Light panel,bool)</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Case Value="0">
           <Image Name="HSI_Card_Outside.bmp" ImageSizes="106,106">
             <Axis X="53" Y="53"/>
           </Image>
         </Case>
         <Case Value="1">
           <Image Name="HSI_Card_Outside.bmp" Bright="Yes" Luminous="1" ImageSizes="106,106">
            <Axis X="53" Y="53"/>
           </Image>
         </Case>
      </Select>
      <Rotate>
         <Value>(A:Plane heading degrees gyro,radians) /-/</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="Freeze"/>
            <GAUGE_GYRO_HEADING Action="Freeze"/>
         </Failures>
      </Rotate>
   </Element>
   <Element>
      <Position X="58" Y="57"/>

       <Select>
        <Value>(A:Light panel,bool)</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="0"/>
         </Failures>
         <Case Value="0">
      <Image Name="HSI_Card_Inside.bmp" ImageSizes="70,72">
         <Axis X="35" Y="36"/>
      </Image>
         </Case>
         <Case Value="1">
      <Image Name="HSI_Card_Inside.bmp" Bright="Yes" Luminous="1" ImageSizes="70,72">
         <Axis X="35" Y="36"/>
      </Image>
         </Case>
      </Select>

      <Clip/>
      <Rotate>
         <Value>(A:NAV1 OBS,radians) (A:Plane heading degrees gyro,radians) -</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="Freeze"/>
            <SYSTEM_ELECTRICAL_AVIONICS Action="Freeze"/>
            <GAUGE_GYRO_HEADING Action="Freeze"/>
            <GAUGE_NAVIGATION_VOR1 Action="Freeze"/>
         </Failures>
      </Rotate>
   </Element>
   <Element>
      <Position X="58" Y="57"/>
      <Select>
         <Value>(A:HSI TF flags, ENUM)</Value>
         <Case Value="1">
            <Image Name="HSI_To_Pointer.bmp" Luminous="1" ImageSizes="15,8">
               <Axis X="-7" Y="15"/>
            </Image>
         </Case>
         <Case Value="2">
            <Image Name="HSI_From_Pointer.bmp" Luminous="1" ImageSizes="15,8">
               <Axis X="-7" Y="15"/>
            </Image>
         </Case>
      </Select>
      <Rotate>
         <Value>(A:NAV1 OBS,radians) (A:Plane heading degrees gyro,radians) -</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="Freeze"/>
            <SYSTEM_ELECTRICAL_AVIONICS Action="Freeze"/>
            <GAUGE_GYRO_HEADING Action="Freeze"/>
            <GAUGE_NAVIGATION_VOR1 Action="Freeze"/>
         </Failures>
      </Rotate>
   </Element>
   <Element>
      <Position X="58" Y="57"/>
      <Image Name="HSI_Needle.bmp" Luminous="Yes" ImageSizes="4,39">
         <Axis X="2" Y="20"/>
      </Image>
      <Shift>
         <Value>(A:HSI CDI needle valid, bool) if{ (A:HSI CDI needle, number)  } els{ 0 }</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="Freeze"/>
            <SYSTEM_ELECTRICAL_AVIONICS Action="Freeze"/>
            <GAUGE_GYRO_HEADING Action="Freeze"/>
            <GAUGE_NAVIGATION_VOR1 Action="Freeze"/>
         </Failures>
         <Scale X="0.173"><!--22/127 = 0.173--></Scale>
      </Shift>
      <Rotate>
         <Value>(A:NAV1 OBS,radians) (A:Plane heading degrees gyro,radians) -</Value>
         <Failures>
            <SYSTEM_ELECTRICAL_PANELS Action="Freeze"/>
            <SYSTEM_ELECTRICAL_AVIONICS Action="Freeze"/>
            <GAUGE_GYRO_HEADING Action="Freeze"/>
            <GAUGE_NAVIGATION_VOR1 Action="Freeze"/>
         </Failures>
      </Rotate>
   </Element>
   <Element>
      <Position X="27" Y="17"/>
      <Select>
         <Value>(A:HSI CDI needle valid,bool)</Value>
         <Case Value="0">
            <Image Name="HSI_Flag_Nav.bmp" Luminous="Yes" ImageSizes="24,13"/>
         </Case>
      </Select>
   </Element>
   <Element>
      <Position X="71" Y="17"/>
      <Select>
         <Value>(A:Partial panel heading,enum) 0 != (A:Partial panel electrical,enum) 0 != || </Value>
         <Case Value="1">
            <Image Name="HSI_Flag_Hdg.bmp" Luminous="Yes" ImageSizes="24,13"/>
         </Case>
      </Select>
   </Element>
   <Element>
      <Position X="58" Y="57"/>
      <Image Name="HSI_Pointer.bmp" Luminous="Yes" ImageSizes="12,9">
         <Axis X="5" Y="44"/>
      </Image>
      <Rotate>
         <Value>(A:Autopilot heading lock dir,radians) (A:Plane heading degrees gyro,radians) -</Value>
      </Rotate>
   </Element>
   <Element>
      <Image Name="HSI_glide_slope_left.bmp" Luminous="Yes" ImageSizes="4,7">
         <Axis X="4" Y="3.5"/>
      </Image>
      <Shift>
         <Value Minimum="-220" Maximum="120">(A:HSI GSI needle valid, bool) if{ (A:HSI GSI needle, number) } els{ -220 }</Value>
         <Nonlinearity>
            <Item Value="0" X="14" Y="57"/>
            <Item Value="-120" X="14" Y="36"/>
         </Nonlinearity>
         <Delay PixelsPerSecond="20"/>
      </Shift>
   </Element>
   <Element>
      <Image Name="HSI_glide_slope_right.bmp" Luminous="Yes" ImageSizes="4,7">
         <Axis X="0" Y="3.5"/>
      </Image>
      <Shift>
         <Value Minimum="-220" Maximum="120">(A:HSI GSI needle valid, bool) if{ (A:HSI GSI needle, number) } els{ -220 }</Value>
         <Nonlinearity>
            <Item Value="0" X="103" Y="57"/>
            <Item Value="-120" X="103" Y="36"/>
         </Nonlinearity>
         <Delay PixelsPerSecond="20"/>
      </Shift>
   </Element>
   <Element>
      <Image Name="HSI_mask.bmp" ImageSizes="118,112"/>
   </Element>
   <Element>
      <Position X="103" Y="90"/>
      <Image Name="HSI_Knob_Right.bmp" Luminous="Yes" ImageSizes="21,21">
         <Axis X="10.5" Y="10.5"/>
      </Image>
      <Rotate>
         <Value>(A:Autopilot heading lock dir,radians) 3 *</Value>
      </Rotate>
   </Element>
   <Element>
      <Position X="14" Y="90"/>
      <Image Name="HSI_Knob_Left.bmp" Luminous="Yes" ImageSizes="21,21">
         <Axis X="10.5" Y="10.5"/>
      </Image>
      <Rotate>
         <Value>(A:NAV1 OBS,radians) 3 *</Value>
      </Rotate>
   </Element>
   <Mouse>
      <Help ID="HELPID_GAUGE_HSI"/>
      <Tooltip ID="TOOLTIPTEXT_HSI_HEADING_COURSE"/>
      <Area Left="92" Right="114" Top="79" Bottom="101">
         <Help ID="HELPID_GAUGE_HEADING_BUG_ADJUST"/>
         <Area Right="11">
            <Cursor Type="DownArrow"/>
            <Click Event="HEADING_BUG_DEC" Repeat="Yes"/>
         </Area>
         <Area Left="11">
            <Cursor Type="UpArrow"/>
            <Click Event="HEADING_BUG_INC" Repeat="Yes"/>
         </Area>
      </Area>
      <Area Left="3" Right="25" Top="79" Bottom="101">
         <Help ID="HELPID_GAUGE_HSI_OBS1"/>
         <Area Right="11">
            <Cursor Type="DownArrow"/>
            <Click Event="VOR1_OBI_DEC" Repeat="Yes"/>
         </Area>
         <Area Left="11">
            <Cursor Type="UpArrow"/>
            <Click Event="VOR1_OBI_INC" Repeat="Yes"/>
         </Area>
      </Area>
   </Mouse>
</Gauge>
