Sign in to follow this  
phjvh

adding waypoint based on nearest airports

Recommended Posts

I've got the NearestAirportCurrentLine that i need to add a waypoint based on what one has clicked on the screen. I was looking through the gps_295.xml and having a hard time finding how to add a waypoint based on this data. Any suggestions? Something to do with (@c:NearestAirportCurrentICAO) (>@c:WaypointAirportICAO)??Thanks,Steve

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

There is no way to add waypoints, and thus define a flight plan using the GPS system in a gauge. The best you can do is a "Direct To".

Share this post


Link to post
Share on other sites

What is a direct to and how would i do that? Also, what is going on in the gps gauge when you select a nearest airport?Thanks,Steve

Share this post


Link to post
Share on other sites

How to do a "Direct To" is buried in the XML code for the GPS. A "Direct To" is where you select a destination waypoint and then tell the GPS to go "direct to" it. It overwrites the current flight plan.As far as selecting nearest airport... it simply brings up information pertaining to that airport.

Share this post


Link to post
Share on other sites

Hi,gps:AddWayPoint should work.You might try :nIndex is the current gps index line where you want to insert the wp.You have already set the current "NearestAirport".Then,(@c:NearestAirportCurrentICAO) (>@c:FlightPlanNewWaypointICAO)andnIndex (>@c:FlightPlanAddWaypoint)The waipoint is "inserted" in the FP as an ordinal gps database's waypoint. User defined waypoints can also be inserted and given an IDENT. Waypoints can be deleted as well.Hope this helpsTom

Share this post


Link to post
Share on other sites

Hi,I didn't succeed to use that code.Do you have working code?I thought it is only usable in the fs flightplanner.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hey,Thanks for the help. Maybe you misunderstood me, but in the GPS you can select an airport then get the info. Once there you can "activate" it and it seems to become a waypoint or at least it appears in the waypoint part of the gps. Maybe i'm confused about what is actually going on.Thanks,Steve

Share this post


Link to post
Share on other sites

Jan,So far I tested, you need a flightplan loaded into FS for them to work (FlightPlanIsActiveFlightPlan=1), as they are a part of FlightPlan data. Maybe you tried to use them for building a FP from scratch?Tom

Share this post


Link to post
Share on other sites

Tom,That is correct.Will have another look at it.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hello Jan I got the load flight plan part working with:- (L:FMCPage,enum) 6 == (L:FMCPage_Sub,enum) 1 == & (L:HoldPage,bool) ! & if{ (@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO) (L:Scroll,number) your scroll position number (>@c:FlightPlanAddWaypoint) } It loads a waypoint into the FMC legs list in the chosen position and draws the line in the EHSI. Still working on the call waypoint from FS9 list.

Share this post


Link to post
Share on other sites

That makes sense. Just one question, what is the condition that needs to be met represent?Thanks,Steve

Share this post


Link to post
Share on other sites

Hi all Got the select waypoint, load into the FMC and show changes on the EHSI done but autopilot ignores the new waypoint. Is there a way to include the new waypoints in the plan. I found @g:activateLeg @FPLLegalLeg @g:directToActivateLeg in the FS9 GPS any info on these.

Share this post


Link to post
Share on other sites

Hi all,I am using the following code in my FMC(L:WaypointId,number) (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointRemainingDistance,nmiles) (@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO) (L:WaypointId,number) (>@c:FlightPlanAddWaypoint) 1 (>L:WPassed,bool) (L:WaypointId,number) (>@c:FlightPlanDeleteWaypoint) 1 (>L:WPassed,bool) (A:gps drives nav1,bool) 1 == if{ @WPRemDis 2.5 < if{ (L:WPassed,bool) 0 == if{ (L:WaypointId,number) ++ (>L:WaypointId,number) 1 (>L:WPassed,bool) } } els{ 0 (>L:wpassed,bool) } (L:WaypointId,number) (>@c:FlightPlanActiveWaypoint) } WaypointId=listCurrent for the default gps code.CalcLegs activates the next waypoint in the list when distance from current is less than 2.5nm (more sophisticated code can be added here).And two questions- How can we assign the current aircraft position (lat/lon) to waypoint ident and/or facility?- How can we add departure and destination airports?Costas

Share this post


Link to post
Share on other sites

Hello Costas Thanks, something there I can use. What are you try to achieve with the waypoint and aircraft position give more detail. I put the airports in with the ICAO code as waypoints. I don't think you can set them up as intended to show as departure and destination. Most of it now works, I can enter new waypoints in a FS loaded plan on through the FMC, The initial entry of a non FS flight plan waypoint closes the FS FP link to the autopilot but it flys the full route with all the user updated waypoints including updating all other information you get from the GPS WP info, DTG, TOC, TOD etc. I will post finished code soon.

Share this post


Link to post
Share on other sites

Hi,Very interested to see your finished codes. I still didn't succeed to produce a working one.Jan"Beatus ille qui procul negotiis..."

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