<Gauge Name="Airport ID" Version="2.0">
 <Image Name="AirportID.bmp" Sizes="60,30"/>
   <Update Frequency="6"/>

	<Macro Name="c">C:fs9gps</Macro>
	<Macro Name="g">C:fs9gps</Macro>

<Update Hidden="No">
(A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
(A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
1 (>@c:NearestAirportMaximumItems)
30 (>@c:NearestAirportMaximumDistance, NMiles)
</Update>

	<Element> (**** Setup GPS variable with airport ID so data can be extracted ****)
		<Select>
			<Value> 0 (>@c:NearestAirportCurrentLine)
	(@c:NearestAirportCurrentICAO) (>@c:WaypointAirportICAO)
	(@c:NearestAirportCurrentICAO) (>@c:FacilityICAO)
	(@c:WaypointAirportRunwaysNumber, number)  (&gt;L:Runways, number)    (*** Aaantal Runways ***)
	(@c:WaypointAirportCurrentRunway, number)  (&gt;L:RwyCurrent, number) 
			</Value>
		</Select>
	</Element>
	  
<Element>(**** Second data extracted: runway length entered in an L:Var ****) <!--Door mij toegevoegd voor extern gebruik.-->
<Select>
<Value>(@c:WaypointAirportRunwayLength, feet) (>L:RWYLength, feet)</Value>
</Select>
</Element>

<Element>(**** Second data extracted: runway length entered in an L:Var ****) <!--Door mij toegevoegd voor extern gebruik.-->
<Select>
<Value>(@c:WaypointAirportRunwayElevation, feet) (>L:RWYElevation, feet)</Value>
</Select>
</Element>


   
<!--=====================================================================================-->   

 <!--Test string for Country-->
<Element>
      <Select>
         <Value>(@c:NearestAirportCurrentIdent,string) sp0
         l0 'EH' sstr ! if{ 3000 }		(*** Netherlands ***)      
         l0 'EG' sstr ! if{ 6000 } 		(*** United Kingdom London Area ***)    
         l0 'ED' sstr ! if{ 5000 } 		(*** Germany ***)    
         l0 'GC' sstr ! if{ 6000 } 	(*** Gran Canaria ***)    
         l0 'LI' sstr ! if{ 6000 } 		(*** Italy ***)    
         l0 'LF' sstr ! if{ 5000 } 		(*** France  ***)    
         l0 'PT' sstr ! if{ 4000 } 		(*** Portugal ***)    
         l0 'EB' sstr ! if{ 4500 } 		(*** Belgium  ***)    
         l0 'EP' sstr ! if{ 4930 } 		(*** Poland  ***)    
         l0 'LE' sstr ! if{ 6000 } 		(*** Spain ***)    
         l0 'EI' sstr ! if{ 5000 } 		(*** Ireland ***)    
         l0 'LG' sstr ! if{ 6000 } 		(*** Greece ***)    
         l0 'ES' sstr ! if{ 5000 }		(*** Sweden ***)    
         l0 'EN' sstr ! if{ 7000 } 		(*** Norway ***)    
         l0 'EK' sstr ! if{ 5000 } 		(*** Denmark ***) 
         l0 'EF' sstr ! if{ 5000 } 		(*** Finland ***) 
         l0 'OK' sstr ! if{ 13000 } 	(*** Kuwait ***) 
         l0 'OM' sstr ! if{ 13000 } 	(*** UA Emirates ***) 
         l0 'OM' sstr ! if{ 13000 } 	(*** Jeddah ***) 
         l0 'OM' sstr ! if{ 13000 } 	(*** Bahrain ***) 
         l0 'VH' sstr ! if{ 9000 } 		(*** Hong Kong TL. lager dan 980, 120, gelijk of hoger dan 980, 110  ***) 
         l0 'RJ' sstr ! if{ 14000 }	(*** Japan ***)  
         l0 'RP' sstr ! if{ 11000 }	(*** Philippines ***)    
         l0 'VT' sstr ! if{ 11000 }	(*** Thailand ***)    
         l0 'WI' sstr ! if{ 11000 }	    (*** Indonesia ***)    
         l0 'WS' sstr ! if{ 11000 }	(*** Singapore ***) 
         l0 'WM' sstr ! if{ 11000 }	(*** Malaysia ***)    
         l0 'Y' sstr ! if{ 10000 }	    (*** Australia ***)
         l0 'Z' sstr ! if{ 9850 }	        (*** China ***)
         l0 'NZ' sstr ! if{ 13000 }	(*** New Zealand ***) 
         l0 'NW' sstr ! if{ 11000 }	(*** New Caledonia ***)   
         l0 'K' sstr ! if{ 18000 }	    (*** USA ***) 
         l0 'FME' sstr ! if{ 12000 }	(*** La Reunion ***)   
         l0 'LSZH' sstr ! if{ 7000 }	(*** Zurich ***)   
         l0 'LZIB' sstr ! if{ 5000 }	(*** Bratislava Slowakia ***)   
         l0 'LYBE' sstr ! if{ 10010 }	(*** Belgrade Serbia ***)  
         l0 'LBSF' sstr ! if{ 7650 }	(*** Sofia Bulgaria ***)    
         l0 'LC' sstr ! if{ 8000 }	    (*** Cyprus ***)   
         l0 'TNCA' sstr ! if{ 2510 }	(*** Aruba ***)
         l0 'TNCB' sstr ! if{ 2510 }	(*** Bonaire ***)
         l0 'TNCC' sstr ! if{ 2510 } (*** Curacao ***)
         l0 'TNCM' sstr ! if{ 5010 } (*** St Maarten ***)
         l0 'TNCE' sstr ! if{ 5010 }	 (*** St Eustatius ***)   
         (&gt;L:Inflight_TA,number) </Value>
      </Select>
   </Element>	   
   
   
          <!-- (Als we in een Fixed Country  zitten  zetten we voor de TA2TL gauge ook de TL:-->
   <Element>
        <Select>
         <Value>  (L:Inflight_TA,number) 2500 &gt; if{ 
           (L:Inflight_TA,number) 9000 ==  if{ 11000 (&gt;L:Inflight_TL,number) 1  (&gt;L:TATLFixed, bool) } (*** Hong Kong TL. lager dan 980, 120, gelijk of hoger dan 980, 110  ***) 
           (L:Inflight_TA,number) 10000 ==  if{ 11000 (&gt;L:Inflight_TL,number) 1  (&gt;L:TATLFixed, bool) }  (*** Australia ***)
           (L:Inflight_TA,number) 11000 ==  if{ 13000 (&gt;L:Inflight_TL,number) 1  (&gt;L:TATLFixed, bool) } (*** Philippines, Indonesia,Singapore,Thailand,Malaysia ***)    
           (L:Inflight_TA,number) 13000 ==  if{ 15000 (&gt;L:Inflight_TL,number) 1  (&gt;L:TATLFixed, bool) } (*** Middle East, Kuwait ***) 
           (L:Inflight_TA,number) 14000 ==  if{ 14000 (&gt;L:Inflight_TL,number) 1  (&gt;L:TATLFixed, bool) }  (*** Japan ***)  
           (L:Inflight_TA,number) 18000 ==  if{ 18000 (&gt;L:Inflight_TL,number) 1  (&gt;L:TATLFixed, bool) }  (*** USA ***) 
           (L:Inflight_TA,number) 9850 ==  if{ 11800 (&gt;L:Inflight_TL,number) 1  (&gt;L:TATLFixed, bool) }  (*** CHINA ***) 
           (L:Inflight_TA,number) 2510 ==  if{ 4000 (&gt;L:Inflight_TL,number) 1  (&gt;L:TATLFixed, bool) } (*** Aruba,Bonaire,Curacao ***)
           (L:Inflight_TA,number) 5010 ==  if{ 6500 (&gt;L:Inflight_TL,number) 1  (&gt;L:TATLFixed, bool) } (*** St Maarten,St Eustatius ***)
           } els{ 0 (&gt;L:TATLFixed, bool) }
         </Value>
        </Select>
   </Element>
  
   
   <!-- (PRINT Statements=====================================================================.-->


<!--Show ICAO Code De 0 zetting, 0 (>@c:NearestAirportCurrentLine) hier is erg belangrijk.-->

	<Element>
		<Position X="10" Y="0"/>
		<Text X="140" Y="14" Length="20" Font="Arial" Bright="Yes" Luminous="Yes" FontSize="14" Color="#00FF00">
			<String>%(0 (>@c:NearestAirportCurrentLine))%((@c:NearestAirportCurrentIdent, string))%!s!</String>
		</Text>
	</Element>
		
	<Element>
		<Position X="10" Y="15"/>
		<Text X="140" Y="14" Length="36" Font="Arial" Bright="Yes" Luminous="Yes" FontSize="14" Color="#00FF00">
			<String>%Name: %((@c:FacilityName))%!s!</String>
		</Text>
	</Element>
	
	<Element>
		<Position X="10" Y="26"/>
		<Text X="140" Y="14" Length="36" Font="Arial" Bright="Yes" Luminous="Yes" FontSize="14" Color="#00FF00">
			<String>%City: %((@c:FacilityCity))%!s!</String>
		</Text>
	</Element>
      
  </Gauge> 
   
