VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Back-End Remote Control (remoteControl)

The Back-End Remote Control example demonstrates the following:

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.

Usage

(Release) remoteControl

(Debug) remoteControld

To run the application:

  1. Open a command line and switch to the VR-Forces "bin" directory
  2. Start a VR-Forces front-end as "vrfGui –dis"
  3. Start a VR-Forces back-end as "vrfSimDIS"
  4. Start remoteControl as "remoteControlDIS"
  5. Open the Ground-db.mtf terrain in the GUI to monitor the scenario
  6. In the remoteControl console, create a new scenario by entering "new Ground-db.mtf"
  7. Enter "help" to display the complete list of commands
  8. Enter commands in the remoteControl console as desired, to create and task entities.

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.

Classes

DtRemoteControlInitializerThis subclass of DtVrlApplicationInitializer adds command line options for the HLA version of the example.
DtTextInterfaceThis class allows the user to type in commands that will be parsed and used to supply information to the remote controller.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2002 MAK Technologies, Inc.
** All rights reserved.
*******************************************************************************/
/*******************************************************************************
** $RCSfile: main.cxx,v $ $Revision: 1.13 $ $State: Exp $
*******************************************************************************/
#include "textIf.h"
//VR-Forces headers
//VR-Link headers
#include <vl/exerciseConn.h>
#include <vlutil/vlProcessControl.h>
int main(int argc, char** argv)
{
//Create initializer object used to provide initialization data to the
//exercise connection, configured through command line arugments.
DtRemoteControlInitializer appInitializer(argc, argv);
appInitializer.parseCmdLine();
//Create the controller
//Create an exercise connection
DtExerciseConn* exConn = new DtExerciseConn(appInitializer);
controller->init(exConn);
//Create our text interface so we can enter text commands.
DtTextInterface* textIf = new DtTextInterface(controller);
//Processing: read stdin and call drainInput.
//Calling drainInput() ensures that the controller receives
//necessary feedback from VR-Forces backend applications.
while (!textIf->timeToQuit())
{
textIf->readStdin();
exConn->clock()->setSimTime(exConn->clock()->elapsedRealTime());
exConn->drainInput();
DtSleep(0.1);
}
delete textIf;
delete controller;
delete exConn;
return 0;
}

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)