VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Add Embedded System (addEmbeddedSystem)

Table of Contents

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.

How to Run the Example

To run this example, you must load the plugin, the new FOM module, and use a new SMS.

  1. Copy the AddEmbeddedSystem_evolved.xml FOM module from the example directory to the bin64 directory.
  2. In the Launcher, click the Plug-ins button to bring up the Plug-ins Selection dialog. Enable the plugin.
  3. In the Launcher, add the AddEmbeddedSystem_evolved.xml FOM module to this list of FOM modules to load.
  4. Launch VR-Forces. To see the behavior, you must run two sim engines with different application IDs.
  5. Create a new scenario. In the Advanced tab, choose the data\simulationModelSets\developer_toolkit_examples\addEmbeddedSystem.sms.
  6. Create an A-10. The A-10 has been configured in the SMS to add the new ExampleEmbeddedSystem.
  7. In the console for one sim engine, you should see the local A-10 being created.
    In the console for the second sim engine, you should see that the new ExampleEmbeddedSystem is discovered and you should see prints indicating that the System ID and Model Number have been updated, indicating the new attributes were received.

Classes

VR-Link Classes

Several classes in this example extend VR-Link to add support for the new embedded system, ExampleEmbeddedSystem.

DtExampleEmbeddedSystemRepositoryExtends 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.
DtExampleEmbeddedSystemPublisherThe publisher, created to register and update a new ExampleEmbeddedSystem on the network.
DtReflectedExampleEmbeddedSystemListCreated to discover any remote ExampleEmbeddedSystems in the federation.
DtReflectedExampleEmbeddedSystemRepresents a single remote ExampleEmbeddedSystem in the federation.
DtExampleEmbeddedSystemEncoderEncodes attributes for the new embedded system object for network transmission.
DtExampleEmbeddedSystemDecoderDecodes attributes for the new embedded system object from network data.

Network Interface Classes

The DtExampleEmbeddedSystemLocalNetInterface and DtExampleEmbeddedSystemRemoteNetInterface classes are responsible for transferring data from the VR-Forces internal state component to and from VR-Link.

DtExampleEmbeddedSystemLocalNetInterfaceTransfers data from the VR-Forces state component to VR-Link for network publication.
DtExampleEmbeddedSystemRemoteNetInterfaceTransfers data from VR-Link to the VR-Forces state component for remote object updates.

Remote Object Manager

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.

DtExampleRemoteObjectManagerExtends the remote object manager to create and manage reflected lists for the ExampleEmbeddedSystem object class.

State Component

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.

DtExampleEmbeddedSystemStateComponentBase interface class providing access to embedded system state data.
DtExampleEmbeddedSystemStateComponentCurrentFrameRead-only interface to current frame embedded system state data.
DtExampleEmbeddedSystemStateComponentNextFrameRead-write interface to next frame embedded system state data for updates.
DtExampleEmbeddedSystemStateComponentImplementationDouble-buffered implementation managing both current and next frame state.

Controller

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.

DtExampleEmbeddedSystemControllerController component that manages the lifecycle and updates of an embedded system instance.
DtExampleEmbeddedSystemDescriptorConfiguration descriptor containing parameters for embedded system controller initialization.

Plugin Entry Points

//******************************************************************************
// Copyright (c) 2025 MAK Technologies, Inc.
// All rights reserved.
//******************************************************************************
#include <vrfcgf/cgf.h>
#include <vl/exerciseConn.h>
extern "C" {
// @brief Provides plugin information to the VRF framework.
//
// This function is called by the VRF plugin loader to get metadata about
// this plugin. The information is used for display in the GUI and for
// plugin management purposes.
//
// @param info Reference to structure that will be filled with plugin metadata
{
info.pluginName = "Add Embedded System";
info.pluginVersion = "1.00";
info.pluginCreator = "MAK Technologies";
info.pluginCreatorEmail = "sales@mak.com";
info.pluginContactWebPage = "www.mak.com";
info.pluginContactMailingAddress = "150 Cambridge Park Drive 3rd Floor - Cambridge, MA 02140 USA";
info.pluginContactPhone = "(617) 876 8085";
}
// @brief Initializes the VRF plugin and registers all components.
//
// This function is called when the plugin is loaded by the VRF framework.
// It performs all necessary registration steps to integrate the embedded
// system functionality into the simulation:
//
// 1. Registers the state component with the state management system
// 2. Registers the controller and descriptor with the component factory
// 3. Registers network interfaces for HLA communication
// 4. Sets up publisher creation rules for automatic network integration
//
// The plugin implements a complete embedded system simulation capability
// including local control, state management, and network distribution.
//
// @param cgf Pointer to the CGF (Computer Generated Forces) framework instance
// @return true if initialization succeeded, false otherwise
DT_VRF_DLL_PLUGIN bool DtInitializeVrfPlugin(DtCgf* cgf)
{
// Set up the remote object manager for handling incoming network objects
// This tells the VR-Link network interface how to create remote objects
// when embedded system objects are discovered on the network
// Register the controller and descriptor with the component factory system
// This allows entities to be configured with embedded system controllers
// through scenario files or runtime entity creation
// Find the VR-Link network interface from the communications manager
// VR-Link handles HLA/DIS network communication for the simulation
if (vrlinkInterface)
{
// Register the network interface classes for embedded system communication
// - Local interface: publishes our embedded system state to the network
// - Remote interface: receives and processes embedded system data from network
// Set up automatic publisher creation rule
// This tells VR-Link to automatically create a local network interface
// (publisher) whenever an entity has an embedded system state component.
// The boost::bind creates a function object that calls the VR-Link method
// with the appropriate parameters when triggered.
vrlinkInterface, boost::placeholders::_1, boost::placeholders::_2, boost::placeholders::_3),
makVrf::DtVrlinkNetworkInterface::ComponentTypeUserData(makVrf::DtExampleEmbeddedSystemStateComponent::ComponentType()));
}
return true;
}
}

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)