Jump to content
Sign in to follow this  
phjvh

adding waypoint based on nearest airports

Recommended Posts

Hi,The link doesn't work.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hi Jan Try thisType in your ICAO letters Example (one letter key FMC)(@c:IcaoSearchCursorPosition) 0 == if{ @EnterLetter 69 chr (>@c:IcaoSearchEnterChar) }Shows your typed ICAO waypoint in FMC window (@c:IcaoSearchCursorPosition) 0 >0%((@g:enteringInput) 31 == )%{if}%((@c:IcaoSearchCurrentIdent) slen sp1 0 sp0 )%{loop}%((@c:IcaoSearchCursorPosition) l0 ==)%{if}{blnk}%{end}%((@c:IcaoSearchCurrentIdent) l0 symb d slen 0 == if{ p ' '})%!s!{nr}%(l0 ++ s0 l1 <=)%{next}%{end}Enter your waypoint ICAO code in chosen LSK key position in FMC window FP listExample (one LSK key FMC)(L:FMCPage,enum) 6 == (L:FMC_Sub,enum) 1 == & if{ (@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO) (L:your FP list,number) nn (>@c:FlightPlanAddWaypoint) @RemoveSearchLetter 1 (>L:AlteredFPLN,bool) }Delete your waypointExample (one LSK key FMC) (L:FMCPage,enum) 6 == (L:FMC_Sub,enum) 1 == & (L:Delete,bool) & if{ (L:your FPlist,number) nn (>@c:FlightPlanDeleteWaypoint) 1 (>L:AlteredFPLN,bool) 0 (>L:Delete,bool) Flys the flight plan(A:GPS WP DISTANCE, nmiles) s12 3 <= l12 2.8 >= && if{ (L:AlteredFPLN,bool) (L:WPassed,enum) 0 == & if{ (A:GPS FLIGHT PLAN WP INDEX,number) 1 + (>@c:FlightPlanActiveWaypoint) 1 (>L:WPassed,enum) } } l12 4 <= l12 3.7 >= && (L:WPassed,enum) 1 == & if{ 0 (>L:WPassed,enum) } MacrosAuto clears the IcaoSearchCursorPosition for use of key inputs for other things10 19 (@g:enteringInput) rng if{ -1 (>@c:IcaoSearchAdvanceCharacter) quit } @InvokeICAOInputMode((@c:FacilityICAO), ' ', 31) }Enters your ICAO for search and database match 10 19 (@g:enteringInput) rng if{ -1 (>@c:IcaoSearchAdvanceCharacter) quit } @InvokeICAOInputMode((@c:FacilityICAO), 'AVNWM', 31) }LVars FS flightplan is changed and cancelled to fly the Altered route (L:AlteredFPLN,bool)Once you enter or remove a waypoint autopilot will only fly the original plan and whatever you changed. On the ground or during the flight You can put any ICAO code in and add it to plan Apt,Ndb,Vor etc. Updates all usual gps info with new inputs.Suggestions and improvements welcome. Paul


Paul EGLD

Share this post


Link to post
Share on other sites

Hi Paul,I use another approach in my FMC keyboard. Instead of typing :(@c:IcaoSearchCursorPosition) 0 == if{ @EnterLetter 69 chr (>@c:IcaoSearchEnterChar) }26 times, one for each key, I prefer to use a "client-server" mode:@Key(69)@Key(70)Etc,Then in the section:(L:Key Code,number) s49 0 !=if{ (@c:IcaoSearchCursorPosition) 0 == if{ @EnterLetter l49 chr (>@c:IcaoSearchEnterChar) } 0 (>L:Key Code,number) }The macros:@1 (>L:Key Code,number)Rest are yours. The big ones will be inserted only once in the compiled code.This kind of approach saves some final code thus improving the gauge's load time and I guess its performance as well.Just my two cents :-)Tom

Share this post


Link to post
Share on other sites

Hi,Looking at your codes!For the Keyboard I use (letter R for example):R82 chr (>C:fs9gps:IcaoSearchEnterChar)etc.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Forgot this:Range (rng) operator is very useful too:Instead of:(value) n1 <= (value) n2 >= and use:n1 n2 (value) rng This is found in the gps code, and to be honest it took me a long time to "discover" its meaning.Tom

Share this post


Link to post
Share on other sites

Hello Tom,Jan Tom, I'll give the Client server a try looks neat. Does rng only work in the GPS? Jan, Use that key entry so I can use the computer keyboard. Forgot the "replace deleted FP waypoint" code Stores the deleted waypoint code for re entry if wantedExample (one LSK key FMC)FMC page number (L:Delete,bool) & if{ (L:your FP list,number) nn (>@c:FlightPlanWaypointIndex) (@c:FlightPlanWaypointICAO) (>@c:FacilityICAO) @InvokeICAOInputMode((@c:FacilityICAO), 'AVNWM', 31) } (@c:IcaoSearchCurrentIdent) slen 0 != if{ 1 (>L:Control22,bool) } (L:Control22,bool) if{ (L:DTO_index,enum) (>@c:FlightPlanDeleteWaypoint) 1 (>L:AlteredFPLN,bool) 0 (>L:Delete,bool) 1 (>L:Erase,bool) } } Puts the saved deleted waypoint back in the correct positionYour put it back in key. FMC page number (L:Erase,bool) & if{ (@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO) (L:your FP list,number) nn (>@c:FlightPlanAddWaypoint) @RemoveSearchLetter } Paul


Paul EGLD

Share this post


Link to post
Share on other sites

Hi,Because of my "special" code I have problems to understand:(L:your FP list,number) nn (>@c:FlightPlanAddWaypoint)What is the equivalent in the GPS code?Btw. does this also work with a "Direct-to" flightplan?Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Hello Jan I don't use a GPS code for that, Post one of your LSK key codes I will look. Not sure what you mean by direct to flightplan if you use the GPS direct-to you can cancel and return to plan with (>@c:FlightPlanCancelDirectTo) I haven't done anything with that yet. Paul


Paul EGLD

Share this post


Link to post
Share on other sites

Paul,I use:10 19 (@g:enteringInput) rng if{ -1 (>@c:IcaoSearchAdvanceCharacter) quit } @InvokeICAOInputMode((@c:FacilityICAO), 'AVNWM', 31) }To enter ICAO codeand (L:legs,enum) 1 == (LEGS PAGE)if{ (@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO) (What here???) (>@c:FlightPlanAddWaypoint) @RemoveSearchLetter 1 (>L:AlteredFPLN,bool) } to enter the new waypoint and that gives a lot of strange results.The problem of course is:(What here???) (>@c:....Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Jan Very different from my setup, Try the value (A:GPS FLIGHT PLAN WP INDEX,number) may work for you. Do you use (L:Scroll,number) command to move through your FMC route display, Thats the way I do it links the keys to the chosen insertion posititon and no conflicts. ie. (@c:FacilityICAO) (>@c:FlightPlanNewWaypointICAO) (L:ScrollDisplay,number) 2 + --- 3 + --- 4 + etc.(>@c:FlightPlanAddWaypoint) @RemoveSearchLetter 1 (>L:AlteredFPLN,bool) } Paul


Paul EGLD

Share this post


Link to post
Share on other sites

Paul,I use:(@g:listScroll) after "cursor on" and (L:scroll,number) to shift blocks of 4 lines and the scrollbar, it gives the next page.That makes it difficult to "translate".In a direct-to flightplan i only enter the destination airport and approach.May be inserting waypoints doesn't work here.I almost never use the official FS-flightplanner.Jan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites

Jan I made own Scroll code and have 5 line blocks working this in the CRJ Collings FMC. I use only Flightplans and info from FS GPS You may need a legs page like this to make it work. (L:Scroll,number) %((@c:FlightPlanWaypointsNumber) s2 0 !=) %{if} %(0 sp1) %{loop} %(l1 (>@c:FlightPlanWaypointIndex)) {clr2}{fnt1}%((@c:FlightPlanWaypointMagneticHeading,degrees) d360)%!03d!%° t%((@c:FlightPlanWaypointRemainingDistance, nmiles))%!3d! NMtn {clr1}{fnt}%((@c:FlightPlanWaypointIdent))%!s!%{fnt2}%((@c:FlightPlanWaypointIndex) (L:HOLD_index,enum) == (L:HoldSwitch, bool) & )%{if} HOLD AT%{end}%(l1 ++ s1 l2 <) n %{next} %{end} %{end} What line spacing do you use in the legs page. Paul


Paul EGLD

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