Some tweaks to make the RE tools work better on live data (not complete yet), refactored some code.

This commit is contained in:
Collin Kidder
2015-05-24 10:55:55 -04:00
parent 06ee0c9301
commit 77b8b57937
10 changed files with 28 additions and 21 deletions
+7 -4
View File
@@ -22,10 +22,6 @@ FlowViewWindow::FlowViewWindow(QVector<CANFrame> *frames, QWidget *parent) :
memset(refBytes, 0, 8);
memset(currBytes, 0, 8);
refreshIDList();
updateFrameLabel();
//ui->graphView->setInteractions();
ui->graphView->xAxis->setRange(0, 8);
@@ -59,6 +55,13 @@ FlowViewWindow::FlowViewWindow(QVector<CANFrame> *frames, QWidget *parent) :
}
void FlowViewWindow::showEvent(QShowEvent* event)
{
QDialog::showEvent(event);
refreshIDList();
updateFrameLabel();
}
FlowViewWindow::~FlowViewWindow()
{
delete ui;
+1
View File
@@ -15,6 +15,7 @@ class FlowViewWindow : public QDialog
public:
explicit FlowViewWindow(QVector<CANFrame> *frames, QWidget *parent = 0);
~FlowViewWindow();
void showEvent(QShowEvent*);
private slots:
void btnBackOneClick();
+5
View File
@@ -8,6 +8,11 @@ FrameInfoWindow::FrameInfoWindow(QVector<CANFrame> *frames, QWidget *parent) :
{
ui->setupUi(this);
modelFrames = frames;
}
void FrameInfoWindow::showEvent(QShowEvent* event)
{
QDialog::showEvent(event);
refreshIDList();
}
+1
View File
@@ -16,6 +16,7 @@ class FrameInfoWindow : public QDialog
public:
explicit FrameInfoWindow(QVector<CANFrame> *frames, QWidget *parent = 0);
~FrameInfoWindow();
void showEvent(QShowEvent*);
private slots:
void updateDetailsWindow(QListWidgetItem *);
+4
View File
@@ -60,6 +60,10 @@ GraphingWindow::~GraphingWindow()
delete ui;
}
void GraphingWindow::showEvent(QShowEvent* event)
{
QDialog::showEvent(event);
}
void GraphingWindow::titleDoubleClick(QMouseEvent* event, QCPPlotTitle* title)
{
+1
View File
@@ -31,6 +31,7 @@ class GraphingWindow : public QDialog
public:
explicit GraphingWindow(QVector<CANFrame> *, QWidget *parent = 0);
~GraphingWindow();
void showEvent(QShowEvent*);
private slots:
void titleDoubleClick(QMouseEvent *event, QCPPlotTitle *title);
+4 -9
View File
@@ -22,13 +22,8 @@ fuzzy scope - Try to find potential places where a given value might be stored -
Things currently broken or in need of attention:
1. It should be possible to stop the capture at any time.
2. The details window should tell you the min/max/avg time between frames of this ID
3. Frame reception gets weird somewhere between 100k and 150k frames. Increase prealloc and re-test
4. Expanding the main window (while having a large capture going?) could lock up the program
5. Clicking one of the three main checkboxes (auto scroll, interpret, overwrite) locks up reception
6. The windows that deal with canbus data should update based on incoming frames. It should not be required to load files to use these windows
7. Overall, test more often with large captures coming in. Use Kvaser to simulate incoming data in large quantities.
1. The details window should tell you the min/max/avg time between frames of this ID
2. The windows that deal with canbus data should update based on incoming frames. It should not be required to load files to use these windows
*/
@@ -79,7 +74,7 @@ MainWindow::MainWindow(QWidget *parent) :
worker->moveToThread(&serialWorkerThread);
connect(&serialWorkerThread, &QThread::finished, worker, &QObject::deleteLater);
connect(this, &MainWindow::sendSerialPort, worker, &SerialWorker::setSerialPort, Qt::QueuedConnection);
connect(worker, &SerialWorker::receivedFrames, this, &MainWindow::gotFrames, Qt::QueuedConnection);
connect(worker, &SerialWorker::frameUpdateTick, this, &MainWindow::gotFrames, Qt::QueuedConnection);
connect(this, &MainWindow::updateBaudRates, worker, &SerialWorker::updateBaudRates, Qt::QueuedConnection);
connect(this, &MainWindow::sendCANFrame, worker, &SerialWorker::sendFrame, Qt::QueuedConnection);
connect(worker, &SerialWorker::connectionSuccess, this, &MainWindow::connectionSucceeded, Qt::QueuedConnection);
@@ -153,7 +148,7 @@ void MainWindow::updateBaudLabel(int baud0, int baud1)
//most of the work is handled elsewhere. Need only to update the # of frames
//and maybe auto scroll
void MainWindow::gotFrames(int FPS)
void MainWindow::gotFrames(int FPS, int framesSinceLastUpdate)
{
ui->lbNumFrames->setText(QString::number(model->rowCount()));
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
+1 -1
View File
@@ -46,7 +46,7 @@ private slots:
void connectionSucceeded(int, int);
public slots:
void gotFrames(int);
void gotFrames(int, int);
signals:
+3 -6
View File
@@ -350,12 +350,9 @@ void SerialWorker::handleTick()
//qDebug() << "Tick!";
framesPerSec += gotFrames * 1000 / elapsedTime->elapsed() - (framesPerSec / 4);
elapsedTime->restart();
//if (gotFrames > 0)
//{
emit receivedFrames(framesPerSec / 4); //misnamed now. Just notifies of FPS and that frames might exist
canModel->sendBulkRefresh(gotFrames);
gotFrames = 0;
//}
emit frameUpdateTick(framesPerSec / 4, gotFrames); //sends stats to interested parties
canModel->sendBulkRefresh(gotFrames);
gotFrames = 0;
}
//totally shuts down the whole thing
+1 -1
View File
@@ -33,7 +33,7 @@ public:
signals: //we emit signals
void error(const QString &);
void receivedFrames(int); //since the last tick we got at least one more frame
void frameUpdateTick(int, int); //update interested parties about the # of frames that have come in
void connectionSuccess(int, int);
void connectionFailure();
void deviceInfo(int, int);