January 30, 200422 yr 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
January 30, 200422 yr 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
January 30, 200422 yr 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..."
January 31, 200422 yr MOUSE_BEGIN(pause_wpt_mouse_rect,0,0,0) MOUSE_TOOLTIP_STRING("string")MOUSE_ENDis the minimum code.Arne Bartels
January 31, 200422 yr Harry,You can use the WP in coniunction with the great circle route, see:http://forums.avsim.net/dcboard.php?az=sho...ing_type=searchJan"Procul Negotiis" Jan "Beatus ille qui procul negotiis..."
January 31, 200422 yr 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..."
January 31, 200422 yr 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
January 31, 200422 yr 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