MAK RTIspy API Documentation for HLA Evolved
List of all members | Public Types | Public Slots | Signals | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
DtFomTreeAndTableWidget Class Reference

Shows detailed statistics, presented as both trees and running graphs which can be populated from the tree data. More...

+ Inheritance diagram for DtFomTreeAndTableWidget:
+ Collaboration diagram for DtFomTreeAndTableWidget:

Public Types

enum  DtRowNameLoc { DtRowNameIsHeader, DtRowNameIsFirstColumn, DtNoRowNames }
typedef std::pair< unsigned,
QModelIndex > 
DtTreeAndModelIndex
 Type which pairs the tree index and QModelIndex to uniquely identify an index across all trees in the widget.

Public Slots

void processItemSelection (const QModelIndex &index)
 Processes item selection by enabling/disabling buttons and menu actions for the newly selected item.
void processItemSelectionChange ()
 Process item selection change.
void processCurrentChanged (const QModelIndex &, const QModelIndex &)
 Process current selection change.
void updateSortingEnable ()
 Checks whether the trees should have sorting enabled or disabled.

Signals

void treeItemSelected (const QModelIndex &index)

Public Member Functions

 DtFomTreeAndTableWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructor.
virtual ~DtFomTreeAndTableWidget ()
 Destructor.
virtual QSize sizeHint () const
 Returns the recommended size for the widget.
unsigned addTree (const QString &name, QAbstractItemModel *model, DtRowNameLoc rowNameLoc, bool decorateRoot, bool hideHeader, bool alternateRowColor)
 Adds a new tree, must be called prior to initComplete.
void addTreeAndTable (const QString &treeName, QAbstractItemModel *treeModel, DtRowNameLoc treeRowNameLoc, const QString &TableName, QAbstractItemModel *tableModel, DtRowNameLoc tableRowNameLoc)
void initComplete ()
 Initializes the widget, adding trees with each of the given names.
void saveGuiConfiguration (QFile &configFile)
 Saves the GUI configuration to the given file.
void loadGuiConfiguration (QFile &configFile)
 Loads the GUI configuration from the given file.
void setFederateId (const QString &federateId)
 Sets the federate identification text.
void updateTreeLabel (const QString &name)
const QModelIndex getCurrentSelection () const
void expandTree () const
void collapseItem (QStandardItem *item)
void setSelectionBehaviorRow ()
void refresh () const

Protected Types

enum  TableFileFormat { TextTableFormat, CsvTableFormat }

Protected Member Functions

void initTrees ()
 Initializes all added trees.
void connectSignals ()
 Connects our signals and slots.
void getRowAndColNames (DtTreeAndModelIndex modelIndex, QString &rowName, QString &colName)
 Retrieves the names of the row and column for a given model index.
void writeTreeToStream (const QTreeView *tree, QTextStream &fileStrm, TableFileFormat format)
 Writes the given tree's data as a table to the given file stream.

Protected Attributes

QSplitter * mySplitter
 Main layout.
std::vector< QVBoxLayout * > myTreeLayouts
 Layouts for each tree.
std::vector< QLabel * > myTreeLabels
 Labels for each tree.
std::vector< QHBoxLayout * > myTreeLabelLayouts
 Layouts for each tree label.
std::vector< QTreeView * > myTreeViews
 The tree view for each tree.
unsigned int myTreeIndex
unsigned int myTableIndex
std::vector< DtRowNameLocmyTreeRowNameLocs
 The row name location for the tree.
std::vector< std::map
< unsigned, QString > > 
myTreeValGraphableCols
 The columns for which the value can be graphed and the units to be displayed on the y axis.
std::vector< std::map
< unsigned, QString > > 
myTreeRateGraphableCols
 The columns for which the rate can be graphed and the units to be displayed on the y axis.
DtTreeAndModelIndex myCurrentModelIndex
 The model index for which to display the context menu.
QString myFederateId
 Identifying text for the current federate.

Static Protected Attributes

static const QString theTreeBreakText = "------------\n"
 Indicates the end of one tree's configuration data and the start of the next in a GUI config file.

Private Member Functions

 DtFomTreeAndTableWidget (const DtFomTreeAndTableWidget &)
 Copy Constructor not implemented.
DtFomTreeAndTableWidgetoperator= (const DtFomTreeAndTableWidget &)
 Assignment Operator not implemented.

Detailed Description

Shows detailed statistics, presented as both trees and running graphs which can be populated from the tree data.

Member Typedef Documentation

typedef std::pair<unsigned, QModelIndex> DtFomTreeAndTableWidget::DtTreeAndModelIndex

Type which pairs the tree index and QModelIndex to uniquely identify an index across all trees in the widget.

Member Enumeration Documentation

Enumerator:
DtRowNameIsHeader 
DtRowNameIsFirstColumn 
DtNoRowNames 
Enumerator:
TextTableFormat 
CsvTableFormat 

Constructor & Destructor Documentation

DtFomTreeAndTableWidget::DtFomTreeAndTableWidget ( QWidget parent = 0,
Qt::WindowFlags  f = 0 
)

Constructor.

References mySplitter.

DtFomTreeAndTableWidget::~DtFomTreeAndTableWidget ( )
virtual

Destructor.

DtFomTreeAndTableWidget::DtFomTreeAndTableWidget ( const DtFomTreeAndTableWidget )
private

Copy Constructor not implemented.

Member Function Documentation

unsigned DtFomTreeAndTableWidget::addTree ( const QString &  name,
QAbstractItemModel *  model,
DtRowNameLoc  rowNameLoc,
bool  decorateRoot,
bool  hideHeader,
bool  alternateRowColor 
)

Adds a new tree, must be called prior to initComplete.

Specifies the tree name, column headers, and row headers. Returns the index of the tree.

References myTreeLabelLayouts, myTreeLabels, myTreeLayouts, myTreeRowNameLocs, and myTreeViews.

Referenced by addTreeAndTable().

void DtFomTreeAndTableWidget::addTreeAndTable ( const QString &  treeName,
QAbstractItemModel *  treeModel,
DtRowNameLoc  treeRowNameLoc,
const QString &  TableName,
QAbstractItemModel *  tableModel,
DtRowNameLoc  tableRowNameLoc 
)
void DtFomTreeAndTableWidget::collapseItem ( QStandardItem *  item)

References myTreeIndex, and myTreeViews.

void DtFomTreeAndTableWidget::connectSignals ( )
protected
void DtFomTreeAndTableWidget::expandTree ( ) const

References myTreeIndex, and myTreeViews.

const QModelIndex DtFomTreeAndTableWidget::getCurrentSelection ( ) const

References myTreeIndex, and myTreeViews.

Referenced by processItemSelectionChange().

void DtFomTreeAndTableWidget::getRowAndColNames ( DtTreeAndModelIndex  modelIndex,
QString &  rowName,
QString &  colName 
)
protected

Retrieves the names of the row and column for a given model index.

References DtRowNameIsFirstColumn, DtRowNameIsHeader, and myTreeRowNameLocs.

void DtFomTreeAndTableWidget::initComplete ( )

Initializes the widget, adding trees with each of the given names.

Trees are added in order and assigned indices, starting at 0, in order.

References connectSignals(), and initTrees().

Referenced by DtFomStatisticsDialog::initInteractionStatsWidget(), and DtFomStatisticsDialog::initObjectStatsWidget().

void DtFomTreeAndTableWidget::initTrees ( )
protected

Initializes all added trees.

References mySplitter, myTreeLabelLayouts, myTreeLayouts, and myTreeViews.

Referenced by initComplete().

void DtFomTreeAndTableWidget::loadGuiConfiguration ( QFile &  configFile)

Loads the GUI configuration from the given file.

It's expected that the file will be open and ready to read the configuration.

References myTreeViews, and theTreeBreakText.

DtFomTreeAndTableWidget& DtFomTreeAndTableWidget::operator= ( const DtFomTreeAndTableWidget )
private

Assignment Operator not implemented.

void DtFomTreeAndTableWidget::processCurrentChanged ( const QModelIndex &  curr,
const QModelIndex &  prev 
)
slot

Process current selection change.

References processItemSelection().

Referenced by connectSignals().

void DtFomTreeAndTableWidget::processItemSelection ( const QModelIndex &  index)
slot

Processes item selection by enabling/disabling buttons and menu actions for the newly selected item.

References myCurrentModelIndex, myTreeIndex, myTreeViews, and treeItemSelected().

Referenced by connectSignals(), processCurrentChanged(), and processItemSelectionChange().

void DtFomTreeAndTableWidget::processItemSelectionChange ( )
slot

Process item selection change.

References getCurrentSelection(), and processItemSelection().

void DtFomTreeAndTableWidget::refresh ( ) const
void DtFomTreeAndTableWidget::saveGuiConfiguration ( QFile &  configFile)

Saves the GUI configuration to the given file.

It's expected that the file will be open and ready to write to.

References myTreeViews, and theTreeBreakText.

void DtFomTreeAndTableWidget::setFederateId ( const QString &  federateId)
inline

Sets the federate identification text.

Referenced by DtFomStatisticsDialog::updateFederateId().

void DtFomTreeAndTableWidget::setSelectionBehaviorRow ( )
QSize DtFomTreeAndTableWidget::sizeHint ( ) const
virtual

Returns the recommended size for the widget.

void DtFomTreeAndTableWidget::treeItemSelected ( const QModelIndex &  index)
signal

Referenced by processItemSelection().

void DtFomTreeAndTableWidget::updateSortingEnable ( )
slot

Checks whether the trees should have sorting enabled or disabled.

References myTableIndex, and myTreeViews.

Referenced by connectSignals().

void DtFomTreeAndTableWidget::updateTreeLabel ( const QString &  name)

References myTreeLabels.

void DtFomTreeAndTableWidget::writeTreeToStream ( const QTreeView *  tree,
QTextStream &  fileStrm,
TableFileFormat  format 
)
protected

Writes the given tree's data as a table to the given file stream.

Must specify the format that should be used.

Member Data Documentation

DtTreeAndModelIndex DtFomTreeAndTableWidget::myCurrentModelIndex
protected

The model index for which to display the context menu.

Referenced by processItemSelection().

QString DtFomTreeAndTableWidget::myFederateId
protected

Identifying text for the current federate.

QSplitter* DtFomTreeAndTableWidget::mySplitter
protected

Main layout.

Referenced by DtFomTreeAndTableWidget(), and initTrees().

unsigned int DtFomTreeAndTableWidget::myTableIndex
protected
unsigned int DtFomTreeAndTableWidget::myTreeIndex
protected
std::vector<QHBoxLayout*> DtFomTreeAndTableWidget::myTreeLabelLayouts
protected

Layouts for each tree label.

Referenced by addTree(), and initTrees().

std::vector<QLabel*> DtFomTreeAndTableWidget::myTreeLabels
protected

Labels for each tree.

Referenced by addTree(), and updateTreeLabel().

std::vector<QVBoxLayout*> DtFomTreeAndTableWidget::myTreeLayouts
protected

Layouts for each tree.

Referenced by addTree(), and initTrees().

std::vector<std::map<unsigned, QString> > DtFomTreeAndTableWidget::myTreeRateGraphableCols
protected

The columns for which the rate can be graphed and the units to be displayed on the y axis.

std::vector<DtRowNameLoc> DtFomTreeAndTableWidget::myTreeRowNameLocs
protected

The row name location for the tree.

Referenced by addTree(), and getRowAndColNames().

std::vector<std::map<unsigned, QString> > DtFomTreeAndTableWidget::myTreeValGraphableCols
protected

The columns for which the value can be graphed and the units to be displayed on the y axis.

std::vector<QTreeView*> DtFomTreeAndTableWidget::myTreeViews
protected
const QString DtFomTreeAndTableWidget::theTreeBreakText = "------------\n"
staticprotected

Indicates the end of one tree's configuration data and the start of the next in a GUI config file.

Referenced by loadGuiConfiguration(), and saveGuiConfiguration().


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

Document ID: Generated on Fri Mar 14 19:08:55 EDT 2014 from SVN revision 137085
Copyright © 2005-2014 VT MÄK Inc. All Rights Reserved (www.mak.com)