VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TDL Message Extension (tdlMessageSim)

Table of Contents

The TDL Message Extension example demonstrates the following:

TDL Messaging and Components

The VR-Forces TDL (Tactical Data Link) system sends VR-Forces-specific TDL messages that are handled outside of the normal VR-Forces Spot Report and Data Interaction messages. The VR-Forces TDL messages are shown as icons on the screen (like spot reports), containing a fixed number of additional "lines" of information. You can show the extended TDL lines of information by selecting which information to show on the Application Settings dialog box, TDL Settings page.

This example adds a new line of information about the entity that is currently being targeted by the reporting entity. A new controller ExampleTDLMessageGeneratorController is created and used by the fixed-wing entity to report what target it has targeted. The developer toolkit SMS tdlMessage is used in conjunction with this example.

The tdlMessagSim example demonstrates how to add a new TDL message sending component and connect it to controller components. This component listens for the Set Target command for the fixed-wing entity and then sends out a new VR-Forces TDL message that contains that information. This information is then associated with a previous VR-Forces PPLI message that was sent for the positioning of the fixed-wing and shows this new information.

Implementing the TDL Message Generator class

The ExampleTDLMessageGeneratorController implements a few main methods:

The fillInMessage method is called when the message has determined it needs to be resent by the system. The method uses the newly created ExampleTDLMessage message to fill in the location of the reporting entity at the time of the report and a string message text for who the entity is targeting.

The messageNeedsUpdate message determines whether or not an update to this message needs to be sent. It is sent if the target has moved a certain distance, is newly set, or has been destroyed.

How to Run the Example

Usage

In the Launcher, click the Plug-ins button to bring up the Plug-ins Selection dialog. Enable the tdlMessage plugin. The plugin configuration includes both the tdlMessageSim and tdlVrfGuiAccessory plugins. Both the VrfSim and vrfGui blugins have to be loaded for this example to work.

To view the new behavior:

  1. Start VR-Forces GUI and SIM.
  2. Load the tdlExampleMessage.scnx scenario from the /scenarios/developer_toolkit_examples/tdlExample/ directory
  3. Choose Settings -> Application. Select the Tactical Data Link Options page and make sure the Process of Tactical Data Link Messages is enabled.
  4. Go to the Display tab and make sure TDL Line 4 is checked (this is where the example data will be displayed)
  5. Go to the Spot Reports Options tab and turn off ground truth for all items just so you will only see the TDL messages.
  6. The two entities will dissapear from the Objects List and the terrain map.
  7. Run the scenario.
  8. A TDL Tracks folder will appear in the Objects List panel. It will have an Air sub-folder with the friendly fixed wing entity.
  9. The friendly fixed wing will be shown on the terrain map and will have a symbol decoration line showing who the fixed wing is tracking.

When you are done with the scenario, make sure to turn on ground truth for all items and to turn of TDL Message handling so the next scenario run goes as expected.

Classes

ExampleTDLMessageThe message that contains the new VR-Forces TDL Message.
ExampleTDLMessageGeneratorControllerThis subclass of DtVrfTDLMessageGeneratorController will monitor the set target message and send a new TDL message when the target is selected.
ExampleTDLMessageGeneratorControllerPSRThis subclass of DtTDLMessageGeneratorControllerPSR allows for the controller to heartbeat the message appropriately and to maintain an up-to-date location for that entity to send with the new message.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2018 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/

//Example includes
#include "exTDLMessage.h"
#include "exTDLMessageGeneratorController.h"
#include "exTDLMessageGeneratorControllerPSR.h"

//VR-Forces includes
#include "vrfcgf/vrfPluginExtension.h"

//VR-Forces includes
#include "vrfcgf/cgf.h"
#include "vrfcgf/factoryManager.h"
#include "vrfMsgTransport/vrfMessageInterface.h"
#include "vrfmsgs/vrfTDLMessageFactory.h"
#include "vrfmsgs/simInterfaceMessage.h"
#include "vrfutil/consoleCommandManager.h"

//VR-Link includes
#include <vlutil/vlPrint.h>
#include <vl/exerciseConn.h>

static DtSimulationAddress theSimulationAddress;
static int theOutgoingMessageNumber = 0;

extern "C" {
   
   DT_VRF_DLL_PLUGIN void DtPluginInformation(DtVrfPluginInformation& info)
   {
      info.pluginName = "exTDLMessageSim";
      info.pluginDescription = "This is an example of how to add a new tactical data link message in the VRF back-end.";
      info.pluginVersion = "1.00";
      info.pluginCreator = "MAK Technologies";
      info.pluginCreatorEmail = "sales@mak.com";
      info.pluginContactWebPage = "www.mak.com";
      info.pluginContactMailingAddress = "10 Fawcett Street, Suite 204, Cambridge, MA 02138 USA";
      info.pluginContactPhone = "(617) 876 8085";
   }

   DT_VRF_DLL_PLUGIN bool DtInitializeVrfPlugin(DtCgf* cgf)
   {          
      //Register the creator for MyInterfaceContentType with the
      //DtInterfaceContentFactory
      cgf->factoryManager()->vrfTDLMessageFactory()->addCreatorFcn(
         ExampleTDLMessageType, ExampleTDLMessage::creator);

      cgf->factoryManager()->componentFactory()->addCreatorFcn(
         ExampleTDLMessageGeneratorControllerType, ExampleTDLMessageGeneratorController::creator);

      cgf->factoryManager()->processStateRepositoryFactory()->addCreatorFcn(
         ExampleTDLMessageGeneratorControllPSRType, ExampleTDLMessageGeneratorControllerPSR::creator);

      return true;
   }
}


Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)