• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Nearest Airport Page issues

Messages
278
Country
ca-britishcolumbia
Ok, windling down the known issues (Stress the Known). I have been working on the Nearest Airport Page function. It is not operating the way I intended it. It took a long time for me with the patience of rpmc, n4gix and taquilo to even get this going and now after at least fourteen hours of finding it is acting weird, cannot get it to work properly. The Code is as follows:

Update:
Code:
<!--**************** Nearest Airport Initilize ****************-->
  (L:(L:NearestAirportPage,bool) 0 ==
  if{ (L:ARPTScrollStart,enum) 1 (>L:NearestAirportPage,bool) }

Element:
Code:
<!--**************** Nearest Airport Display ****************-->
<Element Name="Nearest Airport Page">
  <Position X="0.000" Y="0.000"/>
  <Visible>(L:MFDOffOn,bool)</Visible>
  <Element Name="Nearest Airport Page">
    <Position X="0.000" Y="0.000"/>
    <Visible>
      (L:NearestAirportPage,bool)
      (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
      (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
      500 (>@c:NearestAirportMaximumItems) 
      375 (>@c:NearestAirportMaximumDistance, NMiles) 
    </Visible>
    <Element>
      <Position X="112.00" Y="57.00" />
      <Rectangle Width="684" Height="600" LineWidth="5" Color="#00324b" FillColor="#000050" Luminous="Yes" />
      <Element Name="Airport Display Page">
        <Position X="15.000" Y="5.000"/>
        <FormattedText X="650" Y="583" Font="Arial Black" FontSize="24" Bold="Yes" Bright="Yes" Color="White" Adjust="Left" VerticalAdjust="Center"  Multiline="Yes">
        <String>
        Nearest Airport Search \n\n
        %((@c:NearestAirportItemsNumber) s2 0 !=)
        %{if}
        %((L:ARPTScrollStart,enum) sp1 (L:ARPTScrollEnd,enum) l2 min sp3) 
        %{loop}
        %(l1 (>@c:NearestAirportCurrentLine))
        %((@c:NearestAirportCurrentIdent))%!1s!%\{nr}\t\t\t
        Bearing:\t\t\t%((@c:NearestAirportCurrentTrueBearing, degrees) (A:GPS MAGVAR, degrees) - d360)%!03d!\{dplo=M}\t\t\t
        Distance:\t\t\t%((@c:NearestAirportCurrentDistance, nmiles))%!.1f!\{dpl=nm}\n
        %((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportSelectedAirportName))%!s!\n
        Apr:\t%((@c:NearestAirportCurrentBestApproach))%!s!\t
        Elev:\t%((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportSelectedAirportElevation, feet))%!d!\{dpl=ft}\t\t
        \{tabs=50R,60,145,244R}
        Rwy:\t%((@c:NearestAirportCurrentLongestRunwayLength, feet))%!d!\{dpl=ft}\t\t
        Type:\t%((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportSelectedRunwaySurface))%{case}
        %{:1}Concrete%{:2}Asphalt%{:101}Grass%{:102}Turf%{:103}Dirt%{:104}Coral%{:105}Gravel%{:106}Oil%{:107}Steel
        %{:108}Bituminus%{:109}Brick%{:110}Macadam%{:111}Planks%{:112}Sand%{:113}Shale%{:114}Tarmac%{:115}Snow%{:116}Ice%{:201}Water%{end}
        %(l1 ++ s1 l3 &lt; d)
        %{if}\n\{lsp=4}\{ladj=L}\{tabs=}\{line=400}\n%{end}
        %{next}
        %{end}
      </String>
        </FormattedText>
      </Element>
    </Element>
  </Element>
</Element>

The Mouse section:
Code:
<!--**************** Airport Menu Buttons ****************-->
  <Area Left="350.000" Top="550.000" Width="200" Height="50">
    <Visible>(L:MFDMainMenu,bool) (L:AirportInfoMenu,bool)</Visible>
    <Cursor Type="Hand"/>
    <Tooltip>NEAREST AIRPORT SEARCH</Tooltip>
    <Click>
      (L:NearestAirportPage,bool) ! (>L:NearestAirportPage,bool)
      0 (>L:AirportInfoMenu,bool)
      0 (>L:MFDMainMenu,bool)
      (L:NearestAirportPage,bool) 1 ==
      if{
      (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
      (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
      500 (>@c:NearestAirportMaximumItems) 
      375 (>@c:NearestAirportMaximumDistance, NMiles) }
    </Click>  
  </Area>
  <Area Left="685.000" Top="725.000" Width="100" Height="45">
    <Visible>(L:NearestAirportPage,bool)</Visible>
    <Cursor Type="UpArrow" Repeat="Yes"/>
    <Tooltip>SCROLL UP</Tooltip>
    <Click Repeat="Yes">
      (L:ARPTScrollStart,enum) -- 0 max (>L:ARPTScrollStart,enum)
      (L:ARPTScrollStart,enum) 5 - (L:ARPTScrollEnd,enum)
    </Click>  
  </Area>
  <Area Left="685.000" Top="770.000" Width="100" Height="45">
    <Visible>(L:NearestAirportPage,bool)</Visible>
    <Cursor Type="DownArrow" Repeat="Yes"/>
    <Tooltip>SCROLL DOWN</Tooltip>
    <Click Repeat="Yes">
      (L:ARPTScrollEnd,enum) ++ (@c:NearestAirportItemsNumber) min (>L:ARPTScrollEnd,enum)
      (L:ARPTScrollEND,enum) 5 - (>L:ARPTScrollStart,enum)
    </Click>  
  </Area>

As it is now (see pictures) it opens with the single origin airport, then when you scroll down it gives four empty segments then the origin airport, then starts scrolling. This is fine and think I understand that the mouse section is set to move 5 segments at a time, which when i change the 5 to a one becomes unstable and may move it anywhere. also with the current configuration it sometimes move through 5 airports, then 10 then 15 etc...
Reading the SDK and trying diffrent things still leaves me in confused blank. What I would like it to do is when you initiate the Nearest Page it Starts at the origin with displays until the page is full, in this case seems to be 5 airports. Then when you scroll down or up it does at one airport at a time.

Any suggestions or ideas? I really am thinking I am beginning to suffer code burn out, but on the bright side I have windled the bugs down to 4 more issues, everything else seems to functioning flawlessly.

Thanks
Greg
 

Attachments

  • Screenshots-01.jpg
    Screenshots-01.jpg
    76.4 KB · Views: 404
  • Screenshots-02.jpg
    Screenshots-02.jpg
    105 KB · Views: 360
Greg,

i did some programming with airports, vor, ndb some years ago.

http://library.avsim.net/search.php?SearchTerm=nav-info.zip&CatID=fs2004gau&Go=Search

Maybe it helps a litte.

After a short look you should make for this
Code:
     (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
      (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
      500 (>@c:NearestAirportMaximumItems) 
      375 (>@c:NearestAirportMaximumDistance, NMiles)

an own element.
Similar as you did in the mouse area.

Code:
      (L:NearestAirportPage,bool) 1 ==
      if{
         (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
         (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
         500 (>@c:NearestAirportMaximumItems) 
         375 (>@c:NearestAirportMaximumDistance, NMiles)
        }

So NearestAirportCurrentL.... will be always updated.

Edi
 
I think this should be 5 +

Code:
 (L:ARPTScrollStart,enum) 5 - (L:ARPTScrollEnd,enum)

Code:
 (L:ARPTScrollStart,enum) 5 + (L:ARPTScrollEnd,enum)

The linecounter starts with 0.

To show airport from 9 to 14.

(L:ARPTScrollStart,enum) = 9
(L:ARPTScrollEnd,enum) = 9 + 5

Edi


(>L:ARPTScrollStart,enum) may not become less then 0

Code:
   (L:ARPTScrollEND,enum) 5 - 0 max (>L:ARPTScrollStart,enum)

Use a simple test - gauge which writes the (>L:ARPTScrollStart,enum) and (>L:ARPTScrollEnd,enum)
on your screen. So you can see what's going on.
 
Last edited:
Well, I'd begin by fixing the error in the <Update> section first...

Code:
<!--**************** Nearest Airport Initilize ****************-->
  [COLOR="Red"](L:[/COLOR](L:NearestAirportPage,bool) 0 ==
  if{ [COLOR="Red"](L:ARPTScrollStart,enum)[/COLOR] 1 (>L:NearestAirportPage,bool) }

The syntax error on the first line will prevent the script from being run.

I've no idea whatever you are expecting the red highlighted variable in the second line to do or have done to it...
...only that absolutely nothing will happen by or to it as it's written. :)
 
Last edited:
Thanks for the response. I have spent the morning trying to solve this again and although I think I have made some progress, really am not sure. Thanks for pointing out the update, it must have been a left over from a previous version. I tend to draw out of copies when i have messed it up so badly and it doesn't work anymore ort I have forgotten where I started. I never saw that when i was posting last night. Here is where I am at, and I will attempt to make some sense in what I would like.

The Update (which I truly hope is doing something).
Code:
<!--**************** Nearest Airport Initilize ****************-->
  (L:NearestAirportPage,bool) 1 ==
  if{ 
  (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
  (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
  500 (>@c:NearestAirportMaximumItems) 
  375 (>@c:NearestAirportMaximumDistance, NMiles) }

The Element (Areas I have been changing today are highlighted)
Code:
<Element Name="Nearest Airport Page">
  <Position X="0.000" Y="0.000"/>
  <Visible>(L:MFDOffOn,bool)</Visible>
  <Element Name="Nearest Airport Page">
    <Position X="0.000" Y="0.000"/>
    <Visible>
      (L:NearestAirportPage,bool)
      (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
      (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
      500 (>@c:NearestAirportMaximumItems) 
      375 (>@c:NearestAirportMaximumDistance, NMiles) 
    </Visible>
    <Element>
      <Position X="112.00" Y="57.00" />
      <Rectangle Width="684" Height="600" LineWidth="5" Color="#00324b" FillColor="#000050" Luminous="Yes" />
      <Element Name="Airport Display Page">
        <Position X="15.000" Y="5.000"/>
        <FormattedText X="650" Y="583" Font="Arial Black" FontSize="24" Bold="Yes" Bright="Yes" Color="White" Adjust="Left" VerticalAdjust="Center"  Multiline="Yes">
        <String>
        Nearest Airport Search \n\n
[COLOR="Red"]        %((@c:NearestAirportItemsNumber) s2 5 !=)
        %{if}
        %((L:ARPTScrollStart,enum) sp1 (L:ARPTScrollEnd,enum) l1 sp0)[/COLOR] 
        %{loop}
        %(l1 (>@c:NearestAirportCurrentLine))
        %((@c:NearestAirportCurrentIdent))%!1s!%\{nr}\t\t\t
        Bearing:\t\t\t%((@c:NearestAirportCurrentTrueBearing, degrees) (A:GPS MAGVAR, degrees) - d360)%!03d!\{dplo=M}\t\t\t
        Distance:\t\t\t%((@c:NearestAirportCurrentDistance, nmiles))%!.1f!\{dpl=nm}\n
        %((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportSelectedAirportName))%!s!\n
        Apr:\t%((@c:NearestAirportCurrentBestApproach))%!s!\t
        Elev:\t%((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportSelectedAirportElevation, feet))%!d!\{dpl=ft}\t\t
        \{tabs=50R,60,145,244R}
        Rwy:\t%((@c:NearestAirportCurrentLongestRunwayLength, feet))%!d!\{dpl=ft}\t\t
        Type:\t%((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportSelectedRunwaySurface))%{case}
        %{:1}Concrete%{:2}Asphalt%{:101}Grass%{:102}Turf%{:103}Dirt%{:104}Coral%{:105}Gravel%{:106}Oil%{:107}Steel
        %{:108}Bituminus%{:109}Brick%{:110}Macadam%{:111}Planks%{:112}Sand%{:113}Shale%{:114}Tarmac%{:115}Snow%{:116}Ice%{:201}Water%{end}
        %(l1 ++ s1 l3 &lt; d)
        %{if}\n\{lsp=4}\{ladj=L}\{tabs=}\{line=400}\n%{end}
        %{next}
        %{end}
      </String>
        </FormattedText>
      </Element>
    </Element>
  </Element>
</Element>

The Mouse Section
Code:
<!--**************** Airport Menu Buttons ****************-->
  <Area Left="350.000" Top="550.000" Width="200" Height="50">
    <Visible>(L:MFDMainMenu,bool) (L:AirportInfoMenu,bool)</Visible>
    <Cursor Type="Hand"/>
    <Tooltip>NEAREST AIRPORT SEARCH</Tooltip>
    <Click>
      (L:NearestAirportPage,bool) ! (>L:NearestAirportPage,bool)
      0 (>L:AirportInfoMenu,bool)
      0 (>L:MFDMainMenu,bool)
      (L:NearestAirportPage,bool) 1 ==
      if{
      (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
      (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
      500 (>@c:NearestAirportMaximumItems) 
      375 (>@c:NearestAirportMaximumDistance, NMiles) }
    </Click>  
  </Area>
 <Area Left="685.000" Top="725.000" Width="100" Height="45">
    <Visible>(L:NearestAirportPage,bool)</Visible>
    <Cursor Type="UpArrow" Repeat="Yes"/>
    <Tooltip>SCROLL UP</Tooltip>
    <Click Repeat="Yes">
      (L:ARPTScrollStart,enum) -- 0 max (>L:ARPTScrollStart,enum)
      (L:ARPTScrollStart,enum) 1 - (L:ARPTScrollEnd,enum)
    </Click>  
  </Area>
  <Area Left="685.000" Top="770.000" Width="100" Height="45">
    <Visible>(L:NearestAirportPage,bool)</Visible>
    <Cursor Type="DownArrow" Repeat="Yes"/>
    <Tooltip>SCROLL DOWN</Tooltip>
    <Click Repeat="Yes">
      (L:ARPTScrollEnd,enum) ++ (@c:NearestAirportItemsNumber) min (>L:ARPTScrollEnd,enum)
      (L:ARPTScrollEND,enum) 1 - (>L:ARPTScrollStart,enum)
    </Click>  
  </Area>

What this is currently doing is when initiated it:
1.) Starts at the Origin Airport (obviously the closest.
2.) Click the "Scroll Down" Button Once and nothing happens.
3.) Press the "Scroll Down" Button again and you the the Next Airport
4.) Pressing the Scroll Up button cycles through the airports one at a time.
5.) Pressing Scroll Down cycles the Airport ahead by one (In the picture Abbotsford, then if scolled up again advances by-passes another one)

I understand using the "-" or "+" operators adds or subtracts the values, but don't understand why this does not happen when the Scoll Up button is pressed. When I use the "--" or "++" operators I get undesirable results. I also dont understand why it is giving me blank returns. With the original code it would give me four, now gives one button click of nothing.

What I would like this page to do is display 5 airports (the most that will fit on the screen) then when you press the Scroll buttons it advance one airport at a time or backs up on airport at a time.

Also is having
Code:
 (L:NearestAirportPage,bool) 1 ==
      if{
      (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
      (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
      500 (>@c:NearestAirportMaximumItems) 
      375 (>@c:NearestAirportMaximumDistance, NMiles) }
in the Update Section, Visibilty Section in the element and the Mouse section to much or should I create its own element as Ed has suggested.

Thanks for any input, becuase I am absolutly at a complete loss.

Greg
 

Attachments

  • Screenshots-01.jpg
    Screenshots-01.jpg
    122.9 KB · Views: 394
  • Screenshots-02.jpg
    Screenshots-02.jpg
    119.2 KB · Views: 412
  • Screenshots-03.jpg
    Screenshots-03.jpg
    112.2 KB · Views: 399
Check your variable names. Capitalization is respected.

(L:ARPTScrollEND,enum)

Everywhere else you've used (L:ARPTScrollEnd,enum)

The <Update> section appears to be okay, but I'd add a one time initialization to it:

Code:
<!--**************** Nearest Airport Initilize ****************-->
  (L:NearestAirportPage,bool) 1 ==
  (L:DoOnce) ! and
  if{ 
  (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
  (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
  500 (>@c:NearestAirportMaximumItems) 
  375 (>@c:NearestAirportMaximumDistance, NMiles) 
  1 (>L:DoOnce,bool) }
 
Last edited:
Thanks Bill,
for pointing that error out. But never made a difference in my issue. I also took your advice and added the initialize once code.

Something like this:
Code:
<!--**************** Nearest Airport Initilize ****************-->
  (L:NearestAirportPage,bool) 1 ==
  (L:NearestAirportInit,bool) 1 and
  if{ 
  (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
  (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
  500 (>@c:NearestAirportMaximumItems) 
  375 (>@c:NearestAirportMaximumDistance, NMiles) 
  1 (>L:NearestAirportInit,bool)}

If I am correct i also add this to the Mouse section like this?
Code:
 (L:NearestAirportPage,bool) 1 ==
      (L:NearestAirportInit,bool) ! and
      if{
      (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
      (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
      500 (>@c:NearestAirportMaximumItems) 
      375 (>@c:NearestAirportMaximumDistance, NMiles) 
      1 (>L:NearestAirportInit,bool) }
    </Click>

Thanks again, will keep plugging away at it.

Greg
 
Check your variable names. Capitalization is respected.
Are you sure about that???
I've never experienced case sensitivity in my XML gauges (at least not in FSX).
I normally do keep the same case, but just to make sure I just threw together a little test gauge with different capitalizations, and they all were interpreted correctly:
Code:
<Gauge Name="Test" Version="1.0">

  <Element>
    <FormattedText X="100" Y="20" FontSize="16" >
      <String>
        %((L:aAa,enum))%!d!, 
        %((L:bBb,enum))%!d!, 
        %((L:cCc,enum))%!d!, 
      </String>
    </FormattedText>
  </Element>
       
  <Element>
    <Shift>
      <Value>
        111 (&gt;L:AAA,enum)
        222 (&gt;L:Bbb,enum)
        333 (&gt;L:ccc,enum)
      </Value>
    </Shift>
  </Element>
   
</Gauge>
 
Still playing with this, could some one please tell me if i am understanding what is happening in this code segement. Sorry it is a bit lengthy.

In the Update and Mouse Section:
Code:
  (L:NearestAirportPage,bool) 1 ==
  (L:NearestAirportInit,bool) 1 and
  if{ 
  (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
  (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
  500 (>@c:NearestAirportMaximumItems) 
  375 (>@c:NearestAirportMaximumDistance, NMiles) 
  1 (>L:NearestAirportInit,bool)}

when the Nearest Airport Page is activitated, this list is being triggered for sure once.
Then guage is creating a list of up to 500 airports at a max distance of 375 nm. If I am reading this segment right.

In the Element Segment:

In the <Visible> statement:
Code:
  <Visible>
    (L:NearestAirportPage,bool)
    (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
    (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
    500 (>@c:NearestAirportMaximumItems) 
    375 (>@c:NearestAirportMaximumDistance, NMiles) 
    </Visible>

In order for the display to be visible the following conditions must be met.

1.) The page must be activited "(L:NearestAirportPage, bool)"


2.) Using the GPS Position a search is conducted for Nearest Airports
"(A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians)
(A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians)"


3.) Then out of that search a list is created using up to 500 airports max at a maximum range of 375 nm.
"500 (>@c:NearestAirportMaximumItems)
375 (>@c:NearestAirportMaximumDistance, NMiles)"


When these conditions are met the page will be displayed.

Now where I think I am getting confused is the begining of the string portion:
Code:
 <String>
        Nearest Airport Search \n\n
        %((@c:NearestAirportItemsNumber) s2 0 !=)
	%{if}
	%((L:ARPTScrollStart,enum) sp1 (L:ARPTScrollEnd,enum) l2 min sp3) 
        %{loop}

The above portion is telling me that the 1st line will be displayed followed by two spaces then
in the next line:

It has the list of airports asking that the 1st airport be stored, then enabling the following {if} statement if the condition is not "0".

Then the {if} statement is enabling the "Scroll Up/Down" buttons saying that the Scroll Start "(L:ARPTScrollStart,enum)"
should save the and display the first airport. Which If I am correct is why i am getting the original single display.

Then the line is further saying that the Scroll End "(L:ARPTScrollEnd,enum)" should load and display the saved value from line 2 "(@c:NearestAirportItemsNumber) s2"
then at a minimum should save and display the next airport.

Then in the mouse section:

The Nearest Airport Search Button:
Code:
 <Area Left="350.000" Top="550.000" Width="200" Height="50">
    <Visible>(L:MFDMainMenu,bool) (L:AirportInfoMenu,bool)</Visible>
    <Cursor Type="Hand"/>
    <Tooltip>NEAREST AIRPORT SEARCH</Tooltip>
    <Click>
      (L:NearestAirportPage,bool) ! (>L:NearestAirportPage,bool)
      0 (>L:AirportInfoMenu,bool) 0 (>L:MFDMainMenu,bool)
      (L:NearestAirportPage,bool) 1 ==
      (L:NearestAirportInit,bool) ! and
      if{
      (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
      (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
      500 (>@c:NearestAirportMaximumItems) 
      375 (>@c:NearestAirportMaximumDistance, NMiles) 
      1 (>L:NearestAirportInit,bool) }
    </Click>  
  </Area>

Is activitating the Nearest Airport page, turning off the display menus, then conducting a search with the already know criteria.

The Scroll Up Button:
Code:
 <Area Left="685.000" Top="725.000" Width="100" Height="45">
    <Visible>(L:NearestAirportPage,bool)</Visible>
    <Cursor Type="UpArrow" Repeat="Yes"/>
    <Tooltip>SCROLL UP</Tooltip>
    <Click Repeat="Yes">
      (L:ARPTScrollStart,enum) -- 0 max (>L:ARPTScrollStart,enum)
      (L:ARPTScrollStart,enum) 1 - (L:ARPTScrollEnd,enum)
    </Click>  
  </Area>

This is saying the Scroll Start should derease the value by one with each click (5-4=3) Should display the third airport.
I have no clue what the "0 max" is doing, never have since we looked at this last February. The next line I believe is saying
From start to end decrease one or "SELECT" the previous airport. Which it seems to be doing.

The Scroll Down Button:
Code:
  <Area Left="685.000" Top="770.000" Width="100" Height="45">
    <Visible>(L:NearestAirportPage,bool)</Visible>
    <Cursor Type="DownArrow" Repeat="Yes"/>
    <Tooltip>SCROLL DOWN</Tooltip>
    <Click Repeat="Yes">
      (L:ARPTScrollEnd,enum) ++ (@c:NearestAirportItemsNumber) min (>L:ARPTScrollEnd,enum)
      (L:ARPTScrollEnd,enum) 1 - (>L:ARPTScrollStart,enum)
    </Click>  
  </Area>

This is asking for the Scroll Down button to take the next airport from the created list. Once again have no idea what the min is doing. then displaying it.
The next line is saying working backwards from End to Start decrease the airport or Select the previous airport.

I have no idea why this is compounding the selected airports or 5 when you place that number there, basically i don't understand why when you say push the "Scoll down" button four times, then and then "Scroll Up" button is pushed three times the next "Scoll Down" button press will still display the fifth airport (4+1=5), basically where is it gathering its info from.

Thanks for everything...

Greg
 
Wow a breakthrough and boy do I feel Stupid!!!!
I have been chasing this all over a ">" Expression...:mad::banghead::censored:

This works and will toggles one airport "up" and one airport "down"
Code:
 <Area Left="685.000" Top="725.000" Width="100" Height="45">
    <Visible>(L:NearestAirportPage,bool)</Visible>
    <Cursor Type="UpArrow" Repeat="Yes"/>
    <Tooltip>SCROLL UP</Tooltip>
    <Click Repeat="Yes">
      (L:ARPTScrollStart,enum) --  max (>L:ARPTScrollStart,enum)
      (L:ARPTScrollStart,enum) ++ (>L:ARPTScrollEnd,enum)
    </Click>  
  </Area>
  <Area Left="685.000" Top="770.000" Width="100" Height="45">
    <Visible>(L:NearestAirportPage,bool)</Visible>
    <Cursor Type="DownArrow" Repeat="Yes"/>
    <Tooltip>SCROLL DOWN</Tooltip>
    <Click Repeat="Yes">
      (L:ARPTScrollEnd,enum) ++ (@c:NearestAirportItemsNumber) min (>L:ARPTScrollEnd,enum)
      (L:ARPTScrollEnd,enum) -- (>L:ARPTScrollStart,enum)
    </Click>  
  </Area>

I still have the issue of the display only showing one airport at a time and the button still does nothing on the first click, which leads me to belive it is a blank return. Any ideas or suggestions always welcome.

Thanks
Greg
 
Ok I finally figured it out. Although not exactly what I wanted, but am happy with the results. One page per airport with all the necessary information. Press Scroll Down it advances one airport. Press Scroll Up it goes back one airport.

The Final Element Segment:
Code:
<Element Name="Nearest Airport Page">
  <Position X="0.000" Y="0.000"/>
  <Visible>(L:MFDOffOn,bool)</Visible>
  <Element Name="Nearest Airport Page">
    <Position X="0.000" Y="0.000"/>
    <Visible>
      (L:NearestAirportPage,bool)
      (A:GPS POSITION LAT, Radians) (>@c:NearestAirportCurrentLatitude, Radians) 
      (A:GPS POSITION LON, Radians) (>@c:NearestAirportCurrentLongitude, Radians) 
      500 (>@c:NearestAirportMaximumItems) 
      375 (>@c:NearestAirportMaximumDistance, NMiles) 
    </Visible>
    <Element>
      <Position X="112.00" Y="57.00" />
      <Rectangle Width="684" Height="600" LineWidth="5" Color="#00324b" FillColor="#000050" Luminous="Yes" />
      <Element Name="Airport Display Page">
        <Position X="15.000" Y="5.000"/>
        <FormattedText X="650" Y="583" Font="Arial Black" FontSize="24" Bold="Yes" Bright="Yes" Color="White" Adjust="Left" VerticalAdjust="Center"  Multiline="Yes">
        <String>
        Nearest Airport Search \n\n
        %((@c:NearestAirportItemsNumber) s2 0 !=)
	%{if}
	%((L:ARPTScrollStart,enum) sp1 (L:ARPTScrollEnd,enum) l2 min sp3) 
        %{loop}
        %(l1 (>@c:NearestAirportCurrentLine))\{clr}%((@c:NearestAirportCurrentLine))%!-5d!\t
        %((@c:NearestAirportCurrentIdent))%!1s!%\{nr}\t\t-\t
        %((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportSelectedAirportName))%!s!\n
        Class:\t%((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportCurrentAirportKind))%{case}
        %{:0}Unkown%{:1}Hard%{:2}Soft%{:3}Water%{:4}Helipad%{:5}Private%{end}\n
        Longest Runway Direction:\t%((@c:NearestAirportCurrentLongestAirportDirection, degrees) (A:GPS MAGVAR, degrees) - d360)%!03d!\{dplo=m}\n\n%
        Bearing:\t\t\t%((@c:NearestAirportCurrentTrueBearing, degrees) (A:GPS MAGVAR, degrees) - d360)%!03d!\{dplo=M}\t\t\t\t\t
        Distance:\t\t\t%((@c:NearestAirportCurrentDistance, nmiles))%!.1f!\{dpl=nm}\n\n
        Recommended\tApproach:\t\t
        %((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportCurrentBestApproachEnum))%{case}
        %{:0}SALS%{:1}VFR%{:2}HEL%{:3}TACAN%{:4}NDB%{:5}LORAN%{:6}RNAV%{:7}VOR%{:8}GPS%{:9}SDF%{:10}LDA%{:11}LOC%{:12}MLS%{:13}ILS%{end}\n
        Elevation:\t\t
        %((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportSelectedAirportElevation, feet))%!d!\{dpl=ft}\n
        Runway\tLength:\t\t
        %((@c:NearestAirportCurrentLongestRunwayLength, feet))%!d!\{dpl=ft}\n
        Runway\tType:\t\t
        %((@c:NearestAirportCurrentLine) (>@c:NearestAirportSelected) (@c:NearestAirportSelectedRunwaySurface))%{case}
        %{:1}Concrete%{:2}Asphalt%{:101}Grass%{:102}Turf%{:103}Dirt%{:104}Coral%{:105}Gravel%{:106}Oil%{:107}Steel
        %{:108}Bituminus%{:109}Brick%{:110}Macadam%{:111}Planks%{:112}Sand%{:113}Shale%{:114}Tarmac%{:115}Snow%{:116}Ice%{:201}Water%{end}\n\n
        Communications:\n\n
        %((@c:NearestAirportCurrentComFrequencyName))%!s!\t\t\t\t\t\t
        %((@c:NearestAirportCurrentComFrequencyValue, MHz) 1000 * near d 1000 div)%!03d!.%(1000 %)%!03d!
        %(l1 ++ s1 l3 &lt; d)
        %{end}
        %{next}
        %{end}
      </String>
        </FormattedText>
      </Element>
    </Element>
  </Element>
</Element>

Which in turn gives me whats in the picture. I still for the life of me figure out why i have to press the "Scroll Down" button twice at the start to get the list moving though. Also has anyone tried to add the picture of the airport in their gauges? I have seen it done and the FSX map does a very simple one, just a thought and thought it would look good on this page.

Thanks again
Greg
 

Attachments

  • Screenshots-01.jpg
    Screenshots-01.jpg
    107.3 KB · Views: 429
  • Screenshots-02.jpg
    Screenshots-02.jpg
    107.3 KB · Views: 322
  • Screenshots-03.jpg
    Screenshots-03.jpg
    107.4 KB · Views: 333
Back
Top