<Gauge Name="GPWS Master Warning gauge" Version="3.3">
<Comment>
This MasterWarn gauge two things: panel window switching and aural warning (de-)activation.
   - The gauge has a lighted switch:
     - OFF: no warning modes (1-6) are Active.
     - RED: one or more warning modes (1-6) is Active with aural warnings.
     - Flashing RED: one or more warning modes (1-6) is Active, but the aural
       warnings for those modes are disabled.
   - LeftClicking the switch when RED, disables the aural warnings of the highest
     priority mode (=lowest number) currently Active. This means that the switch
     may stay RED, because another mode might be Active as well (and now give its
     aural warnings). So you have to click it again.
     I.o.w.: by LeftClicking a RED switch, you acknowledge the mode that currently gives
     an aural warning
   - LeftClicking the switch when Flashing RED, enables all aural warnings again.
   - RightClicking the switch toggles a panel window with Ident=10060. 
     This allows you to place the GPWS gauge in a seperate panel window, with 
     window open/close control using the MasterWarn gauge.

At load, it opens/closes the panel window with Ident=10060

COPYRIGHT STATEMENT: 
This gauge is freeware, NOT public domain.
Other then editing for your personal use, it may NOT be renamed, copied, modified, 
or bundled in another archive without my prior consent.
Rob Barendregt, 3 June 2005
Email: rc.barendregt@planet.nl
</Comment>

<Update Frequency="6"/>

<Element>
  <Select>
    <Value>
      (L:GPWS_MW_Init,number) 3 ==
      if{ 
        10060 (&gt;K:PANEL_ID_OPEN)
        10060 (&gt;K:PANEL_ID_CLOSE)
      }
      (L:GPWS_MW_Init,number) ++ (&gt;L:GPWS_MW_Init,number)
      (L:GPWS_AM1,number) 5 ==
      (L:GPWS_AM2,number) 5 == ||
      (L:GPWS_AM3,number) 5 == ||
      (L:GPWS_AM4,number) 5 == ||
      (L:GPWS_AM5,number) 5 == ||
      (L:GPWS_AM6,number) 5 == ||
      if{ 1 }
      els{
        (L:GPWS_AM1,number) 3 ==
        (L:GPWS_AM2,number) 3 == ||
        (L:GPWS_AM3,number) 3 == ||
        (L:GPWS_AM4,number) 3 == ||
        (L:GPWS_AM5,number) 3 == ||
        (L:GPWS_AM6,number) 3 == ||
        if{ 2 }
        els{ 0 }
      }
      d (&gt;G:Var1) 2 ==
      if{ (P:ABSOLUTE TIME,seconds) 1 % near if{ 0 } els{ 1 } }
      els{ (G:Var1) }
    </Value>
    <Case Value="0"> <Image Name="GPWS3_MasterWarnOff.bmp" ImageSizes="19,19"/> </Case>
    <Case Value="1"> <Image Name="GPWS3_MasterWarnOn.bmp" ImageSizes="19,19"/> </Case>
  </Select>
</Element>

<Mouse>
  <Cursor Type="Hand"/>
  <Tooltip ID="">LeftClick: ToggleGPWSAuralWarnings   RightClick: ToggleGPWSWindow</Tooltip>
  <Click Kind="LeftSingle+RightSingle">
    (M:Event) 'LeftSingle' scmp !
    if{
      (G:Var1) 1 ==
      if{
        (L:GPWS_AM1,number) 5 ==  if{ 3 (&gt;L:GPWS_AM1,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
        els{
          (L:GPWS_AM2,number) 5 == if{ 3 (&gt;L:GPWS_AM2,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
          els{
            (L:GPWS_AM3,number) 5 == if{ 3 (&gt;L:GPWS_AM3,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
            els{
              (L:GPWS_AM4,number) 5 == if{ 3 (&gt;L:GPWS_AM4,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
              els{ 
                (L:GPWS_AM5,number) 5 == if{ 3 (&gt;L:GPWS_AM5,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
                els{
                  (L:GPWS_AM6,number) 5 == if{ 3 (&gt;L:GPWS_AM6,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
                }
              }
            }
          }
        }
      }
      els{
        (G:Var1) 2 ==
        if{
          (L:GPWS_AM1,number) 3 == if{ 5 (&gt;L:GPWS_AM1,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
          (L:GPWS_AM2,number) 3 == if{ 5 (&gt;L:GPWS_AM2,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
          (L:GPWS_AM3,number) 3 == if{ 5 (&gt;L:GPWS_AM3,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
          (L:GPWS_AM4,number) 3 == if{ 5 (&gt;L:GPWS_AM4,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
          (L:GPWS_AM5,number) 3 == if{ 5 (&gt;L:GPWS_AM5,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
          (L:GPWS_AM6,number) 3 == if{ 5 (&gt;L:GPWS_AM6,number) 1 (&gt;L:GPWS_SOUND_CLICK,number) }
        }
      }
    }

    (M:Event) 'RightSingle' scmp !
    if{
      10060 (&gt;K:PANEL_ID_TOGGLE)
      1 (&gt;L:GPWS_SOUND_CLICK,number)
    }
  </Click>
</Mouse>

</Gauge>
