The Back-End Remote Control example demonstrates the following:
- How to use and extend command line options
- How to interface with the DtVrfRemoteController to remotely control a VRF back-end
How to Run the Example
This example demonstrates how to use the remote control API for controlling a VR-Forces back-end. It is a standalone console application that enables users to create/manipulate VR-Forces scenarios through a simple text interface.
This example now includes simple usage of the DtRemoteEnvironmentController.
Usage
To run the application:
-
Start VR-Forces GUI and SIM through the "vrfLauncher.exe" - e.g. select the DIS (7) localhost protocol.
-
Do not load an existing or create new scenario
-
Open the Ground_DB II.mtf terrain in the GUI
-
Open a separate command line window and switch to the VR-Forces "/bin64/" directory
-
Start the remoteControl application as "remoteControlDIS.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 remoteControlDIS.exe - can be copied from the backend command line arguments from the Launcher UI.
-
In the remoteControl console window - type "help" to display the complete list of commands
-
In the remoteControl console, create a new scenario by entering 'new "Ground_DB II.mtf"'
-
Enter commands in the remoteControl console as desired, to create and task entities.
Note that location and point parameters should be entered using the geocentric coordinate system.
-
The results of the commands will be observable in the VR-Forces GUI. The GUI only being used as a passive display in this example. The remoteControl application is the one actually controlling VR-Forces back-end.
-
This example uses a specialized subclass of the DtVrfRemoteController called DtVrlinkVrfRemoteController. This convenience class allows for the constuction of the remote controller around a DtExerciseConnection.
-
You can use the DtVrfRemoteController, however, you will need to create a DtCommunicationManager and DtVrlinkNetworkInterface to add to that in order to be able to run the example.
Classes
Plugin Entry Points
#include "textIf.h"
#include "remoteControlInit.h"
#include <vl/exerciseConn.h>
#include <vlutil/vlProcessControl.h>
using namespace makVrf;
int main(int argc, char** argv)
{
appInitializer.parseCmdLine();
DtExerciseConn* exConn = new DtExerciseConn(appInitializer);
controller->
init(exConn,
nullptr,
nullptr,
nullptr,
"entity-identifier",
true);
{
exConn->clock()->setSimTime(exConn->clock()->elapsedRealTime());
DtSleep(0.1);
}
delete textIf;
delete controller;
delete exConn;
return 0;
}