• 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.

Multiple Waypoint Solve

Messages
95
Country
malta
Dear all,
I'm trying to do a very simple MCDU and I encountered this problem:

When I try to see multiple icaos with the same Ident, I'm trying to gain access to their lat/lon.

I have been partially successful if I query only one of the matched ICAOs, however, I get a 0 return if I ask for the lat/lon of one of the matched icao and another in an <Element> below. The code is the following and on its own it works fine. It's when I do another one with a different (>@c:IcaoSearchMatchedIcao) value that it goes berserk.

Any thoughts?

Code:
%( 0 (>@c:IcaoSearchMatchedIcao))%
%((@c:IcaoSearchCurrentIcao) (>@c:FacilityIcao))%
%((@c:FacilityLatitude, degrees) 0 &gt;)%{if}N%((@c:FacilityLatitude, degrees))%!02d!%{else}S%((@c:FacilityLatitude, degrees))%!02d!%{end}%\t%((@c:FacilityLongitude, degrees) 0 &gt;)%{if}E%((@c:FacilityLongitude, degrees))%!02d!%{else}W%((@c:FacilityLongitude, degrees))%!02d!%{end}%
          %{quit}

Thanks and Regards
 
Hi,

Getting lat/lons from an ICAO search is a bit tricky. If you have multiple ICAO transfers going on in the same update cycle, that's going to lead to trouble because it's a multi-cycle process that isn't explicitly accounted for in your script above. You are likely starting a second ICAO transfer before the first is complete. If you simply display lat/lon info in an Element, then the script, above, should work with one ICAO transfer, but not when a second is added.

I would handle the ICAO transfer, Facility lat/lon lookup process in an <Update> section loop where I could build in the necessary cycle skips, storing retrieved Facility lat/lons in L:Vars, then use the L:Vars in the display element(s) after the Update work is done.

And I would delay execution of that transfer loop until the Ident is fully entered. When you begin entering Ident characters in an IcaoSearch, you may get several ICAO matches. But by the time the last character of the Ident is entered, there are rarely more than a few matches. That's the time to start the ICAO transfer loop in <Update>. One XML example of a loop through the matched ICAOs is shown on page 35 of the guidebook. It uses a 3 cycle skip to complete the ICAO transfer which I have found is the minimum required.

As an aside, this sort of IcaoSearch issue can be handled a little more efficiently using Tom Aguilo's XMLVars to create an array of L:Vars (XMLVars) for the lat and lon matches. If you are familiar with XMLVars, I could expand on this a little more.

Bob
 
Last edited:
Hello Bob !

Thank you so, so much for the reply. That's exactly what I had to do in order for it to work.

And by the way, I would also like to thank you for that guide book. It can't be better, everything explained perfectly. I use it constantly as a reference.

If I ever get to release it (freeware), I will definitely acknowledge you.
 
Following up on the comment about XMLVARS ...

An ICAO Search is a type of problem that lends itself to use of Tom Aguilo's XMLTools, specifically, the XMLVARS class. You don't know how many ICAO matches will result ahead of time, but with XMLVARS, you can dynamically create an array of L:Vars in which to store ICAO lat and lon for display, after the ICAO search tells you how many matches were found. So, this is one example of how XMLVARS can be used to create an L:Var array.

The attached is a fully functional gauge written in FS9 XML format for use in FSX and requires installation of XMLTools (but works in FS9 if XMLVARS for FS9 is installed). It's intended to be set up in its own 200x130 window in panel.cfg.

upload_2014-7-12_2-39-47.png


To operate:
  1. Left click the Green box
  2. Type in the Ident
  3. Left click the Green box again and the Icao Search will commence
Backspace is functional. To clear all of the entered text, right click anywhere in the white text read-back box.
The red R button in lower right is a Reload button.

One can even sort the display according to Distance from the aircraft rather than ICAO alphabetical using the Bubble Sort macro found here. However, the last time I mentioned this it sparked a robust debate.

Cheers,

Bob

[edit] cleaned up XML file and added more comments
 

Attachments

Last edited:
Thanks a lot Bob !

Sorry for the late reply but I always thought that I was logged into this forum when in actual fact I was not.
 
Back
Top