Jump to content
Sign in to follow this  
Guest bookmark

itrafficinfo examples needed

Recommended Posts

Guest bookmark

Hi all,I am trying to make a simple radar screen showing AI around the aircraft. Does anyone know of a tutorial or some reference material of any kind that could help me work with the Traffic Toolbox and itrafficinfo? Like a basic example of source code to start from.I am using VC++ 2005 for this btw, the rest of the gauges are in XML though. Haven't coded gauges in C for two years so a little rusty... ;) Cheers,Thomas

Share this post


Link to post
Share on other sites

>Hi all,>>I am trying to make a simple radar screen showing AI around>the aircraft. Does anyone know of a tutorial or some reference>material of any kind that could help me work with the Traffic>Toolbox and itrafficinfo? Like a basic example of source code>to start from.>>I am using VC++ 2005 for this btw, the rest of the gauges are>in XML though. Haven't coded gauges in C for two years so a>little rusty... ;) >>Cheers,>Thomas>>There's a C++ tutorial in the FS2004 Panels.sdk , 'ItrafficInfo.doc' file.Just follow the steps in that example, it seems to work fine.Regards.Ernie.


ea_avsim_sig.jpg

Share this post


Link to post
Share on other sites
Guest bookmark

Thanks Ernie!Yes I knew about the sample code in the SDK, but making it work for me is another thing... I am obviously doing something wrong. That is why I was looking for more code examples.I use VC++ 2005 Express. Having successfully compiled other gauges with this setup, I now get the following compiling errors: V:gaugesinc..incITrafficInfo.h(9) : error C2061: syntax error : identifier 'ITrafficInfo' V:gaugesinc..incITrafficInfo.h(9) : error C2059: syntax error : ';' V:gaugesinc..incITrafficInfo.h(9) : error C2059: syntax error : ':'What could be the problem here? Thanks /Thomas

Share this post


Link to post
Share on other sites
Guest nocones

Hi, I'm getting the same errors when I try to compile a gauge using trafficInfo functions and I was wondering if you ever found out how to correct it. Thanks,Eric

Share this post


Link to post
Share on other sites

Where are you #define'ing itrafficinfo.h file???This is the format I use for all gauges that require itrafficinfo.h file. This is in the main .cpp file for the project:#include "..incfs9gauges.h"#include #include #define ULONG_PTR DWORD#define UNICODE#include using namespace Gdiplus;#include "MyGauge.h"#include "..incgpsprop.h"#include "..incacparams.h"#include "..incitrafficinfo.h"


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 bookmark

Thanks Bill! I actually managed to solve the error myself since I started this topic some months ago. The header file was messed up, by me as usual. Mea culpa.My C/C++ programming skills are still very rusty, since I make everything in XML these days. So to avoid wasting everybody's time I was looking for some complete samples to get me started, e.g. printing data for the nearest 20 aircraft as strings. Unlike most people, I have some difficulties understanding the SDK...So thanks anyway, but now it's back to "C++ for morons" I guess.Cheers /ThomasProud father of the J 35J Draken for FS2004http://flightsim.bookmark.se

Share this post


Link to post
Share on other sites
Guest bartels

I have a source example for a DLL in the pipeline where I program a radar screen for use with XML and C gauges, with ITrafficInfo and GDI+. Actually my "old" RadarGauge as DLL for XML usage.Anyone interested?

Share this post


Link to post
Share on other sites

Very interested Arne! Been working on the same thing as it turns out. Might save me a ton of coding.Thanks!Doug

Share this post


Link to post
Share on other sites
Guest bookmark

Me too! Me too! ;o) Something like that would really save the day. Thanks /Thomas

Share this post


Link to post
Share on other sites
Guest bartels

I attached the source, the dll and a XML example. The real hindrance for uploading in the library is of course the dreaded monster named documentation.

Share this post


Link to post
Share on other sites

Documentation... What's that?! :7Thanks Arne.Doug

Share this post


Link to post
Share on other sites
Guest bookmark

Amazing Arne! There will be a statue of you someday I am sure. This saves us mortals some weeks of trial-and-error coding.A zillion thanks /Thomas

Share this post


Link to post
Share on other sites
Guest bookmark

Just tried implementing this in my (still experimental) xml radar gauge. Works like a charm. One question to Arne: the blips have a dark (1,1,1?) edge, is there any way to change that color to fit another bg? I use a vector drawn circle as bg and not a bitmap btw. /Thomas

Share this post


Link to post
Share on other sites
Guest bartels

Use a dark background, then you don't see it. Or no transparancy. It's a problem with the antialiasing and the use of RGB(0,0,0) for transparency by FS. Since the RGB(0,0,0) background is somewhat smeared out with the drawn pixels, you end with some pixels above RGB(0,0,0) and therefore darker as the normal pixels, but intransparent. So either use a dark background, or for transparent drawings remove the Antitaliasing command in the GDI-drawing.... //make all drawings antialiased// m_graphics->SetSmoothingMode(SmoothingModeAntiAlias);...I'm not sure if that 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  

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