Jump to content
Sign in to follow this  
n4gix

Current Airspace Frequency...

Recommended Posts

I have the following XML script working perfectly except for the Current Airspace Frequency (@c:NearestAirspaceCurrentFrequency), which remains INOP. Has anyone an idea what I'm leaving out?

				<Element>					<Position X="512" Y="455"/>					<FormattedText X="380" Y="188" Font="Glass Gauge" FontSize="20" LineSpacing="18" Adjust="Left" Color="Cyan" Bright="Yes" Tabs="0,5R,20R,150R">						<Font FontSize="14"/>						<Font FontSize="1"/>						<String>							%((@g:listCurrent) (>@c:NearestAirspaceCurrentLine) (@c:NearestAirspaceCurrentName) (>@c:NearestAirspaceCurrentFrequencyName) quit )%{end}							%((@c:NearestAirspaceCurrentType))							%{case}							%{:0}NONE\{fnt2}							%{:1}CENTER\{fnt2}							%{:2}CLASS_A\{fnt2}							%{:3}CLASS_B\{fnt2}							%{:4}CLASS_C\{fnt2}							%{:5}CLASS_D\{fnt2}							%{:6}CLASS_E\{fnt2}							%{:7}CLASS_F\{fnt2}							%{:8}CLASS_G\{fnt2}							%{:9}TOWER\{fnt2}							%{:10}CLEARANCE\{fnt2}							%{:11}GROUND\{fnt2}							%{:12}DEPARTURE\{fnt2}							%{:13}APPROACH\{fnt2}							%{:14}MOA\{fnt2}							%{:15}RESTRICTED\{fnt2}							%{:16}PROHIBITED\{fnt2}							%{:17}WARNING\{fnt2}							%{:18}ALERT\{fnt2}							%{:19}DANGER\{fnt2}							%{:20}NATIONAL_PARK\{fnt2}							%{:21}MODE_C\{fnt2}							%{:22}RADAR\{fnt2}							%{:23}TRAINING\{fnt2}							%{end}							%!s!\{fnt}\n							MAX ALTITUDE:\t\t%((@c:NearestAirspaceCurrentMaxAltitude, feet))%!d!\{fnt1}FT\{fnt}\n							MIN ALTITUDE:\t\t%((@c:NearestAirspaceCurrentMinAltitude, feet))%!d!\{fnt1}FT\{fnt}\n							FREQUENCY:\t\t%((@c:NearestAirspaceCurrentFrequency,MHz) s0 0 >)%{if}%l0%!3.3f!%{else}%----\{nr}						</String>					</FormattedText>				</Element>


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

Are you sure that Current Airspace Frequency exists?I don't have FSX but in FS9 I can't find an XML frequency element for a Boundary - which is used to define airspace. Frequencies are associated with airports and navaids. Allowable airport frequency types are APPROACH, ASOS, ATIS, AWOS, CENTER, CLEARANCE, CTAF, DEPARTURE, FSS, GROUND, MULTICOM, TOWER, UNICOM. Microsoft Flight Software Development KitSimulator 2004 - Compiling Scenery with BGLComp

Share this post


Link to post
Share on other sites
Are you sure that Current Airspace Frequency exists?I don't have FSX but in FS9 I can't find an XML frequency element for a Boundary - which is used to define airspace. Frequencies are associated with airports and navaids. Allowable airport frequency types are APPROACH, ASOS, ATIS, AWOS, CENTER, CLEARANCE, CTAF, DEPARTURE, FSS, GROUND, MULTICOM, TOWER, UNICOM. Microsoft Flight Software Development KitSimulator 2004 - Compiling Scenery with BGLComp
Thanks, Gerry. Come to think of it, the variable may well NOT exist in FS9. Unfortunately, ACES never provided an SDK list of available GPS token variables like they did for FSX, so we're forced to discover what does work and what doesn't the hard way... :( It doesn't work in FSX either. I guess I'll have to "fake it" somehow...What's truly odd is that the variable tokens are listed in the FSX SDK:
NearestAirspaceCurrentType FAC_BV_TYPE X NearestAirspaceCurrentFrequency Hertz X NearestAirspaceCurrentFrequencyName String X
This is how the end result appears in FS9 (the frequency is the nearest center frequency via a lookup):airspacealerts01.jpg...and in FSXairspacealerts02.jpgOdd that the FSX list doesn't include the ADVISORY and two Restricted Airspaces, but FSX does add the local CLASS D Airspaces... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

FWIW Bill, the variable is listed as a Get string in Susan Ashlock's FS2004 GPS Variables list of 27/11/05. However, she did state that some of them may not work.-Dai

Share this post


Link to post
Share on other sites
FWIW Bill, the variable is listed as a Get string in Susan Ashlock's FS2004 GPS Variables list of 27/11/05. However, she did state that some of them may not work.-Dai
Yes, I remembered to check my own Wiki entry where I'd stashed a copy of the FS9 GPS variables... ;)Well, they don't work in either FS9 or FSX, but I did manage to 'fake it' a bit by fetching the closest CENTER frequency (which is close enough for me).Hm, I haven't check out (@c:NearestAirspaceQuery,enum) yet... Maybe that'll give me an index value for the frequency... :(UPDATE:The final conclusion is that there are two reasons why this will not work1. ACES failed to enable the "Get" property of the variable NearestAirspaceCurrentName2. ACEs failed to enable the "Write" property of the variable NearestAirspaceCurrentFrequencyName:(@c:NearestAirspaceCurrentName) (>@c:NearestAirspaceCurrentFrequencyName)

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Hm, I haven't check out (@c:NearestAirspaceQuery,enum) yet... Maybe that'll give me an index value for the frequency... UPDATE:The final conclusion is that there are two reasons why this will not work1. ACES failed to enable the "Get" property of the variable NearestAirspaceCurrentName2. ACEs failed to enable the "Write" property of the variable NearestAirspaceCurrentFrequencyName:(@c:NearestAirspaceCurrentName) (>@c:NearestAirspaceCurrentFrequencyName)

Get capability for NearestAirspaceCurrentName is certainly enabled in the FS9 gps module. You say that it does not work in FSX? That's odd.I wouldn’t think NearestAirspaceQuery will lead anywhere regarding frequencies. Query just defines which airspaces to look for in the NearestAirspace search, somewhat analogous to the function of IcaoSearchStartCursor which tells the gps.dll which types of facilities to include in an IcaoSearch.My understanding of NearestAirspaceQuery:NearestAirspaceQuery is expressed in Hexadecimal format to more easily define the types of airspaces to include. It’s a six digit hex number which represents 24 bits of information (6 hex digits x 4 = 24 bits). Since each bit is a 1 or 0, it can be thought of as an individual ‘include’ / ‘do not include’ switch. Each of the bits is mapped to a specific airspace type. If the bit corresponding to Class C airspace (Bit 4) is set to 1, then the NearestAirspace search will include Class C airspaces, otherwise it will not. Any combination of airspace types can be searched by setting the right bits.On line 83 of the gps_500 xml gauge there is a parameter declaration named kDisplayedAirspaces that is assigned the hex value 0xEFC038. Converting this hex number to binary yields: 2..2....1....13..0....6....2....8....4....0 – Bit number (Bit 0 thru Bit 23 = 24 Bits) 1110 1111 1100 0000 0011 1000which contains 12 “1s”, meaning that there are 12 airspace types included in kDisplayedAirspaces.The list of the 24 airspace types is:Bit__Name _Type#0___NONE = 01___CENTER = 12___CLASS_A = 23___CLASS_B = 34___CLASS_C = 45___CLASS_D = 56___CLASS_E = 67___CLASS_F = 78___CLASS_G = 89___TOWER = 910__CLEARANCE = 1011__GROUND = 1112__DEPARTURE = 1213__APPROACH = 1314__MOA = 1415__RESTRICTED = 1516__PROHIBITED = 1617__WARNING = 1718__ALERT = 1819__DANGER = 1920__NATIONAL_PARK = 2021__MODE_C = 2122__RADAR = 2223__TRAINING = 23 Therefore, reading 1110 1111 1100 0000 0011 1000 from right to left, (the right-most digit is always Bit 0, the digit to its left is Bit 1, and so forth) and comparing each Bit to the Airspace Bit Table, the NearestAirspace search of kDisplayedAirspaces will include Class_B, Class_C, Class_D, MOA, RESTRICTED, PROHIBITED, WARNING, ALERT, DANGER, MODE_C, RADAR, and TRAINING airspace types. In fact, I note that these are listed in the comment line (line 82) directly above the kDisplayedAirspaces declaration.The other NearestAirspaceQuery listed in the gps_500 gauge is kAlwaysDisplayedAirspaces = 0x0FC000 (line 85). Its binary equivalent is:2..2....1....1 3..0....6....2....8....4....0 – Bit number 0000 1111 1100 0000 0000 0000which means that kAlwaysDisplayedAirspaces includes MOA, RESTRICTED, PROHIBITED, WARNING, ALERT, and DANGER airspace types.FWIW, I have not yet seen NearestAirspaceCurrentFrequency return anything, either. And if NearestAirspaceCurrentFrequency is always 0, then it will be fruitless chasing NearestAirspaceCurrentFrequencyName (which, if it existed, would not have SET capability according to the SDK). You and Dai are probably right about this being one of those dead variables in the gps module like FlightPlanWaypointMinAltitude.By the way, your gauge looks quite nice..as usual.Cheers,Bob

Share this post


Link to post
Share on other sites
... probably right about this being one of those dead variables in the gps module ...
I was a little too anxious to kill it, I see. I expanded the NearestAirspace query, and as far as the gps module in FS9 is concerned, NearestAirspaceCurrentFrequency and NearestAirspaceCurrentFrequencyName are both active. I suppose the same is true in FSX(?), but I don't have that sim loaded to see.Frequency and FrequencyName are found only in Airspace type = 1 = Center, so as a consequence, NearestAirspaceCurrentFrequencyName is, naturally, always "Center". (I found it interesting to see NearestAirspaceCurrentMaxAltitude = 100 kilometers = edge of space for Center. I guess that's true)However, using the default query in the gps_500 xml gauge, 0xEFC038, Center Airspace is not included in a NearestAirspace search, therefore Frequency and FrequencyName would appear inop unless the query is changed.0xEFC03A (>@c:NearestAirspaceQuery) will include Center airspace as well as the twelve other default airspace types (Class_B, Class_C, Class_D, MOA, RESTRICTED, PROHIBITED, WARNING, ALERT, DANGER, MODE_C, RADAR, and TRAINING) and then NearestAirspaceCurrentFrequency and NearestAirspaceCurrentFrequencyName will appear.For the heck of it, I'll upload an html tool to the BlackBox/GPS Viewer website in a day or two that will convert any airspace combination to the appropriate hexadecimal for anyone interested, although probably that isn't something most people that know enough to be messing with the gps module would need.For that matter, here it is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">	<head>		<title>GPS Airspace</title>		<style type="text/css">			body {				font-family: Arial, sans-serif;			}		</style>		<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.3.0/mootools-yui-compressed.js"></script>		<script type="text/javascript">			function refresh() {				var num = 0;				$('input').each(function(input) {					if (input.checked)						num += 1 << input.get('rel');				});				$('dec').set('text', num);				var hex = ('000000' + num.toString(16)).substr(-6).toUpperCase();				$('hex').set('text', '0x' + hex);			}			window.addEvent('domready', refresh);		</script>	</head>	<body>		<label>			<input type="checkbox" onclick="refresh()" rel="0" />			NONE		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="1" />			CENTER		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="2" />			CLASS_A		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="3" />			CLASS_B		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="4" />			CLASS_C		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="5" />			CLASS_D		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="6" />			CLASS_E		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="7" />			CLASS_F		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="8" />			CLASS_G		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="9" />			TOWER		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="10" />			CLEARANCE		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="11" />			GROUND		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="12" />			DEPARTURE		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="13" />			APPROACH		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="14" />			MOA		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="15" />			RESTRICTED		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="16" />			PROHIBITED		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="17" />			WARNING		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="18" />			ALERT		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="19" />			DANGER		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="20" />			NATIONAL_PARK		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="21" />			MODE_C		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="22" />			RADAR		</label>		<br />		<label>			<input type="checkbox" onclick="refresh()" rel="23" />			TRAINING		</label>		<br /><br />		<span id="hex">0x000000</span>          		<span id="dec">0</span>	</body></html>

Regards,Bob

Share this post


Link to post
Share on other sites

Thanks for the additional follow-up to your investigations, Bob. I'm certain it will be useful information for everyone who's got an interest in this matter... :(


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

This thread has been resurrected, Since my earlier post I have got FSX. I've also created some important boundaries in the UK around London Heathrow that were in FS9 but not in FSX!The FSX SDK now allows a comms element to be included in a boundary but it isn't required. This raises the question of FSX's response in the case where there isn't a frequency assciated with the current airspace boundary.I didn't add any frequencies to my boundaries because they would have been meaningless. Within any particular boundary there are different frquencies for inbound and outbound flights depending on the routing and on the partiicular VOR used. For example with the boundary TMA3, there are different frequencies for flights inbound via OCK and outbound via CPT and SAM: for inbound via LAM: for inbound via LAM (2 frequencies): and for oubound via LAM. As far as I can tell, there's no way FSX can model this level of detail.

Share this post


Link to post
Share on other sites

Since only one comm freq is supported, I would opt to at least include the "inbound" freq simply to allow the pilot a chance to request a transition... :(


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

That's a sensible suggestion but unfortunately the London situation is complicated. The overall TMA is built up from 18 separate closed boundaries (TMA1 - TMA18). Collectively these form the London TMA. Some have specific frequencies allocated - others don't.A further complexity is that some boundaries have more than one class of airspace. TMA 3 is Class A from 2500ft to FL195 and Class C from FL195 to FL245. I suppose I could have included 2 separate boundaries but I'm not sure that would achieve anything even if FSX could cope with that.

Share this post


Link to post
Share on other sites

That does sound like a very complex situation! Chicago airspace is complicated enough for me as it is... :(


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites

It is. It's compounded by the fact there are 4 other airports witn 40nm radius - Gatwick, City, Stansted & Luton.

Share this post


Link to post
Share on other sites

<Off topic>Some years ago I spent a full shift at West Drayton ATC as a guest of one of the controllers (full access - not just the public viewing gallery). Eight stations, each with one radarman, two manual controllers and two 'wingmen' watching the other three, covering the whole of UK overflight airspace. A shift pattern is thirty minutes on, thirty minutes off, it's that intensive. My friend was earning three times as much as I could ever hope to earn but deserved every penny.</off topic>.-Dai

Share this post


Link to post
Share on other sites
<Off topic>Some years ago I spent a full shift at West Drayton ATC as a guest of one of the controllers (full access - not just the public viewing gallery). Eight stations, each with one radarman, two manual controllers and two 'wingmen' watching the other three, covering the whole of UK overflight airspace. A shift pattern is thirty minutes on, thirty minutes off, it's that intensive. My friend was earning three times as much as I could ever hope to earn but deserved every penny.</off topic>.-Dai
West Drayton finally closed in 2007 when the last of its functions were transfered to the new centre at Swanwick.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...