![]() |
MAK RTIspy API Documentation for HLA Evolved
|
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. | |
Public Slots | |
| void | deleteDialog (QWidget *graphDialog) |
| Handles deletion of a graph dialog. | |
| void | processItemSelection (const QModelIndex &index) |
| Processes item selection by enabling/disabling buttons and menu actions for the newly selected item. | |
| void | showContextMenu (const QPoint &point) |
| Shows the context menu. | |
| void | graphSelectedItem () |
| Creates a graph for the selected item. | |
| void | graphSelectedItemRate () |
| Creates a graph for the rate of change for the selected item. | |
| void | updateSortingEnable () |
| Checks whether the trees should have sorting enabled or disabled. | |
| void | saveTreesToFile () |
| Saves the trees to a file. | |
| void | hideToolbar () |
Public Member Functions | |
| DtTreesAndGraphWidget (QWidget *parent=0, Qt::WindowFlags f=0) | |
| Constructor. | |
| virtual | ~DtTreesAndGraphWidget () |
| Destructor. | |
| virtual QSize | sizeHint () const |
| Returns the recommended size for the widget. | |
| 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. | |
| void | initComplete () |
| Initializes the widget, adding trees with each of the given names. | |
| void | enableValueGraphing (unsigned treeIndex, unsigned column, const QString &units) |
| Enables the option to graph the value for the given column of the given tree. | |
| void | enableRateGraphing (unsigned treeIndex, unsigned column, const QString &units) |
| Enables the option to graph the rate for the given column of the given tree. | |
| void | addSet (DtTreeAndModelIndex modelIndex) |
| Adds a set to the graph for the given model index. | |
| void | deleteSet (DtTreeAndModelIndex modelIndex) |
| Deletes the set matching the given model index from the graph. | |
| void | updateGraphs (double currentTime) |
| Must be called periodically to update the graph. | |
| void | updateGraphsForTree (unsigned treeIndex, double currentTime) |
| Updates the graphs for the specified tree. | |
| 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 | setFederateDescription (const QString &federateDescr) |
| Sets the federate description text. | |
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 | enableDisableGraphOptions () |
| Enables and disables the graph actions for the selected item. | |
| 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. | |
| std::vector< DtRowNameLoc > | myTreeRowNameLocs |
| 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. | |
| QSignalMapper * | myCloseGraphSignalMapper |
| Maps signals from graph dialog close events. | |
| DtTreeAndModelIndex | myCurrentModelIndex |
| The model index for which to display the context menu. | |
| QString | myFederateId |
| Identifying text for the current federate. | |
| QString | myFederateDescription |
| Detailed description of this federate. | |
| std::map< DtTreeAndModelIndex, DtGraphDialog * > | myGraphByModelIndex |
| Maps between a graphed model index and the graph dialog that is displaying it. | |
| std::map< DtGraphDialog *, DtTreeAndModelIndex > | myModelIndexByGraph |
| Maps between a graphed model index and the graph dialog that is displaying it. | |
| std::map< DtTreeAndModelIndex, DtGraphDialog * > | myRateGraphByModelIndex |
| Maps between a graphed model index and the graph dialog that is displaying its rate. | |
| std::map< DtGraphDialog *, DtTreeAndModelIndex > | myModelIndexByRateGraph |
| Maps between a graphed model index and the graph dialog that is displaying its rate. | |
| QMenu * | myContextMenu |
| The context menu and toolbar and their actions. | |
| QToolBar * | myToolBar |
| The context menu and toolbar and their actions. | |
| QAction * | myGraphItemAction |
| The context menu and toolbar and their actions. | |
| QAction * | myGraphRateAction |
| The context menu and toolbar and their actions. | |
| QAction * | mySaveToFileAction |
| The context menu and toolbar and their actions. | |
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 | |
| DtTreesAndGraphWidget (const DtTreesAndGraphWidget &) | |
| Copy Constructor not implemented. | |
| DtTreesAndGraphWidget & | operator= (const DtTreesAndGraphWidget &) |
| Assignment Operator not implemented. | |
Shows detailed statistics, presented as both trees and running graphs which can be populated from the tree data.
| 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.
|
protected |
| DtTreesAndGraphWidget::DtTreesAndGraphWidget | ( | QWidget * | parent = 0, |
| Qt::WindowFlags | f = 0 |
||
| ) |
Constructor.
References DtIconAndTextureManager::getInstance(), myContextMenu, myGraphItemAction, myGraphRateAction, mySaveToFileAction, mySplitter, and myToolBar.
|
virtual |
Destructor.
|
private |
Copy Constructor not implemented.
| 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.
References myTreeLabelLayouts, myTreeLabels, myTreeLayouts, myTreeRateGraphableCols, myTreeRowNameLocs, myTreeValGraphableCols, and myTreeViews.
Referenced by DtFederateStatisticsDialog::initCallbackStatsWidget(), DtFederateStatisticsDialog::initInteractionStatsWidget(), DtFederateStatisticsDialog::initMsgStatsWidget(), DtFederateStatisticsDialog::initObjectStatsWidget(), and DtFederateStatisticsDialog::initServiceStatsWidget().
|
protected |
Connects our signals and slots.
References connect(), deleteDialog(), graphSelectedItem(), graphSelectedItemRate(), myCloseGraphSignalMapper, myGraphItemAction, myGraphRateAction, mySaveToFileAction, myTreeViews, processItemSelection(), saveTreesToFile(), showContextMenu(), and updateSortingEnable().
Referenced by initComplete().
|
slot |
Handles deletion of a graph dialog.
References myGraphByModelIndex, myModelIndexByGraph, myModelIndexByRateGraph, and myRateGraphByModelIndex.
Referenced by connectSignals().
| void DtTreesAndGraphWidget::deleteSet | ( | DtTreeAndModelIndex | modelIndex | ) |
Deletes the set matching the given model index from the graph.
|
protected |
Enables and disables the graph actions for the selected item.
References myContextMenu, myCurrentModelIndex, myGraphItemAction, myGraphRateAction, myTreeRateGraphableCols, and myTreeValGraphableCols.
Referenced by processItemSelection(), and showContextMenu().
| 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.
References myTreeRateGraphableCols.
Referenced by DtFederateStatisticsDialog::initCallbackStatsWidget(), DtFederateStatisticsDialog::initInteractionStatsWidget(), DtFederateStatisticsDialog::initMsgStatsWidget(), DtFederateStatisticsDialog::initObjectStatsWidget(), and DtFederateStatisticsDialog::initServiceStatsWidget().
| 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.
References myTreeValGraphableCols.
Referenced by DtFederateStatisticsDialog::initCallbackStatsWidget(), DtFederateStatisticsDialog::initInteractionStatsWidget(), DtFederateStatisticsDialog::initMsgStatsWidget(), DtFederateStatisticsDialog::initObjectStatsWidget(), and DtFederateStatisticsDialog::initServiceStatsWidget().
|
protected |
Retrieves the names of the row and column for a given model index.
References DtRowNameIsFirstColumn, DtRowNameIsHeader, and myTreeRowNameLocs.
Referenced by graphSelectedItem(), and graphSelectedItemRate().
|
slot |
Creates a graph for the selected item.
References connect(), DtGraphDialog::DtValueGraph, getRowAndColNames(), myCloseGraphSignalMapper, myCurrentModelIndex, myGraphByModelIndex, myModelIndexByGraph, and myTreeValGraphableCols.
Referenced by connectSignals().
|
slot |
Creates a graph for the rate of change for the selected item.
References connect(), DtGraphDialog::DtRateGraph, getRowAndColNames(), myCloseGraphSignalMapper, myCurrentModelIndex, myModelIndexByRateGraph, myRateGraphByModelIndex, and myTreeRateGraphableCols.
Referenced by connectSignals().
|
slot |
References myToolBar.
| 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.
References connectSignals(), and initTrees().
Referenced by DtFederateStatisticsDialog::initCallbackStatsWidget(), DtFederateStatisticsDialog::initInteractionStatsWidget(), DtFederateStatisticsDialog::initMsgStatsWidget(), DtFederateStatisticsDialog::initObjectStatsWidget(), and DtFederateStatisticsDialog::initServiceStatsWidget().
|
protected |
Initializes all added trees.
References mySplitter, myToolBar, myTreeLabelLayouts, myTreeLayouts, and myTreeViews.
Referenced by initComplete().
| 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.
References myTreeViews, and theTreeBreakText.
|
private |
Assignment Operator not implemented.
|
slot |
Processes item selection by enabling/disabling buttons and menu actions for the newly selected item.
References enableDisableGraphOptions(), myCurrentModelIndex, and myTreeViews.
Referenced by connectSignals().
| 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.
References myTreeViews, and theTreeBreakText.
|
slot |
Saves the trees to a file.
References CsvTableFormat, myFederateDescription, myFederateId, myTreeLabels, myTreeViews, TextTableFormat, and writeTreeToStream().
Referenced by connectSignals().
|
inline |
Sets the federate description text.
Referenced by DtFederateStatisticsDialog::updateFederateDescription().
|
inline |
Sets the federate identification text.
Referenced by DtFederateStatisticsDialog::updateFederateId().
|
slot |
Shows the context menu.
References enableDisableGraphOptions(), myContextMenu, myCurrentModelIndex, and myTreeViews.
Referenced by connectSignals().
|
virtual |
Returns the recommended size for the widget.
| void DtTreesAndGraphWidget::updateGraphs | ( | double | currentTime | ) |
Must be called periodically to update the graph.
References myModelIndexByGraph, and myModelIndexByRateGraph.
| void DtTreesAndGraphWidget::updateGraphsForTree | ( | unsigned | treeIndex, |
| double | currentTime | ||
| ) |
Updates the graphs for the specified tree.
References myModelIndexByGraph, and myModelIndexByRateGraph.
|
slot |
Checks whether the trees should have sorting enabled or disabled.
References myTreeViews.
Referenced by connectSignals().
|
protected |
Writes the given tree's data as a table to the given file stream.
Must specify the format that should be used.
References CsvTableFormat.
Referenced by saveTreesToFile().
|
protected |
Maps signals from graph dialog close events.
Referenced by connectSignals(), graphSelectedItem(), and graphSelectedItemRate().
|
protected |
The context menu and toolbar and their actions.
Referenced by DtTreesAndGraphWidget(), enableDisableGraphOptions(), and showContextMenu().
|
protected |
The model index for which to display the context menu.
Referenced by enableDisableGraphOptions(), graphSelectedItem(), graphSelectedItemRate(), processItemSelection(), and showContextMenu().
|
protected |
Detailed description of this federate.
Printed to files with tree information to preserve more detailed information about the federate.
Referenced by saveTreesToFile().
|
protected |
Identifying text for the current federate.
Referenced by saveTreesToFile().
|
protected |
Maps between a graphed model index and the graph dialog that is displaying it.
Referenced by deleteDialog(), and graphSelectedItem().
|
protected |
The context menu and toolbar and their actions.
Referenced by connectSignals(), DtTreesAndGraphWidget(), and enableDisableGraphOptions().
|
protected |
The context menu and toolbar and their actions.
Referenced by connectSignals(), DtTreesAndGraphWidget(), and enableDisableGraphOptions().
|
protected |
Maps between a graphed model index and the graph dialog that is displaying it.
Referenced by deleteDialog(), graphSelectedItem(), updateGraphs(), and updateGraphsForTree().
|
protected |
Maps between a graphed model index and the graph dialog that is displaying its rate.
Referenced by deleteDialog(), graphSelectedItemRate(), updateGraphs(), and updateGraphsForTree().
|
protected |
Maps between a graphed model index and the graph dialog that is displaying its rate.
Referenced by deleteDialog(), and graphSelectedItemRate().
|
protected |
The context menu and toolbar and their actions.
Referenced by connectSignals(), and DtTreesAndGraphWidget().
|
protected |
Main layout.
Referenced by DtTreesAndGraphWidget(), and initTrees().
|
protected |
The context menu and toolbar and their actions.
Referenced by DtTreesAndGraphWidget(), hideToolbar(), and initTrees().
|
protected |
Layouts for each tree label.
Referenced by addTree(), and initTrees().
|
protected |
Labels for each tree.
Referenced by addTree(), and saveTreesToFile().
|
protected |
Layouts for each tree.
Referenced by addTree(), and initTrees().
|
protected |
The columns for which the rate can be graphed and the units to be displayed on the y axis.
Referenced by addTree(), enableDisableGraphOptions(), enableRateGraphing(), and graphSelectedItemRate().
|
protected |
The row name location for the tree.
Referenced by addTree(), and getRowAndColNames().
|
protected |
The columns for which the value can be graphed and the units to be displayed on the y axis.
Referenced by addTree(), enableDisableGraphOptions(), enableValueGraphing(), and graphSelectedItem().
|
protected |
The tree view for each tree.
Referenced by addTree(), connectSignals(), initTrees(), loadGuiConfiguration(), processItemSelection(), saveGuiConfiguration(), saveTreesToFile(), showContextMenu(), and updateSortingEnable().
|
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().