Merge branch 'work/bandwidth_doubleclick' into 'develop'
Navigate to tracetime when analysis plot is doubleclicked See merge request ems/astdm/dram.sys!326
This commit is contained in:
@@ -41,10 +41,12 @@
|
||||
#include "businessObjects/commentmodel.h"
|
||||
#include "businessObjects/configmodels.h"
|
||||
#include "businessObjects/pythoncaller.h"
|
||||
#include "businessObjects/tracetime.h"
|
||||
#include "presentation/traceselector.h"
|
||||
#include "qmessagebox.h"
|
||||
#include "queryeditor.h"
|
||||
#include "qwt_legend.h"
|
||||
#include "qwt_plot_canvas.h"
|
||||
#include "qwt_plot_curve.h"
|
||||
#include "qwt_plot_histogram.h"
|
||||
#include "qwt_plot_layout.h"
|
||||
@@ -53,6 +55,7 @@
|
||||
#include "qwt_scale_draw.h"
|
||||
#include "qwt_scale_widget.h"
|
||||
#include "ui_tracefiletab.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QDebug>
|
||||
#include <QFileDialog>
|
||||
@@ -139,6 +142,10 @@ void TraceFileTab::initNavigatorAndItsDependentWidgets(QString path)
|
||||
|
||||
ui->selectedTransactionTree->init(navigator);
|
||||
//ui->debugMessages->init(navigator,ui->traceplot);
|
||||
|
||||
ui->bandwidthPlot->canvas()->installEventFilter(this);
|
||||
ui->powerPlot->canvas()->installEventFilter(this);
|
||||
ui->bufferPlot->canvas()->installEventFilter(this);
|
||||
}
|
||||
|
||||
void TraceFileTab::setUpFileWatcher(QString path)
|
||||
@@ -298,6 +305,32 @@ void TraceFileTab::on_latencyTreeView_doubleClicked(const QModelIndex &index)
|
||||
}
|
||||
}
|
||||
|
||||
bool TraceFileTab::eventFilter(QObject *object, QEvent *event)
|
||||
{
|
||||
if (auto canvas = qobject_cast<QwtPlotCanvas *>(object))
|
||||
{
|
||||
if (event->type() == QEvent::MouseButtonDblClick)
|
||||
{
|
||||
QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
|
||||
|
||||
if (mouseEvent->button() != Qt::LeftButton)
|
||||
return false;
|
||||
|
||||
QwtPlot *plot = canvas->plot();
|
||||
|
||||
double realTime = plot->invTransform(QwtPlot::xBottom, mouseEvent->x());
|
||||
|
||||
// Convert from seconds to picoseconds
|
||||
traceTime time = realTime * 1000 * 1000 * 1000 * 1000;
|
||||
|
||||
navigator->navigateToTime(time);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return QWidget::eventFilter(object, event);
|
||||
}
|
||||
|
||||
void TraceFileTab::on_startLatencyAnalysis_clicked()
|
||||
{
|
||||
// Setup Database:
|
||||
|
||||
@@ -84,6 +84,13 @@ public:
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
|
||||
/**
|
||||
* Used to respond to double click events in the analysis
|
||||
* plots to navigate quickly to the corresponding tracetime.
|
||||
* May be moved into a seperate class at a later point in time.
|
||||
*/
|
||||
bool eventFilter(QObject *object, QEvent *event) override;
|
||||
|
||||
private:
|
||||
QString path;
|
||||
Ui::TraceFileTab *ui;
|
||||
|
||||
Reference in New Issue
Block a user