VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TDL Message Extension (tdlMessagSim)

Table of Contents

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.

The TDL Message Extension example demonstrates the following:

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.

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 "vrfcore/simManager.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 DtSimManager* theSimManager = 0;
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 = "150 Cambridge Park Drive 3rd Floor - Cambridge, MA 02140 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 Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)