![]() |
VR-Forces Developer's Guide
|
The Add Embedded System example demonstrates how to:
The RPR FOM defines several embedded system objects. These objects generally do not exist on their own. They are created to represent systems that are present on an entity. Common examples are radio transmitters and emitter systems (such as radar). The embedded system pattern is useful for adding optional extensions to a base entity object, without changing the entity class.
This example shows how to add support for a new embedded system object class to the VR-Forces sim engine. This example is HLA only. The new embedded system object class is called ExampleEmbeddedSystem, and it is a subclass of the RPR FOM EmbeddedSystem class. It is defined in the AddEmbeddedSystem_evolved.xml FOM module.
To run this example, you must load the plugin, the new FOM module, and use a new SMS.
Several classes in this example extend VR-Link to add support for the new embedded system, ExampleEmbeddedSystem.
| DtExampleEmbeddedSystemRepository | Extends the VR-Link DtEmbeddedSystemRepository class to define the state repository in which the state of an ExampleEmbeddedSystem is stored for updating to or from the network. |
| DtExampleEmbeddedSystemPublisher | The publisher, created to register and update a new ExampleEmbeddedSystem on the network. |
| DtReflectedExampleEmbeddedSystemList | Created to discover any remote ExampleEmbeddedSystems in the federation. |
| DtReflectedExampleEmbeddedSystem | Represents a single remote ExampleEmbeddedSystem in the federation. |
| DtExampleEmbeddedSystemEncoder | Encodes attributes for the new embedded system object for network transmission. |
| DtExampleEmbeddedSystemDecoder | Decodes attributes for the new embedded system object from network data. |
The DtExampleEmbeddedSystemLocalNetInterface and DtExampleEmbeddedSystemRemoteNetInterface classes are responsible for transferring data from the VR-Forces internal state component to and from VR-Link.
| DtExampleEmbeddedSystemLocalNetInterface | Transfers data from the VR-Forces state component to VR-Link for network publication. |
| DtExampleEmbeddedSystemRemoteNetInterface | Transfers data from VR-Link to the VR-Forces state component for remote object updates. |
The VR-Forces remote object manager is responsible for creating and managing the reflected lists used to receive remote object updates. The DtExampleRemoteObjectManager in this example extends the remote object manager to create a reflected list for the new object class.
| DtExampleRemoteObjectManager | Extends the remote object manager to create and manage reflected lists for the ExampleEmbeddedSystem object class. |
The DtExampleEmbeddedSystemStateComponent class, and its current and next frame subclasses, provides thread safe storage and access to object state for sharing between the simulation and network threads.
| DtExampleEmbeddedSystemStateComponent | Base interface class providing access to embedded system state data. |
| DtExampleEmbeddedSystemStateComponentCurrentFrame | Read-only interface to current frame embedded system state data. |
| DtExampleEmbeddedSystemStateComponentNextFrame | Read-write interface to next frame embedded system state data for updates. |
| DtExampleEmbeddedSystemStateComponentImplementation | Double-buffered implementation managing both current and next frame state. |
The DtExampleEmbeddedSystemController and its descriptor will create and initialize a new example embedded system for a local entity. The controller will create the state component, which in turn will create the network interface, which will create a publisher.
| DtExampleEmbeddedSystemController | Controller component that manages the lifecycle and updates of an embedded system instance. |
| DtExampleEmbeddedSystemDescriptor | Configuration descriptor containing parameters for embedded system controller initialization. |