The Receive Spot Report example demonstrates the following:
- How to use spot reports and print spot report messages from the sim
- How to interface with the DtVrfRemoteController to receive and display the spot report messages
How to Run the Example
This example demonstrates how to use the remote control API for controlling a VR-Forces sim engine. It is a standalone console application that will display spot reports received from the SIM engine when Spot Reports are enabled.
Usage
To run the application:
-
Start VR-Forces GUI and SIM through the "vrfLauncher.exe" - e.g. select the DIS (7) localhost protocol.
-
Open an existing scenario in the VR-Forces - e.g. HawaiiGround.scnx.
-
Turn on Spot Report by going to Settings->Application->Spot Report Settings and make sure "Send Spot Reports" is checked.
-
Open a separate command line window and switch to the VR-Forces "/bin64/" directory
-
Start the receiveSpotReport application as "receiveSpotReportDIS.exe with the vrfSimDIS command line arguments.
Note: You need to supply the same set of command line arguments as the ones required to run the vrfSimDIS.exe. The necessary command line arguments for the receiveSpotReportDIS.exe - can be copied from the sim engine command line arguments from the Launcher UI.
-
Play the scenario.
-
Observe the receiveSpotReportDIS.exe console to view the reported messages - e.g. :
Spot Report:
CH-47 1 spotted Cvln 1 of force Other nearby.
Classes
Plugin Entry Points
#include <vl/exerciseConnInitializer.h>
#include <vl/exerciseConn.h>
#include <vlutil/vlProcessControl.h>
#include <vlutil/vlKeyboard.h>
#include "vlutil/vlList.h"
#include <vector>
using namespace makVrf;
int keybrdTick(void);
{
{
std::vector<DtSimReport*> reports = reportCollection->
reports();
std::vector<DtSimReport*>::const_iterator iter = reports.begin();
while (iter != reports.end())
{
{
case 0:
forceType = "Other";
break;
case 1:
forceType = "Friendly";
break;
case 2:
forceType = "Opposing";
break;
case 3:
forceType = "Neutral";
break;
default:
break;
}
DtInfo("Spot Report: \n\t %s spotted %s of force %s nearby.\n",
forceType.c_str()
);
iter++;
}
return;
}
}
int main(int argc, char** argv)
{
appInitializer.parseCmdLine();
DtExerciseConn* exConn = new DtExerciseConn(appInitializer);
controller->
init(exConn);
while (keybrdTick() != -1)
{
exConn->clock()->setSimTime(exConn->clock()->elapsedRealTime());
DtSleep(0.1);
}
delete controller;
delete exConn;
return 0;
}
int keybrdTick()
{
char *keyPtr = DtPollInputLine();
if (!keyPtr)
return 0;
switch (*keyPtr)
{
case 'q':
case 'Q':
return -1;
default:
printf("Unrecognized command key <%c>\n", *keyPtr);
break;
}
return 0;
}