Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Q. Add waypoint to flightplan or NAV1/2 using LAT/LON input

Featured Replies

Not totally clear for me.

You say: active (visible) when (L:ICP-SEQ, enum) is 1 and 3.

 

Then try:

 

<Visible>

(L:ICP-SEQ, enum) 1 ==

(L:ICP-SEQ, enum) 3 == |

</Visible>

 

or the rest too?

then:

 

<Visible>

(L:ICP-MODE, enum) 7 ==

(L:ICP-STPT, enum) 1 == |

(L:ICP-SEQ, enum) 1 == |

(L:ICP-SEQ, enum) 3 == |

</Visible>

 

 

and then

 

<Click>

4(>L:ICP-MODE, enum) if 12 (>L:ICP-LIST,enum) els @Increase(0)

</Click>

 

??

 

should it be:

<Click>

(L:ICP-MODE, enum) 4 ==

if{ 12 (>L:ICP-LIST,enum) }

els{ @Increase(0) }

</Click>

 

or

 

<Click>

4 (>L:ICP-MODE, enum)

12 (>L:ICP-LIST,enum)

@Increase(0)

</Click>

?

 

No way to test this.

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

Jan,

 

Thanks for your quick answer but it doesn't work. For the second part of your comment i've already had a discussion with Bill a few years ago when i was designing my initial keyboard. Bill came with the same comments as you do now, no offence to both of you! At that time i've tried to implement Bills solution but after that the keyboard did not work as i wanted too.

 

Since you are living in the Netherlands like i do, we could possibly meet each other so you could see how i do things with this cockpit i've made and will save a lot of bouncing up and down on this forum. I'm just a hobbiest, not a programmer. A lot of things i'm trying are by trial and error and are therefore unexplaineble for you programmers who understand fully how XML works in gauges. But do also try to think outside the box, there are more ways leading to Rome as they say overhere.

 

Jan, if you like to visit me (i live in Tiel), just email me on [email protected] and visit our VA at www.vrnlaf.nl (virtual Royal Netherlands Air Force)

 

Many thanks Slammer

  • Author

Jan, Bob, Bill and Karol,

 

Got the keyboard working as it should. Don't ask me why but it does with the following codes for the digits 0-9:

 

<!-- ********* 0 Digit **********-->
<Area Left="168" Right="198" Top="151" Bottom="171">
<Visible>(L:ICP-MODE, enum) 7 == (L:ICP-STPT, enum) 1 == (L:ICP-SEQ, enum) 1 == (L:ICP-SEQ, enum) 3 == |</Visible>
<Cursor Type="Hand"/>
<Click>
4(>L:ICP-MODE, enum) if 12 (>L:ICP-LIST,enum)  els @Increase(0)
</Click>
</Area>

 

and for the seperate dits 2 (N), 6 (E), 8 (S) and 4 (W) buttons on the keyboard:

 

<!-- ********* LATTITUDE/LONGITUDE N,E,S,W ENTRY KEYBOARD **********-->
<!-- ********* 2 Digit **********-->
<Area Left="86" Right="116" Top="53" Bottom="83">
<Visible>(L:ICP-MODE, enum) 7 == (L:ICP-STPT, enum) 1 == &(L:ICP-SEQ, enum) 1 == &&</Visible>
<Cursor Type="Hand"/>
<Click>
(L:LAT-E, bool) ! (>L:LAT-E, bool)
</Click>
</Area>
<!-- ********* 4 Digit **********-->
<Area Left="46" Right="76" Top="95" Bottom="125">
<Visible>(L:ICP-MODE, enum) 7 == (L:ICP-STPT, enum) 1 == &(L:ICP-SEQ, enum) 3 == &&</Visible>
<Cursor Type="Hand"/>
<Click>
(L:LAT-E, bool) ! (>L:LAT-E, bool)
</Click>
</Area>
<!-- ********* 6 Digit **********-->
<Area Left="126" Right="156" Top="95" Bottom="125">
<Visible>(L:ICP-MODE, enum) 7 == (L:ICP-STPT, enum) 1 == &(L:ICP-SEQ, enum) 3 == &&</Visible>
<Cursor Type="Hand"/>
<Click>
(L:LAT-E, bool) ! (>L:LAT-E, bool)
</Click>
</Area>
<!-- ********* 8 Digit **********-->
<Area Left="86" Right="116" Top="141" Bottom="171">
<Visible>(L:ICP-MODE, enum) 7 == (L:ICP-STPT, enum) 1 == &(L:ICP-SEQ, enum) 1 == &&</Visible>
<Cursor Type="Hand"/>
<Click>
(L:LAT-S, bool) ! (>L:LAT-S, bool)
</Click>
</Area>

 

Now starting with part 2 creating input fields and assigning N, E, S, W to the coordinates.........

 

Thanks for your help so far!

Slammer

Just curious.

What happens when you use

 

<Click>
4 (>L:ICP-MODE, enum)
12 (>L:ICP-LIST,enum)
@Increase(0)
</Click>

 

instead of

 

<Click>
4(>L:ICP-MODE, enum) if 12 (>L:ICP-LIST,enum) els @Increase(0)
</Click>

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

Jan,

 

You are right, as far as i can see it works the same, no strange occurances so far, thanks for that.

 

Slammer

  • Moderator

<Click>
4(>L:ICP-MODE, enum) if 12 (>L:ICP-LIST,enum) els @Increase(0)
</Click>

Honestly, I'm surprised it does anything with all of those missing characters and syntax errors... :Hypnotized:

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Author

Bill,

 

Yeah, your right about that, often i'm surprised by my own non-traditional way of handling things by trial and error and get things to work, ofcourse with help from cracks like you guys. Seems to me that XML is powerfull and capable of working around syntax errors. probably It wouldn't stick in a compiler i suppose.

 

But still not finished with this project, i noticed with the found solution for the keyboard that in other parts the keyboard does not function right and flips on and off everytime i hit het SEQ button. So trying to work around it.............to be continued....

 

Thanks Slammer

  • Author

Yep, also fixed that problem, made an alternate keyboard with a alternate SEQ switch within the original keyboard with the specific functions needed. Original keyboard functions are omited using (ICP-MODE, enum) 7 != in the visible statement. This way you can make as many keyboards as you like, expanding capabilities.

 

Greets Slammer

  • Author

Question,

 

I've read the post of Jan in which he explaines how to change lat/lon into decimal values. I understand how to calculate that into decimal values, but how will the macro look like to change the 9 numirical value (without dots) of the lat or lon i put in to the scratchpad into a deciamal value to prepare it for assigning to (>C:fs9gps:FlightPlanNewWapointLatitude or longitude, degrees)

 

Greetings Slammer

Well, not using coordinates, but try in <Update>

 

Some condition
if{
(L:char 14,enum) chr 10 * +
(L:char 13,enum) chr + (>L:latitude degrees,number)
(L:char 12,enum) chr 10 *
(L:char 11,enum) chr + (>L:latitude minutes,number)
(L:char 10,enum) chr 10 *
(L:char 9,enum) chr + (>L:latitude seconds,number)
(L:char 7,enum) chr 100 *
(L:char 6,enum) chr 10 * +
(L:char 5,enum) chr + (>L:longitude degrees,number)
(L:char 4,enum) chr 10 *
(L:char 3,enum) chr + (>L:longitude minutes,number)
(L:char 2,enum) chr 10 *
(L:char 1,enum) chr + (>L:longitude seconds,number)

(L:latitude degrees,number)
(L:latitude minutes,number) 60 / +
(L:latitude seconds,number) 3600 / +
(L:char 15,number) 78 == if{ 1 * } els{ -1 * } (>L:latitude test,number)

(L:longitude degrees,number)
(L:longitude minutes,number) 60 / +
(L:longitude seconds,number) 3600 / +
(L:char 8,number) 87 == if{ -1 * } els{ 1 * } (>L:longitude test,number)
}

 

I presume you know about <Keys> and entry's.

You need minimal 15!

 

Type on the keyboard always in this sequence, eg:

N521954E0044500

Then you can read the coordinates of SPL with:

 

%((L:char 15,number) 78 == )%{if}N%{else}S%{end}%((L:latitude test,number) abs)%!02.4f!
%((L:char 8,number) 87 == )%{if}W%{else}E%{end}%((L:longitude test,number) abs)%!03.4f!

 

The command:

 

(L:latitude test,number) (>@c:FlightPlanNewWaypointLatitude)
(L:longitude test,number) (>@c:FlightPlanNewWaypointLongitude)
(>@c:FlightPlanDirectToDestination)

 

Brings you from all over the world to the beacon.

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author

Jan,

 

Sorry that i get back so late at you but was on the familyday at Volkel AB. I'm not totally familiar with keys but lets see how far we come. I have two seperate fields for filling in N and S/E and W and two separate fields for filling in Latitude and Longitude. Will figure out how to cope with the statement and macro you send me. Thanks for your quick reaction. Btw did you receive pictures?

 

Greetz Slammer

No pics...

Btw. tested my code and it works ok.

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • 2 weeks later...
  • Author

Jan,

 

Thanx for your input, tried it but i have four inputfields LAT, COORDINATE, LON COORDINATE so i had to think of something else to calculate lat/lon to decimal degrees and came up with the following and it works.

 

<Macro Name="LATITUDE">
(L:ComGoldSetValue, number)
s1
  s0 90 <= if{ l0 100 * sp1 }
  1000000 9999999 l0 rng if{ l0 10 * sp1 }
  l1 1000000 % 10000 / int 10000 *
  1000000 9999999 l0 rng if{ l0 10 * sp1 }
  l1 10000 % 100 / int 100 * 60 / 100 * +
  1000000 9999999 l0 rng if{ l0 10 * sp1 }
  l1 100 % 3600 / 10000 * + 
  (L:LAT-N, bool) 1 == if{ 1 * } els{ -1 * } (>L:latitude decimal,number)
2 (>L:ICP-SEQ1,enum)
</Macro>
<Macro Name="LONGITUDE">
(L:ComGoldSetValue, number)
s1
  s0 180 <= if{ l0 100 * sp1 }
  10000000 99999999 l0 rng if{ l0 10 * sp1 }
  l1 100000000 % 1000000 / int 1000000 *
  10000000 99999999 l0 rng if{ l0 10 * sp1 }
  l1 1000000 % 10000 / int 10000 * +
  10000000 99999999 l0 rng if{ l0 10 * sp1 }
  l1 10000 % 100 / int 100 * 60 / 100 * +
  10000000 99999999 l0 rng if{ l0 10 * sp1 }
  l1 100 % 3600 / 100000 * +
  (L:LAT-E, bool) 0 == if{ -1 * } els{ 1 * } (>L:longitude decimal,number)
0 (>L:ICP-SEQ1,enum)
</Macro>

 

and for the enter button

 

(L:ICP-MODE,enum) 7 == (L:ICP-SEQ1,enum) 1 ==  if{
(L:ComGoldSetValue, number) 0 < (L:ComGoldSetValue, number) 1800000 > ||
@LATITUDE}
(L:ICP-MODE,enum) 7 == (L:ICP-SEQ1,enum) 3 ==  if{
(L:ComGoldSetValue, number) 000 < (L:ComGoldSetValue, number) 1800000 > ||
if{ 1 (>L:BIT, bool) 0 (>L:StpBootScreen,enum) 1 (>L:StpBootTime,enum)  }
els @LONGITUDE}

 

maybe not ok for standard xml format but suits in my keyboard.

 

not quit there but on to step three....

 

btw, after fully testing your solution (at which i said it worked ok) well it didn't. after pressing the 4 number on the keyboard it went directly to the list 4 page instead of producing a 4, i switcht back to original code with syntax errors, but works for me.

 

greetz Slammer

  • 2 months later...
  • Author

Just back from the holidays and fixed the problems, can enter lat/lon and program decides whether flightplan is active or not and switches automatically to DirectTo or AddWaypoint.

 

Also made a new page which calculates the ETA (along the flightplan) of any waypoint I choose. Als made a field for designated TOS or in military terms TOT in which i put in the time of the TOT, after hitting enter button the system calculates the G/S i have to fly to meet the designated TOT of any waypoint along the flightplan i choose. All thanks to the great GPS book.

 

If anyone is interested give me a call.

 

Jan, if you want the pictures of my cockpit, just send me an email at [email protected] I've tried to send you the pictures via this system but you didn't receive it.

 

Thanks all for your exellent help!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.