Merge branch 'work/traceanalyzer_commentstab' into 'develop'
Move comments to seperate tab in TraceAnalyzer See merge request ems/astdm/dram.sys!322
This commit is contained in:
@@ -48,6 +48,7 @@ McConfigModel::McConfigModel(const TraceDB &traceFile, QObject *parent) : QAbstr
|
||||
sqlQuery.next();
|
||||
QString mcConfigJson = sqlQuery.value(0).toString();
|
||||
|
||||
addAdditionalInfos(traceFile.getGeneralInfo());
|
||||
parseJson(mcConfigJson);
|
||||
}
|
||||
|
||||
@@ -62,15 +63,25 @@ void McConfigModel::parseJson(const QString &jsonString)
|
||||
|
||||
if (currentValue.isDouble())
|
||||
{
|
||||
entries.push_back(std::make_pair(key, QString::number(currentValue.toDouble())));
|
||||
entries.push_back({key, QString::number(currentValue.toDouble())});
|
||||
}
|
||||
else if (currentValue.isString())
|
||||
{
|
||||
entries.push_back(std::make_pair(key, currentValue.toString()));
|
||||
entries.push_back({key, currentValue.toString()});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void McConfigModel::addAdditionalInfos(const GeneralInfo &generalInfo)
|
||||
{
|
||||
auto addEntry = [this](const QString &key, const QString &value) { entries.push_back({key, value}); };
|
||||
|
||||
addEntry("Number of Transactions", QString::number(generalInfo.numberOfTransactions));
|
||||
addEntry("Clock period", QString::number(generalInfo.clkPeriod) + " " + generalInfo.unitOfTime.toLower());
|
||||
addEntry("Length of trace", prettyFormatTime(generalInfo.span.End()));
|
||||
addEntry("Window size", QString::number(generalInfo.windowSize));
|
||||
}
|
||||
|
||||
int McConfigModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
Q_UNUSED(parent)
|
||||
@@ -173,7 +184,7 @@ void MemSpecModel::parseJson(const QString &jsonString)
|
||||
value = currentValue.toString();
|
||||
}
|
||||
|
||||
std::unique_ptr<Node> node = std::unique_ptr<Node>(new Node(std::make_pair(key, value), parentNode.get()));
|
||||
std::unique_ptr<Node> node = std::unique_ptr<Node>(new Node({key, value}, parentNode.get()));
|
||||
addNodes(obj[key].toObject(), node);
|
||||
|
||||
parentNode->children.push_back(std::move(node));
|
||||
|
||||
@@ -65,6 +65,12 @@ private:
|
||||
*/
|
||||
void parseJson(const QString &jsonString);
|
||||
|
||||
/**
|
||||
* Add additional infos about the tracefile which were
|
||||
* previously displayed in the fileDescription widget.
|
||||
*/
|
||||
void addAdditionalInfos(const GeneralInfo &generalInfo);
|
||||
|
||||
std::vector<std::pair<QString, QString>> entries;
|
||||
};
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Derek Christ
|
||||
*/
|
||||
|
||||
#ifndef GENERALINFO_H
|
||||
@@ -52,7 +53,6 @@ public:
|
||||
unsigned int banksPerRank;
|
||||
unsigned int groupsPerRank;
|
||||
unsigned int banksPerGroup;
|
||||
QString description;
|
||||
QString unitOfTime;
|
||||
unsigned int clkPeriod;
|
||||
unsigned int windowSize;
|
||||
@@ -60,13 +60,14 @@ public:
|
||||
|
||||
GeneralInfo(unsigned int numberOfTransactions, unsigned int numberOfPhases, Timespan span,
|
||||
unsigned int numberOfRanks, unsigned int numberOfBankgroups, unsigned int numberOfBanks,
|
||||
const QString &description, QString unitOfTime, unsigned int clkPeriod,
|
||||
unsigned int windowSize, unsigned int controllerThread) :
|
||||
numberOfTransactions(numberOfTransactions) , numberOfPhases(numberOfPhases), span(span),
|
||||
numberOfRanks(numberOfRanks), numberOfBankgroups(numberOfBankgroups), numberOfBanks(numberOfBanks),
|
||||
banksPerRank(numberOfBanks / numberOfRanks), groupsPerRank(numberOfBankgroups / numberOfRanks),
|
||||
banksPerGroup(numberOfBanks / numberOfBankgroups), description(description), unitOfTime(unitOfTime),
|
||||
clkPeriod(clkPeriod), windowSize(windowSize), controllerThread(controllerThread) {}
|
||||
QString unitOfTime, unsigned int clkPeriod, unsigned int windowSize, unsigned int controllerThread)
|
||||
: numberOfTransactions(numberOfTransactions), numberOfPhases(numberOfPhases), span(span),
|
||||
numberOfRanks(numberOfRanks), numberOfBankgroups(numberOfBankgroups), numberOfBanks(numberOfBanks),
|
||||
banksPerRank(numberOfBanks / numberOfRanks), groupsPerRank(numberOfBankgroups / numberOfRanks),
|
||||
banksPerGroup(numberOfBanks / numberOfBankgroups), unitOfTime(unitOfTime), clkPeriod(clkPeriod),
|
||||
windowSize(windowSize), controllerThread(controllerThread)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif // GENERALINFO_H
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Derek Christ
|
||||
*/
|
||||
|
||||
#include <QString>
|
||||
@@ -273,19 +274,8 @@ GeneralInfo *TraceDB::getGeneralInfoFromDB()
|
||||
unsigned int windowSize = query.value(10).toInt();
|
||||
unsigned int controllerThread = query.value(11).toUInt();
|
||||
|
||||
QString description = (traces + "\n");
|
||||
description += mcconfig + "\n";
|
||||
description += memspec + "\n";
|
||||
description += "Number of Transactions: " + QString::number(
|
||||
numberOfTransactions) + "\n";
|
||||
description += "Clock period: " + QString::number(clkPeriod) + " " + unitOfTime
|
||||
+ "\n";
|
||||
description += "Length of trace: " + prettyFormatTime(traceEnd) + "\n";
|
||||
description += "Window size:" + QString::number(windowSize) + "\n";
|
||||
|
||||
return new GeneralInfo(numberOfTransactions, numberOfPhases, Timespan(0, traceEnd),
|
||||
numberOfRanks, numberOfBankgroups, numberOfBanks,
|
||||
description, unitOfTime, clkPeriod, windowSize, controllerThread);
|
||||
return new GeneralInfo(numberOfTransactions, numberOfPhases, Timespan(0, traceEnd), numberOfRanks,
|
||||
numberOfBankgroups, numberOfBanks, unitOfTime, clkPeriod, windowSize, controllerThread);
|
||||
} else {
|
||||
throw sqlException("Tracefile corrupted. No general info table",
|
||||
this->pathToDB.toStdString());
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
* Janik Schlemminger
|
||||
* Robert Gernhardt
|
||||
* Matthias Jung
|
||||
* Derek Christ
|
||||
*/
|
||||
|
||||
#ifndef TRACEDB_H
|
||||
@@ -63,7 +64,7 @@ class TraceDB : public QObject
|
||||
|
||||
public:
|
||||
TraceDB(QString path, bool openExisting);
|
||||
const QString &getPathToDB()
|
||||
const QString &getPathToDB() const
|
||||
{
|
||||
return pathToDB;
|
||||
}
|
||||
@@ -72,12 +73,12 @@ public:
|
||||
void updateFileDescription(const QString &description);
|
||||
void refreshData();
|
||||
|
||||
const GeneralInfo &getGeneralInfo()
|
||||
const GeneralInfo &getGeneralInfo() const
|
||||
{
|
||||
return *generalInfo;
|
||||
}
|
||||
|
||||
const CommandLengths &getCommandLengths()
|
||||
const CommandLengths &getCommandLengths() const
|
||||
{
|
||||
return commandLengths;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "qwt_scale_draw.h"
|
||||
#include "qwt_scale_widget.h"
|
||||
#include "ui_tracefiletab.h"
|
||||
#include <QCloseEvent>
|
||||
#include <QDebug>
|
||||
#include <QFileDialog>
|
||||
#include <QItemDelegate>
|
||||
@@ -81,9 +82,6 @@ TraceFileTab::TraceFileTab(QWidget *parent, const QString &path)
|
||||
setUpTraceSelector();
|
||||
setUpCommentView();
|
||||
|
||||
ui->fileDescriptionEdit->setPlainText(
|
||||
navigator->GeneralTraceInfo().description);
|
||||
|
||||
ui->mcConfigView->setModel(mcConfigModel);
|
||||
ui->mcConfigView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
|
||||
@@ -168,11 +166,13 @@ void TraceFileTab::setUpCommentView()
|
||||
QObject::connect(ui->commentView, &QTableView::customContextMenuRequested,
|
||||
commentModel, &CommentModel::openContextMenu);
|
||||
|
||||
QObject::connect(commentModel, &CommentModel::editTriggered, ui->commentView, [=](const QModelIndex &index){
|
||||
ui->tabWidget->setCurrentWidget(ui->tabSelectedTrans);
|
||||
ui->commentView->edit(index);
|
||||
ui->commentView->scrollTo(index);
|
||||
});
|
||||
QObject::connect(commentModel, &CommentModel::editTriggered, ui->commentView,
|
||||
[=](const QModelIndex &index)
|
||||
{
|
||||
ui->tabWidget->setCurrentWidget(ui->tabComments);
|
||||
ui->commentView->edit(index);
|
||||
ui->commentView->scrollTo(index);
|
||||
});
|
||||
|
||||
QObject::connect(ui->commentView, &QTableView::doubleClicked,
|
||||
commentModel, &CommentModel::rowDoubleClicked);
|
||||
@@ -252,10 +252,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void TraceFileTab::on_tabWidget_currentChanged(int index)
|
||||
{
|
||||
}
|
||||
|
||||
void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index)
|
||||
{
|
||||
// Get onlye the leaf:
|
||||
|
||||
@@ -96,8 +96,8 @@ public Q_SLOTS:
|
||||
Q_SIGNALS:
|
||||
void statusChanged(QString message, bool saveChangesEnable = false);
|
||||
void colorGroupingChanged(ColorGrouping colorgrouping);
|
||||
|
||||
private Q_SLOTS:
|
||||
void on_tabWidget_currentChanged(int index);
|
||||
void on_latencyTreeView_doubleClicked(const QModelIndex &index);
|
||||
void on_startLatencyAnalysis_clicked();
|
||||
void on_startPowerAnalysis_clicked();
|
||||
|
||||
@@ -120,127 +120,114 @@
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="TraceSelector" name="tabCustomizePlot">
|
||||
<attribute name="title">
|
||||
<string>Customize Plot</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabSelectedTrans">
|
||||
<attribute name="title">
|
||||
<string>Selected Transaction</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="SelectedTransactionTreeWidget" name="selectedTransactionTree">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>3</horstretch>
|
||||
<verstretch>3</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="itemsExpandable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="animated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableView" name="commentView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>2</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>200</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="gridStyle">
|
||||
<enum>Qt::NoPen</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="fileDescriptionEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>2</horstretch>
|
||||
<verstretch>1</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="SelectedTransactionTreeWidget" name="selectedTransactionTree">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>3</horstretch>
|
||||
<verstretch>3</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="itemsExpandable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="animated">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<attribute name="headerStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabSimConfig">
|
||||
<attribute name="title">
|
||||
<string>Configuration</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTableView" name="mcConfigView">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeView" name="memSpecView">
|
||||
<property name="uniformRowHeights">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="TraceSelector" name="tabCustomizePlot">
|
||||
<attribute name="title">
|
||||
<string>Customize Plot</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabComments">
|
||||
<attribute name="title">
|
||||
<string>Comments</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTableView" name="commentView">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="gridStyle">
|
||||
<enum>Qt::NoPen</enum>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -364,39 +351,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tabSimConfig">
|
||||
<attribute name="title">
|
||||
<string>Configuration</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QTableView" name="mcConfigView">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="showGrid">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeView" name="memSpecView">
|
||||
<property name="uniformRowHeights">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user