Jump to content
Sign in to follow this  
Guest _ak

fs9gps in C/C++ gauges

Recommended Posts

Guest _ak

I have searched for a while and found several code piecesFor example PCSTRINGZ str;execute_calculator_code("(C:fs9gps:FlightPlanTitle,string)",NULL,NULL,&str);But it always return "0." string in both FS9 and FSX, also tryed several other variabled and got zeroes all the times. FLight plan was loaded of course.What I need is a reliable way to extract flight plan from GPS. In FS9 I use pGaugeCallback with GPS variables IDs in gpsprop.h file that was posted here long ago. Works well in FS9 but doesn't work in FSX, pGaugeCallback->GetPropertyValue(FS9GPS_FlightPlanWaypointsNumber, &wptCount) always returns zero.There is also the old way: GPS_INFO* gpsinfo = NULL; MODULE_VAR var; initialize_var_by_name (&var, GPS_INFO_PANEL_VARIABLE_NAME); gpsinfo = (GPS_INFO*)var.var_ptr;But it also gives NULL pointer sometimes.Can anyone help to deal with it?

Share this post


Link to post
Share on other sites
Guest _ak

I have exactly the same trouble as in this topic http://forums.avsim.net/dcboard.php?az=sho...36864&mode=fullI tryed to make some simple XML gauge that should copy some values from C:fs9gps to L: variables, which I can read in C code.And I've got into trouble with strings copyingI can display a string by code%((@c:FlightPlanDepartureAirportIdent,string))%!s!But when I try to copy this value (@c:FlightPlanDepartureAirportIdent,string) (> L:FlightPlanDepartureAirportIdent,string)L:FlightPlanDepartureAirportIdent only get "0." value!Something simpler like 'test' (> L:TestVar,string) doesn't work either

Share this post


Link to post
Share on other sites

LVars don't support string assignments ie if you something like this:'test' (>L:MyVar,string) the content of L:MyVar will be 0.Only CustomVars (C: type) support strings, providing you enable string properties on your custom C++ DLL.Tom

Share this post


Link to post
Share on other sites
Guest _ak

thank you for the answerIt seems chr and ord symbol by symbol is the only way :(

Share this post


Link to post
Share on other sites

FS9 had gps_export.dll in the Modules folder. FSX has no Modules folder, having moved all .dll files to the root FSX folder.Either copy/paste a copy of gps_export.dll to your root FSX folder, or create a Modules folder, place a copy of gps_export.dll there, then edit your dll.xml file to define and load it.


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Share on other sites
Guest _ak

It has nothing to do with gps_export.dllActually the old way works fine when you load a saved flight but doesn't when you create a new one.Managed to complete my job with callback interfaces in C++, had completely forgotten about ConvertStringToProperty call. FS9 and FSX have different IDs for variables and that's why it refused to work with FS9 hardcoded values in gpsprop.hStill have some issues, but minimal required functionality works well ;)

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