How to handle track of multiple objects at the same time

VC_Man
12-12-2006, 05:48 AM
Language: VC++
Using: Mappoint API embedded in my own app.

Hi best programmers,

I would like to have some advise of you.
On the map I want to be able to follow several obejcts (in the form of cars or persons) at the same time with their passed points.

For example I have object A and object B, I can see both A and B simultaneously where they go. I get the positions via a network. I can also click on a previous point to see at wich time they where on that place.

Now suppose I have let's say about six of those objects, than what is the best way to program it? Should I use threads or is there a way to put all the pushpins of a certain object in some kind of a collection....? Does somebody have a suggestion, it's just to get an idea of wich direction I have to think.

Thank you very much.

Wilfried
12-12-2006, 09:52 AM
Hi,

In C# you have 'user data objects', in Delphi and CBuilder a 'TList', C++ probably will have something similar ?

VC_Man
12-13-2006, 02:22 AM
Hi Wilfried,

Thank you for your reply, in MFC (wich I use) there is something like CList. I think that is what you mean. Should that be usefull to handle and proces multiple targets at the same time on the map?

Can you give me a simple example?

By the way, I really appreciate your help on this forum. Not everybody makes some precious time free to help others. So thank you Wilfried.

VC_Man
12-13-2006, 08:00 AM
Hi all,

I want to solve this problem on the following way. For each target or object I want to follow, I'll create a pushpin set (from data set). So all the pushpins that belongs to a certain target/object are saved in its pushpin set. So when I select an old pushpin of a certain target/object, I'll get the information in the balloonfield to which target/object it belongs. Also can I draw the route based on all pushpins in the certain dataset of the target, right??

Now another problem rises up, how can I during runtime create.........
Hmmm wait a minute, now I've to make an array which can find the right target/object-name and there you can find the reference of the created pushipin set. Where you can get, for example, all the pushpin info's.

Is that an idea?
If somebody has a better suggestion, than I'm open for it :bluewink:

Wilfried
12-14-2006, 01:14 PM
Hi,

Yep you are on the right track :)

I did a quick look into the CList, and yes that's what I meanth. You mention to use several dataset, yes also good solution, and then use array (or a CList) to hold the refernces. I see there is an CArray class also. As far as I can see it is more comparable with the TList I mentioned in Delphi and CBuilder.

Thank you for the compliment. I try to look at the forum at least once a day, but I have too mutch work, so sometime there is no time left :( Sometime I have to eat and sleep above my keyboard (not so good) ...

VC_Man
12-15-2006, 04:48 AM
Thank you too Wilfried,

I used a gps-navigator combined with Mappoint 2006 to get on the right track ;-)

I think now I know how to solve this problem. Take a good rest my friend, programming is not all that. So when you rest all out, you can crunch the bits and the bytes in your software :).

 
Web mp2kmag.com
mapforums.com