Search the archive:
YaBB - Yet another Bulletin Board
 
   
 
Page Index Toggle Pages: 1
Send Topic Print
Netpipes SDK (Read 758 times)
Feb 23rd, 2003 at 10:36am

NewbieJack   Offline
Lieutenant Colonel
I love YaBB 1G - SP1!

Posts: 8
*****
 
I am a new C++ programmer and am trying to extract the Lat, Lon, Altitude and Airspeed parameters from the Flight Sim 2002 aircraft and feed it to another application.
I found the Netpipes SDK, which I am sure is sufficient for a good programmer to do the task, but I am having trouble with it.
If this is not the right Forum, please advise where I should go. Be kind javascript:grin()
Grin

I have modified the "Sample" netpipes code so it does not send the data from Flight Sim to another computer on a LAN, but merely writes it to the Netpipes buffer[2048].
I am trying to read the buffer and printf the key data I want in the dos window,
I can find the FRIB records that have the data I want, and am able to printf the ASCII character data. The problem is printing the numerical data. No matter what format I use I can't get the numbers to print correctly. For example, the Latiitude at Melbourne Florida is about 28 degrees, but my printf produces 36 3E 45 FFFFFFC0 33 FFFFFFEE 19 3C 40.    Using the IEEE standard for floating point arithmetic, I can see that the 3C 40 part of my output is around 28, but again I can not get the formats to print it out in decimal. Any guidance concerning the correct way to print this data would be greatly appreciated.
 
IP Logged
 
Reply #1 - Feb 23rd, 2003 at 11:44am

FSTipster   Offline
Colonel
There are no stupid questions,
only stupid answers
U.K.

Gender: male
Posts: 1514
*****
 
Hi Jack and welcome to the forum,

This is a bit above my head (to say the least) but that output looks like Hex format to me. I'd say you might be needing a hex conversion routine at the data capture point to obtain the decimal output.

I could be completely wrong of course - this is a long way from any area I have any expertise in.
 

...&&
Click the banner to visit the site
IP Logged
 
Reply #2 - Feb 23rd, 2003 at 12:05pm

NewbieJack   Offline
Lieutenant Colonel
I love YaBB 1G - SP1!

Posts: 8
*****
 
Thank you for the reply.
The array defined within Netpipes is a char type. And I have tried many types of conversions to try to get the numeric data out in floating point format. For example:
printf("Lon:        %lf\n",(double)buffer[j+30]);  but it gives erroneous results.
I will keep trying. Thanks for your guidance.
Jack
 
IP Logged
 
Reply #3 - Feb 23rd, 2003 at 12:08pm

JohnP   Offline
Colonel
I love YaBB 1G - SP1!

Posts: 182
*****
 
SmileyNot knowing exactly what you are trying to do, it is a little difficult to give you any specific answers. I do some designing and the program I use, you can move the plane around to find the latitude and longitude of a building, when you want to place it. You might also check the Microsoft Fs2002 SDK site, to see if they have any info. that may help you. The URL is:
   http://zone.msn.com/flightsim/FS02DevDeskSDK00.asp

Hope this helps. Smiley
 
IP Logged
 
Reply #4 - Feb 23rd, 2003 at 12:14pm

FSTipster   Offline
Colonel
There are no stupid questions,
only stupid answers
U.K.

Gender: male
Posts: 1514
*****
 
Apologies Jack - I misread your original post.

That hex is the output not the original content isn't it.

Are you sure Floating point is what you want for Lat/Long?

Bearing in mind that the result is Xyy  aa.aa
where X is N or W, yy is the degrees (yyy in the right area - might nead an optional 1 or 0 for the leading y) and aa.aa being the minutes and seconds.

I was thinking you might be better trying to slot the output into an alphanumeric array with that layout. Depends whether you're intending to do calculations with it I guess.
 

...&&
Click the banner to visit the site
IP Logged
 
Reply #5 - Feb 23rd, 2003 at 12:18pm

JohnP   Offline
Colonel
I love YaBB 1G - SP1!

Posts: 182
*****
 
SmileyYou could also post your question on the panel and scenery design forum, since gauge programmers need to get down to the programming level to get the numbers youn are looking for. Smiley
 
IP Logged
 
Reply #6 - Feb 23rd, 2003 at 12:21pm

NewbieJack   Offline
Lieutenant Colonel
I love YaBB 1G - SP1!

Posts: 8
*****
 
JohnP
You are right. That URL is the where I got the Netpipes SDK. It was very helpful in explaining the formats of the data.
My problem is in deciphering the FRIB records.
Did you design the program you use to get the Latitude and Longitude of the aircraft?
 
IP Logged
 
Reply #7 - Feb 23rd, 2003 at 12:27pm

JohnP   Offline
Colonel
I love YaBB 1G - SP1!

Posts: 182
*****
 
SmileyNo, the program I use is abacus's FSDS2.0, a commericial program.I myself am trying to learn c++. I am way at the bottom of the learning curve.
 
IP Logged
 
Reply #8 - Feb 23rd, 2003 at 12:30pm

NewbieJack   Offline
Lieutenant Colonel
I love YaBB 1G - SP1!

Posts: 8
*****
 
FS2002tipster:

I wrongly assumed the Lat/Lon would be Floating point. I will try your suggestion with the alphanumeric array.

Thank You,
Jack
 
IP Logged
 
Reply #9 - Feb 23rd, 2003 at 12:40pm

NewbieJack   Offline
Lieutenant Colonel
I love YaBB 1G - SP1!

Posts: 8
*****
 
JohnP:
Thanks for the suggestion to post my question on the panel and scenery design forum. I was concerned that I was bothering people here that were not interested in this kind of detail. But you and FS2002tipster have given me several good sugestions. I will try them before I bother the folks on the panel and scenery design forum.
Jack
 
IP Logged
 
Reply #10 - Feb 28th, 2003 at 2:01pm

NewbieJack   Offline
Lieutenant Colonel
I love YaBB 1G - SP1!

Posts: 8
*****
 
Well, in the last 5 days I have tried many combinations to convert the Hex information:

36 3E 45 FFFFFFC0 33 FFFFFFEE 19 3C 40

into decimal 28.1, but I have not found the right combination.

Any additional suggestions would be appreciated.
 
IP Logged
 
Reply #11 - Feb 28th, 2003 at 3:30pm

FSTipster   Offline
Colonel
There are no stupid questions,
only stupid answers
U.K.

Gender: male
Posts: 1514
*****
 
Quote:
Well, in the last 5 days I have tried many combinations to convert the Hex information:

36 3E 45 FFFFFFC0 33 FFFFFFEE 19 3C 40

into decimal 28.1, but I have not found the right combination.

Any additional suggestions would be appreciated.


Hi again Jack,

I recently got to grips (well - a little bit) with the Panels & Gauges SDK.

I know you're programming this in C:++, but you might try this:

Assign the output for the various values to your own variables, as numeric. I'd hope the Netpipes SDK allows you to do this (the panels and Gauges SDK does).  You effectively cut the Hex element out of the equation then, and consequently, the necessary conversion process.

If C:++ won't allow you to do that, it might be necessary to try and access the information with XML and assign the value using that. Then call your own variable values from the XML element. (Don't know how easy/difficult that is I'm afraid - I've never programmed in C:++)

The relevant XML variables are:


PLANE LATITUDE
PLANE LONGITUDE
PLANE ALTITUDE
AIRSPEED TRUE or AIRSPEED INDICATED (depending on which you want.)
 

...&&
Click the banner to visit the site
IP Logged
 
Reply #12 - Feb 28th, 2003 at 9:06pm

NewbieJack   Offline
Lieutenant Colonel
I love YaBB 1G - SP1!

Posts: 8
*****
 
FS2002tipster,

I will definitely explore both of your suggestions (C++ numeric and XML).

In the Netpipes SDK description of the Property Dictionary Section Data, I note that the Property field is described as used in the XML gauges.  And I have been able to find the ASCII characters,within the PDIB data, for the XML variables PLANE LATITUDE, PLANE LONGITUDE, etc., within the Netpipes Buffer []. The PDIB record seems to be  where one finds the XML variables needed, and obtains the associated Property ID, needed to find that variable value within the Frame Section Data record (FRIB).

I have some experience with HTML and went to the Library and got a an XML book to explore your second alternative. I'll be sure to let you know what happens.
Thanks again!
 
IP Logged
 
Reply #13 - Mar 12th, 2003 at 10:00am

NewbieJack   Offline
Lieutenant Colonel
I love YaBB 1G - SP1!

Posts: 8
*****
 
Just a closing message.

I finally resulted to severe bit-twiddling and converted the IEEE double numeric information to someting I could use to get the Lat, Lon and Alt.

Thanks again to those that provided suggestions.
Smiley
 
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print