MAK RTIspy API Documentation for HLA Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Slots | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions

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

+ Inheritance diagram for DtTreesAndGraphWidget:
+ Collaboration diagram for DtTreesAndGraphWidget:

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. More...
 

Public Slots

void deleteDialog (QWidget *graphDialog)
 Handles deletion of a graph dialog. More...
 
void processItemSelection (const QModelIndex &index)
 Processes item selection by enabling/disabling buttons and menu actions for the newly selected item. More...
 
void showContextMenu (const QPoint &point)
 Shows the context menu. More...
 
void graphSelectedItem ()
 Creates a graph for the selected item. More...
 
void graphSelectedItemRate ()
 Creates a graph for the rate of change for the selected item. More...
 
void updateSortingEnable ()
 Checks whether the trees should have sorting enabled or disabled. More...
 
void saveTreesToFile ()
 Saves the trees to a file. More...
 
void hideToolbar ()
 

Public Member Functions

 DtTreesAndGraphWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 Constructor. More...
 
virtual ~DtTreesAndGraphWidget ()
 Destructor. More...
 
virtual QSize sizeHint () const
 Returns the recommended size for the widget. More...
 
unsigned addTree (const QString &name, const QString &description, QAbstractItemModel *model, DtRowNameLoc rowNameLoc, bool hideHeaders=false)
 Adds a new tree, must be called prior to initComplete. More...
 
void initComplete ()
 Initializes the widget, adding trees with each of the given names. More...
 
void enableValueGraphing (unsigned treeIndex, unsigned column, const QString &units)
 Enables the option to graph the value for the given column of the given tree. More...
 
void enableRateGraphing (unsigned treeIndex, unsigned column, const QString &units)
 Enables the option to graph the rate for the given column of the given tree. More...
 
void addSet (DtTreeAndModelIndex modelIndex)
 Adds a set to the graph for the given model index. More...
 
void deleteSet (DtTreeAndModelIndex modelIndex)
 Deletes the set matching the given model index from the graph. More...
 
void updateGraphs (double currentTime)
 Must be called periodically to update the graph. More...
 
void updateGraphsForTree (unsigned treeIndex, double currentTime)
 Updates the graphs for the specified tree. More...
 
void saveGuiConfiguration (QFile &configFile)
 Saves the GUI configuration to the given file. More...
 
void loadGuiConfiguration (QFile &configFile)
 Loads the GUI configuration from the given file. More...
 
void setFederateId (const QString &federateId)
 Sets the federate identification text. More...
 
void setFederateDescription (const QString &federateDescr)
 Sets the federate description text. More...
 

Protected Types

enum  TableFileFormat { TextTableFormat, CsvTableFormat }
 

Protected Member Functions

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

Protected Attributes

QSplitter * mySplitter
 Main layout. More...
 
std::vector< QVBoxLayout * > myTreeLayouts
 Layouts for each tree. More...
 
std::vector< QLabel * > myTreeLabels
 Labels for each tree. More...
 
std::vector< QHBoxLayout * > myTreeLabelLayouts
 Layouts for each tree label. More...
 
std::vector< QTreeView * > myTreeViews
 The tree view for each tree. More...
 
std::vector< DtRowNameLocmyTreeRowNameLocs
 The row name location for the tree. More...
 
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. More...
 
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. More...
 
QSignalMapper * myCloseGraphSignalMapper
 Maps signals from graph dialog close events. More...
 
DtTreeAndModelIndex myCurrentModelIndex
 The model index for which to display the context menu. More...
 
QString myFederateId
 Identifying text for the current federate. More...
 
QString myFederateDescription
 Detailed description of this federate. More...
 
std::map< DtTreeAndModelIndex,
DtGraphDialog * > 
myGraphByModelIndex
 Maps between a graphed model index and the graph dialog that is displaying it. More...
 
std::map< DtGraphDialog
*, DtTreeAndModelIndex
myModelIndexByGraph
 Maps between a graphed model index and the graph dialog that is displaying it. More...
 
std::map< DtTreeAndModelIndex,
DtGraphDialog * > 
myRateGraphByModelIndex
 Maps between a graphed model index and the graph dialog that is displaying its rate. More...
 
std::map< DtGraphDialog
*, DtTreeAndModelIndex
myModelIndexByRateGraph
 Maps between a graphed model index and the graph dialog that is displaying its rate. More...
 
QMenu * myContextMenu
 The context menu and toolbar and their actions. More...
 
QToolBar * myToolBar
 The context menu and toolbar and their actions. More...
 
QAction * myGraphItemAction
 The context menu and toolbar and their actions. More...
 
QAction * myGraphRateAction
 The context menu and toolbar and their actions. More...
 
QAction * mySaveToFileAction
 The context menu and toolbar and their actions. More...
 

Static Protected Attributes

static const QString theTreeBreakText
 Indicates the end of one tree's configuration data and the start of the next in a GUI config file. More...
 

Private Member Functions

 DtTreesAndGraphWidget (const DtTreesAndGraphWidget &)
 Copy Constructor not implemented. More...
 
DtTreesAndGraphWidgetoperator= (const DtTreesAndGraphWidget &)
 Assignment Operator not implemented. More...
 

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> DtTreesAndGraphWidget::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

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

Constructor.

virtual DtTreesAndGraphWidget::~DtTreesAndGraphWidget ( )
virtual

Destructor.

DtTreesAndGraphWidget::DtTreesAndGraphWidget ( const DtTreesAndGraphWidget )
private

Copy Constructor not implemented.

Member Function Documentation

void DtTreesAndGraphWidget::addSet ( DtTreeAndModelIndex  modelIndex)

Adds a set to the graph for the given model index.

unsigned DtTreesAndGraphWidget::addTree ( const QString &  name,
const QString &  description,
QAbstractItemModel *  model,
DtRowNameLoc  rowNameLoc,
bool  hideHeaders = false 
)

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

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

void DtTreesAndGraphWidget::connectSignals ( )
protected

Connects our signals and slots.

void DtTreesAndGraphWidget::deleteDialog ( QWidget graphDialog)
slot

Handles deletion of a graph dialog.

void DtTreesAndGraphWidget::deleteSet ( DtTreeAndModelIndex  modelIndex)

Deletes the set matching the given model index from the graph.

void DtTreesAndGraphWidget::enableDisableGraphOptions ( )
protected

Enables and disables the graph actions for the selected item.

void DtTreesAndGraphWidget::enableRateGraphing ( unsigned  treeIndex,
unsigned  column,
const QString &  units 
)

Enables the option to graph the rate for the given column of the given tree.

void DtTreesAndGraphWidget::enableValueGraphing ( unsigned  treeIndex,
unsigned  column,
const QString &  units 
)

Enables the option to graph the value for the given column of the given tree.

Must also specify the x axis label.

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

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

void DtTreesAndGraphWidget::graphSelectedItem ( )
slot

Creates a graph for the selected item.

void DtTreesAndGraphWidget::graphSelectedItemRate ( )
slot

Creates a graph for the rate of change for the selected item.

void DtTreesAndGraphWidget::hideToolbar ( )
slot
void DtTreesAndGraphWidget::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.

void DtTreesAndGraphWidget::initTrees ( )
protected

Initializes all added trees.

void DtTreesAndGraphWidget::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.

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

Assignment Operator not implemented.

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

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

void DtTreesAndGraphWidget::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.

void DtTreesAndGraphWidget::saveTreesToFile ( )
slot

Saves the trees to a file.

void DtTreesAndGraphWidget::setFederateDescription ( const QString &  federateDescr)
inline

Sets the federate description text.

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

Sets the federate identification text.

void DtTreesAndGraphWidget::showContextMenu ( const QPoint &  point)
slot

Shows the context menu.

virtual QSize DtTreesAndGraphWidget::sizeHint ( ) const
virtual

Returns the recommended size for the widget.

void DtTreesAndGraphWidget::updateGraphs ( double  currentTime)

Must be called periodically to update the graph.

void DtTreesAndGraphWidget::updateGraphsForTree ( unsigned  treeIndex,
double  currentTime 
)

Updates the graphs for the specified tree.

void DtTreesAndGraphWidget::updateSortingEnable ( )
slot

Checks whether the trees should have sorting enabled or disabled.

void DtTreesAndGraphWidget::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

QSignalMapper* DtTreesAndGraphWidget::myCloseGraphSignalMapper
protected

Maps signals from graph dialog close events.

QMenu* DtTreesAndGraphWidget::myContextMenu
protected

The context menu and toolbar and their actions.

DtTreeAndModelIndex DtTreesAndGraphWidget::myCurrentModelIndex
protected

The model index for which to display the context menu.

QString DtTreesAndGraphWidget::myFederateDescription
protected

Detailed description of this federate.

Printed to files with tree information to preserve more detailed information about the federate.

QString DtTreesAndGraphWidget::myFederateId
protected

Identifying text for the current federate.

std::map<DtTreeAndModelIndex, DtGraphDialog*> DtTreesAndGraphWidget::myGraphByModelIndex
protected

Maps between a graphed model index and the graph dialog that is displaying it.

QAction* DtTreesAndGraphWidget::myGraphItemAction
protected

The context menu and toolbar and their actions.

QAction* DtTreesAndGraphWidget::myGraphRateAction
protected

The context menu and toolbar and their actions.

std::map<DtGraphDialog*, DtTreeAndModelIndex> DtTreesAndGraphWidget::myModelIndexByGraph
protected

Maps between a graphed model index and the graph dialog that is displaying it.

std::map<DtGraphDialog*, DtTreeAndModelIndex> DtTreesAndGraphWidget::myModelIndexByRateGraph
protected

Maps between a graphed model index and the graph dialog that is displaying its rate.

std::map<DtTreeAndModelIndex, DtGraphDialog*> DtTreesAndGraphWidget::myRateGraphByModelIndex
protected

Maps between a graphed model index and the graph dialog that is displaying its rate.

QAction* DtTreesAndGraphWidget::mySaveToFileAction
protected

The context menu and toolbar and their actions.

QSplitter* DtTreesAndGraphWidget::mySplitter
protected

Main layout.

QToolBar* DtTreesAndGraphWidget::myToolBar
protected

The context menu and toolbar and their actions.

std::vector<QHBoxLayout*> DtTreesAndGraphWidget::myTreeLabelLayouts
protected

Layouts for each tree label.

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

Labels for each tree.

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

Layouts for each tree.

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

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

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

The row name location for the tree.

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

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

std::vector<QTreeView*> DtTreesAndGraphWidget::myTreeViews
protected

The tree view for each tree.

const QString DtTreesAndGraphWidget::theTreeBreakText
staticprotected

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


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

Document ID: Generated on Thu May 11 15:55:32 EDT 2023 from SVN revision 254743
Copyright © 2005-2020 MAK Technologies Inc. All Rights Reserved (www.mak.com)