Sign in to follow this  
Guest JeanLuc_

Internal FS2K2 GPS System: Need Help Understanding

Recommended Posts

Folks,I am a newbie at this forum and at MS SDK programming for gauges and panels, so please excuse any dumb questions or comments in my ramblings below.I have been wanting to do a small GPS project for FS2K2. I have done serveral projects with FS2K2, using Peter Dowson's FSUIPC, with very good success. All of these projects have been pulling out information from the simulator. Now I want to write some data into the simulation.However, I do not see the right FSUIPC variables to access the internals of the GPS system in the flight sim, so I have resorted to look at the MS SDK's. Is this correct?I have read through the "Building Panels and Gauges" SDK, believe I have a rudimentary understanding of it, but am still confused. See below.I have successfully built and ran the flightmap from the AircraftPanel SDK using VC++6 IDE, which I understand must have the gps_export.dll in the modules directory (is there anyway not to use this DLL?). From sdk.flightmap.c, I see that they use the named variables "FS2002 GPS DATA" (to read information from the GPS) and "FS2002 GPS DATA REQUEST" to update the GPS info.I started modifying the sdk.flightmap.c code to start with something simple, such as clearing a current flightplan (such as from the flight planner dialog box, hitting "CLEAR"). However, my first attempt resulted in FS2K2 crashing.So I wrote a routine to just read the GPS information, and got what it was set to after clearing the flight plan (at Meigs, although I was probably setting on top of a big "X", thanks to Mr. Daly x( ):dwSize = 176dwUpdateRequest = 0vPosition.alt calc = 596.765234 feetvPosition.lat = N 41 51.24 degvPosition.lon = W 87 36.45 degdMagVar = W 0.999756 degdGroundSpeed = 0.000000 knotsdGroundHeading = 356.909996 degdGroundTrack = 357.909751 degbIsFlightPlanAvailable = FALSEbIsActiveWaypoint = FALSEbIsDirectTo = FALSElNextWp = 0vWpNext.alt calc = 0.000000 feetvWpNext.lat = N 00 00.00 degvWpNext.lon = E 00 00.00 degvWpPrevious.alt calc = 0.000000 feetvWpPrevious.lat = N 00 00.00 degvWpPrevious.lon = E 00 00.00 degdWpDistance = 0.000000 nmdWpBearing = 0.000000dWpCrossTrk = 0.000000 nmdWpReqHeading = 0.000000 degdAPHeading = 0.000000 deglWpCounts = 0pWpData = 00000000To clear the flightplan, I was going to do the following:gpsrequest->dwUpdateRequest = 2; gpsrequest->bIsFlightPlanAvailable = FALSE; gpsrequest->bIsActiveWaypoint = FALSE;gpsrequest->bIsDirectTo = FALSE;gpsrequest->lNextWp = 0; // No effect setting this to 0gpsrequest->lWpCounts = 0; // If I write 0 to here, it locks up, only 1 or above worksFrom the comments above, if I set lWpCounts to 0, the sim locks up. Althoug from above, when I cleared the flight plan using the sim, it was set to zero. So are some of these fields read only? How would you clear the flight planner?More preferrable, I would like to get rid of the internal GPS altogether, and use a program I write to control the autopilot and drive the CDI #1 when the NAV/GPS slave switch is set to GPS. However, I do not know the name of the named variables in the default gauges/autopilot. Are these MS proprietary? Are they known?Am I missing something obvious? Am I missing some documentation?To recap: 1. Is accessing the FS2K2 GPS system only available thru the SDKs?2. Is there anyway to get to the GPS named variables without using gps_export.dll?3. How would one clear the GPS flight plan without using the sim fucntions to give identical results to clearing the flight plan with the sim flight planner?4. Are some of the fields in the GPS_INFO structure read only?5. Is it possible to not use the internal GPS, and replace it with another GPS to drive the CDI and autopilot?Thanks in advance for any help (I really need it :-hmmm )RL_AVSIM:-newbie

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi,I'll try to add some info, as far as I know1) yes2) no3) don't know and suspect it is not possible to completely clear the FPL4) all of them. GPS_REQUEST is for writing5) yes, but it requires to go beyond the FS SDK and tools. An example of such GPS driving the default CDI/EHSI/EFIS are the Reality XP Apollo and Garmin GPS: www.reality-xp.comHope this helps!

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