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.

GPS Distance to last WPT

Featured Replies

Hi!1. qu.)I looked for a variable for the distance to the last WPT of a GPS flight plan, but I couldn't find anything!Which VAR do you need to get the distance to the last WPT?(XML or C).2. qu.)Can I show my own String in the little help window which appears if you move the cursor above a gauge? In XML it's easy to do it with String , but how to do this in C?MOUSE_BEGIN(pause_wpt_mouse_rect,0,0,0) <--???Regards,Harry

to 1. in C and only FS2002 so far, you can use the info from "gps_info.h" to load the complet eflightplan and thus having the last waypoint's coordinates. AFAIK the needed gps_export.dll is for FS2002 only, hopefully the FS2004 SDK will include a new version.to 2. tryMOUSE_BEGIN(pause_wpt_mouse_rect,0,0,0)... MOUSE_PARENT_BEGIN(0,0,width,height,HELP_NONE) MOUSE_TOOLTIP_STRING("string") MOUSE_PARENT_END...MOUSE_END"string" can be a fully qualified XML tooltip stringArne Bartels

Harry,Did you try something with:GPS WP DISTANCE GPS WP ETE in combination with:GPS WP PREV ID GPS WP PREV LAT GPS WP PREV LON Jan"Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

MOUSE_BEGIN(pause_wpt_mouse_rect,0,0,0) MOUSE_TOOLTIP_STRING("string")MOUSE_ENDis the minimum code.Arne Bartels

Part of formula:Something like, not sure, tested:L:Lat2,number) (A:PLANE LATITUDE, degrees) dgrd (>L:Lat1,number) (A:GPS WP PREV LON,degrees ) (A:PLANE LONGITUDE, degrees) - dgrd (>L:DiffLon,number)(L:Lat1,number) sin (L:Lat2,number) sin * (L:Lat1,number) cos (L:Lat2,number) cos * (L:DiffLon,number) cos * + acos (>L:Dist,number) (L:Dist,number) gives the distance between plane and last waypoint.Jan"Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

Hi!Thank you for your answers!I wanted to do the Gauge in C, as I've started it there. I can't really figure out how to get information from the last WPT!(I've had a look at the gps_info.h, but didn't help) How to get some information about the last WPT?(distance or time to goal or position or whatever is possible...!?)(BTW I'm using FS2002...so no GPS functions in XML I'm afraid)Regards,Harry

I haven't programmed anything with it yet, but the SDK.Flightmap.c suggests://include the gps_info header:#include "gps_info.h"//use "hook" to gpds datastatic GPS_INFO* gpsinfo = NULL;//In a gauges_cb hook the pointer to the data:void FSAPI FlightMapCallback ( PGAUGEHDR pgauge, SINT32 service_id, UINT32 extra_data ){ switch (service_id) { case PANEL_SERVICE_PRE_UPDATE: if (!gpsinfo) { //if not on hook retry MODULE_VAR var; initialize_var_by_name (&var, GPS_INFO_PANEL_VARIABLE_NAME); gpsinfo = var.var_ptr; } //do something with the gps data if (gpsinfo && gpsinfo->dwSize >= sizeof (GPS_INFO)) //the expected gps data are present { int i; //loop through waypoints for (i = 0; i < gpsinfo->lWpCounts; i++) { if(gpsinfo->pWpData&&gpsinfo->pWpData.dwSize==sizeof(GPS_WP_INFO)) //do something with the waypoint data } } break; }}e.g. gpsinfo->pWpData[gpsinfo->lWpCounts-1].vPosition is the last waypoints positionArne Bartels

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.