VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Slots | Protected Member Functions | Protected Attributes | Properties
makVrf::DtWeaponSelectionWidget Class Reference

Widget that allows users to select weapons for the given entity.

Inheritance diagram for makVrf::DtWeaponSelectionWidget:
Inheritance graph
[legend]

Public Member Functions

 DtWeaponSelectionWidget (makVrv::DtDe &de, QWidget *parent, const Qt::WindowFlags &flags=0, const CreationFlags &cflags=NormalMode)
 
virtual ~DtWeaponSelectionWidget ()
 
virtual void setWeaponFilterType (DtWeaponSystemType type)
 
virtual DtWeaponSystemType weaponFilterType () const
 
virtual void setFireTaskType (DtSimTaskMessageType fireTaskType)
 
virtual void setFireTaskTypes (const std::vector< DtSimTaskMessageType > &fireTaskTypes)
 
virtual const std::vector
< DtSimTaskMessageType > & 
fireTaskTypes () const
 
virtual void setRange (double bottom, double top)
 
virtual void setDefaultValue (const std::string &)
 
virtual void setVariableData (const QString &)
 
virtual void setupFrom (const std::vector< makVrv::DtSimEntry * > &data)
 
virtual DtReaderWritercreateBoundVariable (const std::string &variableName)
 
virtual void setupFromBoundVariable (const DtReaderWriter *variableName)
 
virtual void requestWeaponsFor (const std::vector< makVrv::DtSimEntry * > &data)
 
virtual void slot_receivedWeaponList (const DtUUID &entity)
 
virtual void setAllowMultipleSelection (bool)
 
virtual bool allowMultipleSelection () const
 
virtual QStringList selectedWeaponsNames () const
 
virtual QStringList selectedWeaponsIds () const
 
virtual std::list< DtStringselectedWeaponResources () const
 
virtual std::list< DtStringselectedResources () const
 
virtual void selectWeapons (const QStringList &)
 
virtual void selectWeaponsById (const QStringList &)
 
virtual void updateWeapons ()
 
virtual void selectResource (const DtString &)
 
virtual void updateResources ()
 
virtual bool includeResources () const
 
virtual void setIncludeResources (const bool doInclude)
 
virtual bool displayWeapons () const
 
virtual void setDisplayWeapons (const bool doDisplay)
 
virtual bool displayResources () const
 
virtual void setDisplayResources (const bool doDisplay)
 
- Public Member Functions inherited from makVrf::DtTaskSetVariableWidget
 DtTaskSetVariableWidget (makVrv::DtDe &de, QWidget *parent, const Qt::WindowFlags &flags=0, const CreationFlags &cflags=NormalMode)
 
virtual ~DtTaskSetVariableWidget ()
 
virtual void setToolTip (const QString &)
 
virtual void setLabel (const std::string &)
 
virtual void setLabel (const QString &)
 
virtual void setVariableData (const std::string &)
 
virtual QString variableData () const
 
virtual QString label () const
 
virtual void setIsInternal (bool)
 
virtual bool isInternal () const
 
virtual void setTopLineVisible (bool)
 
virtual bool topLineVisible () const
 
virtual void createTopLine ()
 
virtual void setIndent (int)
 
virtual int indent () const
 
virtual bool isValid () const
 
virtual void setTopLabelChecked (bool)
 
virtual bool topLabelChecked () const
 
virtual void setRange (const DtRange &)
 
virtual void setRangeTop (double)
 
virtual void setRangeTop (int)
 
virtual double rangeTop () const
 
virtual void setRangeBottom (double)
 
virtual void setRangeBottom (int)
 
virtual double rangeBottom () const
 
virtual const DtRangegetRange () const
 
virtual void setTopLabelIsCheckable (bool)
 
virtual bool topLabelIsCheckable () const
 
virtual void getDefaultSpecificTitles (QString &defaultTitle, QString &specificTitle) const
 
virtual void setDefaultSpecificTitles (const QString &defaultTitle, const QString &specificTitle)
 
virtual void setupDefaultSpecificFromVariableData (const DtString &var)
 
virtual std::string scriptedTaskVariableName () const
 
virtual void setSelection (const std::set< makVrv::DtUniqueID > &selection)
 
virtual void setSelection (const std::vector< makVrv::DtSimEntry * > &data)
 
virtual const std::set
< makVrv::DtUniqueID > & 
selection () const override
 
virtual void setDefaultValueFromStateProperty (const DtPropertyInterface &)
 
- Public Member Functions inherited from makVrf::DtTaskSetVariableWidgetInterface
 DtTaskSetVariableWidgetInterface ()
 
virtual ~DtTaskSetVariableWidgetInterface ()
 
virtual void widgetInitializedForDialog (DtScriptedTaskDialog *, const std::vector< makVrv::DtSimEntry * > &data)
 
virtual bool guiElementOnly () const
 

Static Public Member Functions

static makVrv::DtUnicode codeVariableType ()
 
static std::string designerGroup ()
 
static std::string headerFile ()
 
static std::string variableName ()
 
- Static Public Member Functions inherited from makVrf::DtTaskSetVariableWidget
static bool includeInQtDesigner ()
 
- Static Public Member Functions inherited from makVrf::DtTaskSetVariableWidgetInterface
static bool canBeUsedAsWidget ()
 
static void initializeForQtDesignerExtension (makVrv::DtDe &de, QDesignerFormEditorInterface *core)
 
static bool includeInQtDesigner ()
 

Public Attributes

boost::signals2::signal< void()> signal_receivedWeaponsList
 
boost::signals2::signal< void()> signal_weaponSelectionChanged
 
boost::signals2::signal< void()> signal_resourceSelectionChanged
 
QLabelmyWeaponLabel
 
QComboBoxmyWeaponSystemsCombo
 
QHBoxLayout * myWeaponContentLayout
 
QLabelmyResourcesLabel
 
QComboBoxmyResourcesCombo
 
QHBoxLayout * myResourcesContentLayout
 
QString myDefaultValue
 
- Public Attributes inherited from makVrf::DtTaskSetVariableWidget
boost::signals2::signal< void(bool)> signal_topLevelCheckStateChanged
 
int myIndent
 
QVBoxLayout * myVariableWidgetLayout
 
QHBoxLayout * mySpacedLayout
 
QVBoxLayout * myVariableContentLayout
 
QWidget * myTopLine
 
QLabelmyTopLabel
 
QWidget * myChoiceCanvas
 
QRadioButton * myUseDefault
 
QRadioButton * myUseSpecific
 
QSpacerItem * myTopSeparator
 
QHBoxLayout * myTopLineLayout
 
QSpacerItem * mySpacerItem
 

Protected Slots

virtual void weaponSelectionChanged ()
 
virtual void resourceSelectionChanged ()
 
- Protected Slots inherited from makVrf::DtTaskSetVariableWidget
virtual void topLabelCheckStateChanged ()
 

Protected Member Functions

virtual std::string variableDataFromUiDesigner (const QDomElement &element, const DtScriptedTaskVariableLayoutConverter &converter) const
 
virtual void addWeapon (const WeaponSystem &)
 
virtual void weaponUpdated (const WeaponSystem &)
 
virtual void weaponChanged ()
 
virtual void weaponCheckingDisabled ()
 
virtual void weaponCheckComplete ()
 
virtual void nextRequest ()
 
virtual void setupForComboBox ()
 
virtual DtString getWeapon ()
 
virtual DtString getAmmo ()
 
virtual std::vector< DtStringparseBoundVariable ()
 
virtual QString weaponId (const QString &qweaponName) const
 
virtual QString weaponName (const QString &weaponId) const
 
virtual std::list< DtStringweaponResources (QString &qweaponName) const
 
virtual
DtTaskSetVariableWidgetExtensionInterface
parameterContents (QWidget *parent, const Qt::WindowFlags &flags=0) const override
 
- Protected Member Functions inherited from makVrf::DtTaskSetVariableWidget
virtual void selectionChanged (const std::set< makVrv::DtUniqueID > &oldSelection)
 

Protected Attributes

std::set< DtUUIDmyToRequest
 
std::set< DtUUIDmyAwaitingWeaponSystemResponse
 
std::set< DtUUIDmyDidRequest
 
std::vector< DtUUIDmyCurrSelected
 
DtString myResourceToSelect
 
bool myIncludeResources
 
bool myDisplayWeapons
 
bool myDisplayResources
 
DtWeaponSystemType myWeaponFilterType
 
std::vector< DtSimTaskMessageTypemyFireTaskTypes
 
- Protected Attributes inherited from makVrf::DtTaskSetVariableWidget
makVrv::DtDemyDe
 
makVrv::DtSignalConnectionManager myConnections
 
bool myTopLabelIsCheckable
 
DtRange myRange
 
bool myIsInternal
 
CreationFlags myCreationFlags
 
QString myVariableData
 
std::set< makVrv::DtUniqueIDmySelection
 

Properties

bool allowMultipleSelecion
 
- Properties inherited from makVrf::DtTaskSetVariableWidget
QString label
 
bool isInternal
 
int indent
 
QString variableData
 

Additional Inherited Members

- Public Types inherited from makVrf::DtTaskSetVariableWidgetInterface
enum  CreationFlags { NormalMode = 0x00000000, QtDesignerMode = 0x00000001 }
 
- Signals inherited from makVrf::DtTaskSetVariableWidget
void validityUpdated ()
 

Constructor & Destructor Documentation

makVrf::DtWeaponSelectionWidget::DtWeaponSelectionWidget ( makVrv::DtDe de,
QWidget *  parent,
const Qt::WindowFlags &  flags = 0,
const CreationFlags cflags = NormalMode 
)
virtual makVrf::DtWeaponSelectionWidget::~DtWeaponSelectionWidget ( )
virtual

Member Function Documentation

virtual void makVrf::DtWeaponSelectionWidget::setWeaponFilterType ( DtWeaponSystemType  type)
virtual

Used for pre VRF-5.1 scenarios - should be deprecated. Optionally allow user to filter type of weapon to display.

virtual DtWeaponSystemType makVrf::DtWeaponSelectionWidget::weaponFilterType ( ) const
virtual
virtual void makVrf::DtWeaponSelectionWidget::setFireTaskType ( DtSimTaskMessageType  fireTaskType)
virtual

Set the task type for which the widget (the containing dialog) is displayed. Filters the weapon systems on their capability to execute tasks.

virtual void makVrf::DtWeaponSelectionWidget::setFireTaskTypes ( const std::vector< DtSimTaskMessageType > &  fireTaskTypes)
virtual
virtual const std::vector<DtSimTaskMessageType>& makVrf::DtWeaponSelectionWidget::fireTaskTypes ( ) const
virtual
virtual void makVrf::DtWeaponSelectionWidget::setRange ( double  bottom,
double  top 
)
virtual

Validation range. Not applicable.

Reimplemented from makVrf::DtTaskSetVariableWidget.

virtual void makVrf::DtWeaponSelectionWidget::setDefaultValue ( const std::string &  )
virtual

Default value to set in control. Will contain initial weapon to select.

Implements makVrf::DtTaskSetVariableWidgetInterface.

virtual void makVrf::DtWeaponSelectionWidget::setVariableData ( const QString &  )
virtual

Variable data. Sets the fire task type. used to filter the weapons for this task type.

Reimplemented from makVrf::DtTaskSetVariableWidget.

virtual void makVrf::DtWeaponSelectionWidget::setupFrom ( const std::vector< makVrv::DtSimEntry * > &  data)
virtual

Sets up widget with currently selected item. Requests data.

Reimplemented from makVrf::DtTaskSetVariableWidget.

virtual DtReaderWriter* makVrf::DtWeaponSelectionWidget::createBoundVariable ( const std::string &  variableName)
virtual

Creates the reader/writer variable that will be used as part of the task statement.

Implements makVrf::DtTaskSetVariableWidgetInterface.

virtual void makVrf::DtWeaponSelectionWidget::setupFromBoundVariable ( const DtReaderWriter variableName)
virtual

Sets up the widget from the given reader/writer variables.

Implements makVrf::DtTaskSetVariableWidgetInterface.

virtual void makVrf::DtWeaponSelectionWidget::requestWeaponsFor ( const std::vector< makVrv::DtSimEntry * > &  data)
virtual

Add all the entities (vector of sim entries) to myAwaitingWeaponSystemResponse list, and then call the DtWeaponListRequestor instance's updateWeaponSystem() on the first entity in the list. If the list is empty, call updateWeapons().

virtual void makVrf::DtWeaponSelectionWidget::slot_receivedWeaponList ( const DtUUID entity)
virtual
virtual bool makVrf::DtWeaponSelectionWidget::includeResources ( ) const
virtual

Set/get whether resources are requested along with weapon names when making a weapon list request from the back end. Used in requestWeaponsFor().

virtual void makVrf::DtWeaponSelectionWidget::setIncludeResources ( const bool  doInclude)
virtual

Set/get whether resources are requested along with weapon names when making a weapon list request from the back end. Used in requestWeaponsFor().

virtual bool makVrf::DtWeaponSelectionWidget::displayWeapons ( ) const
virtual

Set/get whether the weapons list combo-box will be displayed.

virtual void makVrf::DtWeaponSelectionWidget::setDisplayWeapons ( const bool  doDisplay)
virtual

Set/get whether the weapons list combo-box will be displayed.

virtual bool makVrf::DtWeaponSelectionWidget::displayResources ( ) const
virtual

Set/get whether the resources list combo-box will be displayed.

virtual void makVrf::DtWeaponSelectionWidget::setDisplayResources ( const bool  doDisplay)
virtual

Set/get whether the resources list combo-box will be displayed.

virtual void makVrf::DtWeaponSelectionWidget::setAllowMultipleSelection ( bool  )
virtual

Used for pre VRF-5.1 scripts - should be deprecated. The variableDataFromUiDesigner() function should be removed. It checks for the multiple selection boolean flag, which has been removed. The widget allow only a single weapon/resource selection through combo box. If there is a checkbox in the widget UI designer - it should be removed. Call before setup – allows multiple selection of weapons.

virtual bool makVrf::DtWeaponSelectionWidget::allowMultipleSelection ( ) const
virtual
virtual QStringList makVrf::DtWeaponSelectionWidget::selectedWeaponsNames ( ) const
virtual

Used for pre VRF-5.1 scenarios - should be deprecated. List of currently selected weapons names.

virtual QStringList makVrf::DtWeaponSelectionWidget::selectedWeaponsIds ( ) const
virtual

List of currently selected weapons IDs.

virtual std::list<DtString> makVrf::DtWeaponSelectionWidget::selectedWeaponResources ( ) const
virtual

List of resources for the currently selected weapon.

virtual std::list<DtString> makVrf::DtWeaponSelectionWidget::selectedResources ( ) const
virtual

List of currently selected resources.

virtual void makVrf::DtWeaponSelectionWidget::selectWeapons ( const QStringList &  )
virtual

Selects weapons in the list. If combo box will only look at first one.

virtual void makVrf::DtWeaponSelectionWidget::selectWeaponsById ( const QStringList &  )
virtual
virtual void makVrf::DtWeaponSelectionWidget::updateWeapons ( )
virtual

Populate the UI weapons list.

virtual void makVrf::DtWeaponSelectionWidget::selectResource ( const DtString )
virtual

Select the ammo resource.

virtual void makVrf::DtWeaponSelectionWidget::updateResources ( )
virtual

Populate the UI resources list.

static makVrv::DtUnicode makVrf::DtWeaponSelectionWidget::codeVariableType ( )
inlinestatic
static std::string makVrf::DtWeaponSelectionWidget::designerGroup ( )
inlinestatic
static std::string makVrf::DtWeaponSelectionWidget::headerFile ( )
inlinestatic
static std::string makVrf::DtWeaponSelectionWidget::variableName ( )
inlinestatic
virtual std::string makVrf::DtWeaponSelectionWidget::variableDataFromUiDesigner ( const QDomElement &  element,
const DtScriptedTaskVariableLayoutConverter converter 
) const
protectedvirtual

Used for pre VRF-5.1 scripts - should be deprecated. The variableDataFromUiDesigner() function should be removed. It checks for the multiple selection boolean flag, which has been removed. The widget allow only a single weapon/resource selection through combo box. If there is a checkbox in the widget UI designer - it should be removed. Call before setup – allows multiple selection of weapons.

Reimplemented from makVrf::DtTaskSetVariableWidget.

virtual void makVrf::DtWeaponSelectionWidget::addWeapon ( const WeaponSystem )
protectedvirtual
virtual void makVrf::DtWeaponSelectionWidget::weaponUpdated ( const WeaponSystem )
protectedvirtual
virtual void makVrf::DtWeaponSelectionWidget::weaponChanged ( )
protectedvirtual
virtual void makVrf::DtWeaponSelectionWidget::weaponCheckingDisabled ( )
protectedvirtual
virtual void makVrf::DtWeaponSelectionWidget::weaponCheckComplete ( )
protectedvirtual
virtual void makVrf::DtWeaponSelectionWidget::nextRequest ( )
protectedvirtual
virtual void makVrf::DtWeaponSelectionWidget::setupForComboBox ( )
protectedvirtual
virtual DtString makVrf::DtWeaponSelectionWidget::getWeapon ( )
protectedvirtual
virtual DtString makVrf::DtWeaponSelectionWidget::getAmmo ( )
protectedvirtual
virtual std::vector<DtString> makVrf::DtWeaponSelectionWidget::parseBoundVariable ( )
protectedvirtual

Works for both 5.1 and 5.0 Correctly parses bound variable in myDefaultValue to get ammo type and weapon. Will return 2 item vector. Both items will be empty strings in the event that the default value was an empty string.

virtual QString makVrf::DtWeaponSelectionWidget::weaponId ( const QString &  qweaponName) const
protectedvirtual

Lookup the weapon ID for the selected weapon.

virtual QString makVrf::DtWeaponSelectionWidget::weaponName ( const QString &  weaponId) const
protectedvirtual
virtual std::list<DtString> makVrf::DtWeaponSelectionWidget::weaponResources ( QString &  qweaponName) const
protectedvirtual

Lookup the weapon resources for the selected weapon.

virtual DtTaskSetVariableWidgetExtensionInterface* makVrf::DtWeaponSelectionWidget::parameterContents ( QWidget *  parent,
const Qt::WindowFlags &  flags = 0 
) const
overrideprotectedvirtual

If there are any, returns contents for this variable for variable extension. Default is no extension.

Reimplemented from makVrf::DtTaskSetVariableWidgetInterface.

virtual void makVrf::DtWeaponSelectionWidget::weaponSelectionChanged ( )
protectedvirtualslot
virtual void makVrf::DtWeaponSelectionWidget::resourceSelectionChanged ( )
protectedvirtualslot

Member Data Documentation

boost::signals2::signal<void ()> makVrf::DtWeaponSelectionWidget::signal_receivedWeaponsList
boost::signals2::signal<void ()> makVrf::DtWeaponSelectionWidget::signal_weaponSelectionChanged
boost::signals2::signal<void()> makVrf::DtWeaponSelectionWidget::signal_resourceSelectionChanged
std::set<DtUUID> makVrf::DtWeaponSelectionWidget::myToRequest
protected
std::set<DtUUID> makVrf::DtWeaponSelectionWidget::myAwaitingWeaponSystemResponse
protected
std::set<DtUUID> makVrf::DtWeaponSelectionWidget::myDidRequest
protected
std::vector<DtUUID> makVrf::DtWeaponSelectionWidget::myCurrSelected
protected
DtString makVrf::DtWeaponSelectionWidget::myResourceToSelect
protected

If no resources yet when selectResource is called, hold on until the resources come in from the back-end.

bool makVrf::DtWeaponSelectionWidget::myIncludeResources
protected

Indicates whether the back end will be asked to include resources with the weapon names it returns; also whether they will be included in the display list.

bool makVrf::DtWeaponSelectionWidget::myDisplayWeapons
protected

Specifies if the weapons list combo-box will be displayed - so the user to select a weapon. The weapons list might be kept hidden for weapons which have just a single resource - e.g. cruise missile In the case of a hidden list with multiple weapons - the resource list should display a union of resources for all weapons.

bool makVrf::DtWeaponSelectionWidget::myDisplayResources
protected

Specifies if the resources list combo-box will be displayed - so the user to select a resource for a selected weapon. The weapons list might be kept hidden for weapons like Grenade, when the user selects just the ammunition, or if there is just a single weapon In the case of a hidden list with multiple weapons - the resource list should display a union of resources for all weapons.

DtWeaponSystemType makVrf::DtWeaponSelectionWidget::myWeaponFilterType
protected

Used for pre VRF-5.1 scenarios - should be deprecated. Option to allow user to filter by a particular category of weapon.

std::vector<DtSimTaskMessageType> makVrf::DtWeaponSelectionWidget::myFireTaskTypes
protected

Filters the weapon systems on their capability to execute tasks.

QLabel* makVrf::DtWeaponSelectionWidget::myWeaponLabel
QComboBox* makVrf::DtWeaponSelectionWidget::myWeaponSystemsCombo
QHBoxLayout* makVrf::DtWeaponSelectionWidget::myWeaponContentLayout
QLabel* makVrf::DtWeaponSelectionWidget::myResourcesLabel
QComboBox* makVrf::DtWeaponSelectionWidget::myResourcesCombo
QHBoxLayout* makVrf::DtWeaponSelectionWidget::myResourcesContentLayout
QString makVrf::DtWeaponSelectionWidget::myDefaultValue

Property Documentation

bool makVrf::DtWeaponSelectionWidget::allowMultipleSelecion
readwrite

Used for pre VRF-5.1 scripts - should be deprecated. The variableDataFromUiDesigner() function should be removed. It checks for the multiple selection boolean flag, which has been removed. The widget allow only a single weapon/resource selection through combo box. If there is a checkbox in the widget UI designer - it should be removed. Call before setup – allows multiple selection of weapons.


The documentation for this class was generated from the following file:

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)