VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Public Attributes | Protected Slots | Protected Member Functions | Protected Attributes | Friends
makVrv::DtDisplayUnitsSettingsWidget Class Reference

This class displays the display units. More...

Inheritance diagram for makVrv::DtDisplayUnitsSettingsWidget:
Inheritance graph
[legend]

Public Member Functions

 DtDisplayUnitsSettingsWidget (DtDe &de, QWidget *parent, Qt::WindowFlags f=Qt::Widget)
 CTOR. More...
 
virtual ~DtDisplayUnitsSettingsWidget ()
 Virtual DTOR. More...
 
virtual void addDisplayUnitToUI (const DtUnicode &displayUnitCollectionName, const DtUnicode &displayUnitName, makArchives::DtDisplayUnitsSettingsRecord::DisplayUnitType type)
 Add a display unit to the interface. More...
 
virtual void updateDisplayUnitUnit (const std::string &displayUnitCollectionName, const std::string &displayUnitName, unsigned int unitEnumValue)
 Update the interface to reflect the new unit of measurement a display unit uses. More...
 
virtual void updateDisplayUnitDecimals (const std::string &displayUnitCollectionName, const std::string &displayUnitName, unsigned int decimals)
 Update the interface to reflect the new number of decimals a display unit uses. More...
 
virtual void updateDisplayUnitName (const DtUnicode &displayUnitCollectionName, const DtUnicode &displayUnitName, const DtUnicode &newDisplayName)
 Update the name of a display unit in the UI. More...
 
virtual void setDisplayUnitDecimalsQSpinBoxVisible (const std::string &displayUnitCollectionName, const std::string &displayUnitName, bool isVisible)
 Update the visibility of a QSpinBox associated with a display unit. More...
 
virtual void addSuppressMagneticNorthNotationCheckBox ()
 Add a checkbox that toggles the suppression of magnetic north notation to the GUI. More...
 
virtual void setSuppressMagneticNorthNotationEnabled (bool enabled)
 Set the state of the QCheckBox for suppressing magnetic north notation. More...
 
virtual void addObjectTypeToUI (const DtUnicode &objectType)
 Add an object type to the interface. More...
 
virtual std::string currentObjectType () const
 Get the currently selected object type. More...
 
virtual void populateDisplayUnitComboBoxes (makArchives::DtDisplayUnitsSettingsRecord::DisplayUnitType displayUnitType, const DtUnicode &name, unsigned int unitEnumValue)
 Populate the appropriate unit of measurement combo boxes. More...
 
virtual void clear ()
 Removes all the display units and unit of measurements from the GUI. More...
 
- Public Member Functions inherited from makVrv::DtDisplayUnitsSettingsInterface
virtual ~DtDisplayUnitsSettingsInterface ()
 DTOR. More...
 

Public Attributes

QGridLayout * myMainLayout
 
QHBoxLayout * myObjectTypeLayout
 
QLabelmyObjectTypeLabel
 
QComboBoxmyObjectTypeComboBox
 
QLabelmyDecimalPlacesLabel
 
std::map< std::string,
std::set< QWidget * > > 
myDynamicWidgets
 
std::map< std::string,
unsigned int
myDynamicWidgetsLayoutIndices
 
std::map
< makArchives::DtDisplayUnitsSettingsRecord::DisplayUnitType,
std::set< QComboBox * > > 
myComboBoxesByDisplayUnitType
 
- Public Attributes inherited from makVrv::DtDisplayUnitsSettingsInterface
boost::signalslib::signal< void()> signal_currentObjectTypeChanged
 Used to signal the logic class when the currently selected object type, e.g. More...
 
boost::signalslib::signal
< void(const std::string
&displayUnitCollectionName,
const std::string
&displayUnitName, unsigned int
unitEnumValue)> 
signal_displayUnitUnitChanged
 Used to signal the logic class when the unit of measurement to use for a display unit has changed in the GUI. More...
 
boost::signalslib::signal
< void(const std::string
&displayUnitCollectionName,
const std::string
&displayUnitName, unsigned int
decimals)> 
signal_displayUnitDecimalsChanged
 Used to signal the logic class when the number of decimal places to use for a display unit has changed in the GUI. More...
 
boost::signalslib::signal
< void(bool
suppressMagNorthNotation)> 
signal_suppressMagneticNorthNotationChanged
 Used to signal the logic class when the checkbox indicating whether or not to suppress magnetic north notation has changed in the GUI. More...
 

Protected Slots

void slot_onObjectTypeChanged (int index)
 
void slot_onDisplayUnitUnitChanged (int unit)
 
void slot_onDisplayUnitDecimalsChanged (int decimals)
 
void slot_onSuppressMagneticNorthNotationCheckboxChanged (int state)
 

Protected Member Functions

virtual void setupGui ()
 Sets up the GUI with three sections for some number of display units, added via addDisplayUnitToUI(...). More...
 
virtual std::string getDisplayUnitKey (const std::string &displayUnitCollectionName, const std::string &displayUnitName) const
 Get the string key for a display unit The key is used internally to group its dynamic children widgets by storing the key in widgets that control a display unit setting, e.g. More...
 

Protected Attributes

DtDemyDe
 
unsigned int myNextAvailableObjectRowIndex
 These are used to maintain the next free row in the QGridLayout so display units can continually be added to the GUI. More...
 
unsigned int myNextAvailableApplicationRowIndex
 
unsigned int myNextAvailableWeatherRowIndex
 

Friends

class DtDisplayUnitsSettingsWidgetCreator
 

Detailed Description

This class displays the display units.

Constructor & Destructor Documentation

makVrv::DtDisplayUnitsSettingsWidget::DtDisplayUnitsSettingsWidget ( DtDe de,
QWidget *  parent,
Qt::WindowFlags  f = Qt::Widget 
)

CTOR.

virtual makVrv::DtDisplayUnitsSettingsWidget::~DtDisplayUnitsSettingsWidget ( )
virtual

Virtual DTOR.

Member Function Documentation

virtual void makVrv::DtDisplayUnitsSettingsWidget::addDisplayUnitToUI ( const DtUnicode displayUnitCollectionName,
const DtUnicode displayUnitName,
makArchives::DtDisplayUnitsSettingsRecord::DisplayUnitType  type 
)
virtual

Add a display unit to the interface.

Parameters
displayUnitCollectionNameThe name of the collection the display unit is in.
displayUnitNameThe name of the display unit of interest.
typeThe display unit type this display unit measures.

Implements makVrv::DtDisplayUnitsSettingsInterface.

virtual void makVrv::DtDisplayUnitsSettingsWidget::updateDisplayUnitUnit ( const std::string &  displayUnitCollectionName,
const std::string &  displayUnitName,
unsigned int  unitEnumValue 
)
virtual

Update the interface to reflect the new unit of measurement a display unit uses.

Parameters
displayUnitCollectionNameThe name of the collection the display unit is in.
displayUnitNameThe name of the display unit of interest.
unitEnumValueThe enumeration value of the specific unit of measurement to use.

Implements makVrv::DtDisplayUnitsSettingsInterface.

virtual void makVrv::DtDisplayUnitsSettingsWidget::updateDisplayUnitDecimals ( const std::string &  displayUnitCollectionName,
const std::string &  displayUnitName,
unsigned int  decimals 
)
virtual

Update the interface to reflect the new number of decimals a display unit uses.

Parameters
displayUnitCollectionNameThe name of the collection the display unit is in.
displayUnitNameThe name of the display unit of interest.
decimalsThe number of decimals the display unit now uses.

Implements makVrv::DtDisplayUnitsSettingsInterface.

virtual void makVrv::DtDisplayUnitsSettingsWidget::updateDisplayUnitName ( const DtUnicode displayUnitCollectionName,
const DtUnicode displayUnitName,
const DtUnicode newDisplayName 
)
virtual

Update the name of a display unit in the UI.

Parameters
displayUnitCollectionNameThe name of the collection the display unit is in.
displayUnitNameThe name of the display unit of interest.
newDisplayNameThe name of the display unit as shown in the GUI This function will look for the dynamic QLabel widget for a display unit and uses QLabel::setText(...) to update the display name for a display unit in the GUI and will do nothing if the widget is not found. This function does not rename the display unit in the display unit settings.

Implements makVrv::DtDisplayUnitsSettingsInterface.

virtual void makVrv::DtDisplayUnitsSettingsWidget::setDisplayUnitDecimalsQSpinBoxVisible ( const std::string &  displayUnitCollectionName,
const std::string &  displayUnitName,
bool  isVisible 
)
virtual

Update the visibility of a QSpinBox associated with a display unit.

Parameters
displayUnitCollectionNameThe name of the collection the display unit is in.
displayUnitNameThe name of the display unit of interest.
newDisplayNameThe name of the display unit as shown in the GUI This function will look for the dynamic QSpinBox widget for a display unit and uses QWidget::setVisible(...) to update it visibility and will do nothing if the widget is not found.

Implements makVrv::DtDisplayUnitsSettingsInterface.

virtual void makVrv::DtDisplayUnitsSettingsWidget::addSuppressMagneticNorthNotationCheckBox ( )
virtual

Add a checkbox that toggles the suppression of magnetic north notation to the GUI.

Implements makVrv::DtDisplayUnitsSettingsInterface.

virtual void makVrv::DtDisplayUnitsSettingsWidget::setSuppressMagneticNorthNotationEnabled ( bool  enabled)
virtual

Set the state of the QCheckBox for suppressing magnetic north notation.

Implements makVrv::DtDisplayUnitsSettingsInterface.

virtual void makVrv::DtDisplayUnitsSettingsWidget::addObjectTypeToUI ( const DtUnicode objectType)
virtual

Add an object type to the interface.

Parameters
objectTypeThe string representation for the object type

Implements makVrv::DtDisplayUnitsSettingsInterface.

virtual std::string makVrv::DtDisplayUnitsSettingsWidget::currentObjectType ( ) const
virtual

Get the currently selected object type.

Returns
The string representation for the object type

Implements makVrv::DtDisplayUnitsSettingsInterface.

virtual void makVrv::DtDisplayUnitsSettingsWidget::populateDisplayUnitComboBoxes ( makArchives::DtDisplayUnitsSettingsRecord::DisplayUnitType  displayUnitType,
const DtUnicode name,
unsigned int  unitEnumValue 
)
virtual

Populate the appropriate unit of measurement combo boxes.

This function populates the dropdown boxes of all display units that measure the specified display unit type with the unit of measurement information that is passed in.

Parameters
displayUnitTypeThe unsigned integer value that corresponds to a physical quantity, in the DisplayUnitType enumeration, the display unit is measuring.
nameThe name of the unit of measurement.
unitEnumValueThe enumeration value corresponding to the unit of measurement being added.

Implements makVrv::DtDisplayUnitsSettingsInterface.

virtual void makVrv::DtDisplayUnitsSettingsWidget::clear ( )
virtual

Removes all the display units and unit of measurements from the GUI.

Implements makVrv::DtDisplayUnitsSettingsInterface.

void makVrv::DtDisplayUnitsSettingsWidget::slot_onObjectTypeChanged ( int  index)
protectedslot
void makVrv::DtDisplayUnitsSettingsWidget::slot_onDisplayUnitUnitChanged ( int  unit)
protectedslot
void makVrv::DtDisplayUnitsSettingsWidget::slot_onDisplayUnitDecimalsChanged ( int  decimals)
protectedslot
void makVrv::DtDisplayUnitsSettingsWidget::slot_onSuppressMagneticNorthNotationCheckboxChanged ( int  state)
protectedslot
virtual void makVrv::DtDisplayUnitsSettingsWidget::setupGui ( )
protectedvirtual

Sets up the GUI with three sections for some number of display units, added via addDisplayUnitToUI(...).

The three sections are used for the three display unit collection types VR-Vantage has by default. They are, in order as they appear in the GUI, the Object-Type display unit collection, the Application display unit collection, and the Weather display unit collection. The Object-Type section has a combo box that lists all the entity types, e.g. Fixed Wing, we maintain display unit information for. The Object-Type section will display display unit information for the currently selected entity type in the combo box. Since the Object-Type section is used for all the display unit collections for entity types, it is assumed they all maintain the same set of display units.

virtual std::string makVrv::DtDisplayUnitsSettingsWidget::getDisplayUnitKey ( const std::string &  displayUnitCollectionName,
const std::string &  displayUnitName 
) const
protectedvirtual

Get the string key for a display unit The key is used internally to group its dynamic children widgets by storing the key in widgets that control a display unit setting, e.g.

the QSpinBox that controls the number of decimal places used for the Application/Weather display unit.

Friends And Related Function Documentation

Member Data Documentation

QGridLayout* makVrv::DtDisplayUnitsSettingsWidget::myMainLayout
QHBoxLayout* makVrv::DtDisplayUnitsSettingsWidget::myObjectTypeLayout
QLabel* makVrv::DtDisplayUnitsSettingsWidget::myObjectTypeLabel
QComboBox* makVrv::DtDisplayUnitsSettingsWidget::myObjectTypeComboBox
QLabel* makVrv::DtDisplayUnitsSettingsWidget::myDecimalPlacesLabel
std::map<std::string, std::set<QWidget*> > makVrv::DtDisplayUnitsSettingsWidget::myDynamicWidgets
std::map<std::string, unsigned int> makVrv::DtDisplayUnitsSettingsWidget::myDynamicWidgetsLayoutIndices
std::map<makArchives::DtDisplayUnitsSettingsRecord::DisplayUnitType, std::set<QComboBox*> > makVrv::DtDisplayUnitsSettingsWidget::myComboBoxesByDisplayUnitType
DtDe& makVrv::DtDisplayUnitsSettingsWidget::myDe
protected
unsigned int makVrv::DtDisplayUnitsSettingsWidget::myNextAvailableObjectRowIndex
protected

These are used to maintain the next free row in the QGridLayout so display units can continually be added to the GUI.

The default values make it so the widget can have 49 Object-Type display units before running out of slots. Same is true for the number of Application display units. Since the weather dispaly units live at the bottom of the widget, you could have more than 49 display units.

unsigned int makVrv::DtDisplayUnitsSettingsWidget::myNextAvailableApplicationRowIndex
protected
unsigned int makVrv::DtDisplayUnitsSettingsWidget::myNextAvailableWeatherRowIndex
protected

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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)