Copyright VirtualSim 2004-2020 - All rights reserved
Subscribe
Getting the Attribute
Now, double-click on the subscribing FedItem to call its Property Window
then, for each Attribute, use the Wizard button to get the automatic code.
You must have set the DataModel to hlaEntity in General::Modeling
Here, we can see that if the local pointer has been correctly set to the entity hlaEntity object, then local->State will receive the data coming from the RTI, otherwise, rti_data will receive it (and the user will need to transfer it from the Object code).
vsTASKER generates a union of pointer names: local and dmodel. You can use either one.
Wizard after version 6.0 uses dmodel instead of local, as dmodel refers to the attached data_model.
Now, let's open the Entity object of the FedItem.
This part will be called when all Attributes have been updated.
It is then time to copy the data from hlaEntity to internal entity structure, using the set()function defined in the hlaEntity DataModel.
Now, we can compile and run the simulation.
The entity pointer is normally set into the Discover panel if the FedItem is sensitive to runtime entities (), and is associated with the Object handle.
Local pointer is normally set during the discover stage by retrieving the DataModel from the entity created: local = entity? entity->findDataModel("DataModel"): NULL;