VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Encumbered Flight (Front-End) (addSetEncumbranceGui)

Table of Contents

This example adds a new Set that is sent from the GUI and received and processed by the addSetEncumbranceSim example.

The effect of these plugins it so allow manual setting of the cargo weight of a rotary wing aircraft to alter its flight behaviors and fuel consumption. This is simillar to the addSetGui example. Please check this example for a detailed explanation of adding a set. The larger architecture of GUI and Menus in the VR Forces Front End is described in VR-Vantage Architecture Walkthrough - The GUI Layer and GUI Architecture.

How to Run the Example

This example demonstrates how to add a new kind of set data request (set heading and ordered speed).

To view the new behavior:

  1. Open a database or create a new scenario.
  2. Create a rotary wing aircraft entity (e.g. 'MH-60 Blackhawk').
  3. Right-click on entity and select the new entry 'Set->Encumbrance...".
  4. In the dialog, enter a desired weight.
  5. Click OK to exit the dialog.
  6. Task the aircraft to move to a location.
  7. The aircraft will accelerate slower and consume more fuel the heavier it is.

Classes

DtSetEncumbranceMenuItemThe menu item that will register the dialog to be shown when this set is requested.
DtSetEncumbranceDialogThe Qt widget that generates the dialog box used to enter the encumerance information.
DtSetEncumbranceRequestThe subclass of DtSetDataRequest that is used to communicate the new set request between the front-end and the back-end.

Plugin Entry Points

/*******************************************************************************
** Copyright (c) 2016 VT MAK, Inc.
** All rights reserved.
*******************************************************************************/
//\file addSetEncumbrancePlugin.cxx
//\brief Contains plugin function
//This file defines the generic DT_DLL_VRF_PLUGIN_EXPORT_MACRO. Use that macro when
//you want to export symbols. Also, in your CMakeLists.txt file, make sure to
//define the VRFPLUGIN_EXPORTS define to tell the compiler to define the macro as an
//export
#include "../addSetEncumbranceSim/setEncumbranceRequest.h"
#include <vrvCore/DtDe.h>
using namespace vrfAddSetEncumbranceExample;
using namespace makVrf;
void DtSetMenuConfigurationLoaded(makVrv::DtDe* de)
{
//[insert menu item string into set menu]
//Inserts the DtSetEncumbranceMenuItem object name as the menu item into a specific point of the Set Menu with the masterModeMenuConfiguration
//The set entry is placed after the menu entry corresponding to the "DtVrfSetResponsibilityAction" object
DtVrfScenarioManager::instance(*de).initialSetMenuConfiguration().addMenuItemAfter(DtSetEncumbranceMenuItemIdName, DtVrfSetLocationActionId);
//[insert menu item string into set menu]
}
{
//[register menu item with set menu]
//Registers the DtSSetSpeedAndHeadingMenuItem object with the makVrf::DtSetMenu assembler
//[register menu item with set menu assembler]
//Registers the set creator in the back-end, linking it with the front-end by the common string DtSetEncumbranceString
DtGuiThreadVrfRemoteController::instance(*de).addSetCreatorFcn(
//Register callback to be notified when initial set menu configuration has changed. This will always allow the plugin
//to correctly add in the new set command
DtVrfScenarioManager::instance(*de).signal_setMenuConfigurationLoaded.connect
(boost::bind(&DtSetMenuConfigurationLoaded, de));
return true;
}
{
info.pluginName = "Add Set Encumbrance Gui";
info.pluginVersion = "1.00";
info.pluginDescription = "Front-end plugin addition to add new Set Encumbrance... command";
info.pluginCreator = "VT MAK";
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";
}

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)