Can I get data related to federates participating in DIS simulation

Discuss on the SimConnect SDK can be used by programmers to write add-on components for Prepar3D
Post Reply
anand
Posts: 8
Joined: Thu Aug 29, 2019 5:03 am

Can I get data related to federates participating in DIS simulation

Post by anand »

How can I extract data related to other aircraft which has participated in DIS using SImconnect ? If simconnect does not support this , Is there any way to do that ??
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: Can I get data related to federates participating in DIS simulation

Post by Clifton Crane »

Hi anand,

The SimConnect Data Request Sample sample shows how to get data from the user object. The same SimConnect_RequestDataOnSimObjectType can also be used to get data on other objects in the world.

Unfortunately, through SimConnect there is not a way to determine whether or not the entity is a local entity (such as AI traffic) or a remote DIS entity. If you were to assume that all entities other than user were DIS entities this may not be an issue.

There is also the IDISManagerV450 PDK service. This interface can provide you with site/application/entity id's for individual entities (see GetEntityIdByObjectId function). Using this function you would be able to determine whether or not the entity belonged to the local client or another client by comparing site/app/entity ids.

If you decide to go the PDK route you would also want to have a look at the ISimObjectManager PDK service. This interface can be used to collect entities within a radius.
Clifton Crane
Prepar3D® Software Engineer Sr.
anand
Posts: 8
Joined: Thu Aug 29, 2019 5:03 am

Re: Can I get data related to federates participating in DIS simulation

Post by anand »

Okay . If I have assumed that all other entities are DIS entities . will simconnect be able to tell latitude , longitude of those entities ? If yes the which method will do that ?
anand
Posts: 8
Joined: Thu Aug 29, 2019 5:03 am

Re: Can I get data related to federates participating in DIS simulation

Post by anand »

Okay , I got data with SimConnect_RequestDataOnSimObjectType when I passed argument as Aircraft . but suppose if there are 5 entities other than user then how will i get data for all 5 entities ?
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: Can I get data related to federates participating in DIS simulation

Post by Clifton Crane »

Hello,

You can specify the type of object(s) you are requesting in SimConnect_RequestDataOnSimObjectType. For example, instead of using SIMCONNECT_SIMOBJECT_TYPE_USER you can use SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT. This will request data on all aircraft. In this case you will receive multiple SIMCONNECT_RECV_ID_SIMOBJECT_BYTYPE callbacks, one for each object.

In the SIMCONNECT_RECV_SIMOBJECT_DATA struct, the dwentrynumber and dwoutof variables can be used to determine how many objects are being returned.
Clifton Crane
Prepar3D® Software Engineer Sr.
anand
Posts: 8
Joined: Thu Aug 29, 2019 5:03 am

Re: Can I get data related to federates participating in DIS simulation

Post by anand »

One last doubt is when I'll pass SIMCONNECT_SIMOBJECT_TYPE_AIRCRAFT , will it give detail for user object too ?
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: Can I get data related to federates participating in DIS simulation

Post by Clifton Crane »

I believe it should if the user is in an aircraft.
Clifton Crane
Prepar3D® Software Engineer Sr.
sunilhalvi
Posts: 10
Joined: Sat May 02, 2020 6:32 am

Re: Can I get data related to federates participating in DIS simulation

Post by sunilhalvi »

Hi Clifton Crane,
How can I call APIs implemented in IDISManagerV450 from a C# project?
Post Reply