Search the archive:
Simviation Main Site
|
Site Search
|
Upload Images
Simviation Forum
›
Old Flight Simulator Series
›
FS 2002
› Netpipes SDK
(Moderators: Mitch., Fly2e, ozzy72, beaky, Clipper, JBaymore, Bob70, BigTruck)
‹
Previous Topic
|
Next Topic
›
Pages: 1
Netpipes SDK (Read 758 times)
Feb 23
rd
, 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.
Back to top
IP Logged
Reply #1 -
Feb 23
rd
, 2003 at 11:44am
FSTipster
Offline
Colonel
There are no stupid questions,
only stupid answers
U.K.
Gender:
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
Back to top
IP Logged
Reply #2 -
Feb 23
rd
, 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
Back to top
IP Logged
Reply #3 -
Feb 23
rd
, 2003 at 12:08pm
JohnP
Offline
Colonel
I love YaBB 1G - SP1!
Posts: 182
Not 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.
Back to top
IP Logged
Reply #4 -
Feb 23
rd
, 2003 at 12:14pm
FSTipster
Offline
Colonel
There are no stupid questions,
only stupid answers
U.K.
Gender:
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
Back to top
IP Logged
Reply #5 -
Feb 23
rd
, 2003 at 12:18pm
JohnP
Offline
Colonel
I love YaBB 1G - SP1!
Posts: 182
You 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.
Back to top
IP Logged
Reply #6 -
Feb 23
rd
, 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?
Back to top
IP Logged
Reply #7 -
Feb 23
rd
, 2003 at 12:27pm
JohnP
Offline
Colonel
I love YaBB 1G - SP1!
Posts: 182
No, 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.
Back to top
IP Logged
Reply #8 -
Feb 23
rd
, 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
Back to top
IP Logged
Reply #9 -
Feb 23
rd
, 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
Back to top
IP Logged
Reply #10 -
Feb 28
th
, 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.
Back to top
IP Logged
Reply #11 -
Feb 28
th
, 2003 at 3:30pm
FSTipster
Offline
Colonel
There are no stupid questions,
only stupid answers
U.K.
Gender:
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
Back to top
IP Logged
Reply #12 -
Feb 28
th
, 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!
Back to top
IP Logged
Reply #13 -
Mar 12
th
, 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.
Back to top
IP Logged
Pages: 1
‹
Previous Topic
|
Next Topic
›
« Home
‹ Board
Top of this page
Forum Jump »
Home
» 10 most recent Posts
» 10 most recent Topics
Current Flight Simulator Series
- Flight Simulator X
- FS 2004 - A Century of Flight
- Adding Aircraft Traffic (AI) & Gates
- Flight School
- Flightgear
- MS Flight
Graphic Gallery
- Simviation Screenshots Showcase
- Screenshot Contest
- Edited Screenshots
- Photos & Cameras
- Payware Screenshot Showcase
- Studio V Screenshot Workshop
- Video
- The Cage
Design Forums
- Aircraft & 3D Design
- Scenery & Panel Design
- Aircraft Repainting
- Designer Feedback
General
- General Discussion
- Humour
- Music, Arts & Entertainment
- Sport
Computer Hardware & Software Forum
- Hardware
- Tweaking & Overclocking
- Computer Games & Software
- HomeBuild Cockpits
Addons Most Wanted
- Aircraft Wanted
- Other Add-ons Wanted
Real World
- Real Aviation
- Specific Aircraft Types
- Autos
- History
On-line Interactive Flying
- Virtual Airlines Events & Messages
- Multiplayer
Simviation Site
- Simviation News & Info
- Suggestions for these forums
- Site Questions & Feedback
- Site Problems & Broken Links
Combat Flight Simulators
- Combat Flight Simulator 3
- Combat Flight Simulator 2
- Combat Flight Simulator
- CFS Development
- IL-2 Sturmovik
Other Websites
- Your Site
- Other Sites
Payware
- Payware
Old Flight Simulator Series
- FS 2002 ««
- FS 2000
- Flight Simulator 98
Simviation Forum
» Powered by
YaBB 2.5 AE
!
YaBB Forum Software
© 2000-2010. All Rights Reserved.