![]() |
VR-Forces 5.0.1 Developer's Guide
|
The TDL Message Extension example demonstrates the following:
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 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.
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:
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.
| ExampleTDLMessage | The message that contains the new VR-Forces TDL Message. |
| ExampleTDLMessageGeneratorController | This subclass of DtVrfTDLMessageGeneratorController will monitor the set target message and send a new TDL message when the target is selected. |
| ExampleTDLMessageGeneratorControllerPSR | This 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. |
/*******************************************************************************
** 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;
}
}