Added dynamic update support to flowView as well. As in the frame details view, it currently does not do realtime updates as frames come in but will update when a new file is loaded.

This commit is contained in:
Collin Kidder
2015-06-03 22:02:40 -04:00
parent c1a490c911
commit 97f7db4e62
3 changed files with 59 additions and 1 deletions
+38
View File
@@ -1,5 +1,6 @@
#include "flowviewwindow.h"
#include "ui_flowviewwindow.h"
#include "mainwindow.h"
const QColor FlowViewWindow::graphColors[8] = {Qt::blue, Qt::green, Qt::black, Qt::red, //0 1 2 3
Qt::gray, Qt::yellow, Qt::cyan, Qt::darkMagenta}; //4 5 6 7
@@ -59,6 +60,8 @@ FlowViewWindow::FlowViewWindow(QVector<CANFrame> *frames, QWidget *parent) :
connect(ui->listFrameID, SIGNAL(currentTextChanged(QString)), this, SLOT(changeID(QString)));
connect(playbackTimer, SIGNAL(timeout()), this, SLOT(timerTriggered()));
connect(MainWindow::getReference(), SIGNAL(framesUpdated(int)), this, SLOT(updatedFrames(int)));
playbackTimer->setInterval(ui->spinPlayback->value()); //set the timer to the default value of the control
}
@@ -84,6 +87,38 @@ FlowViewWindow::~FlowViewWindow()
delete playbackTimer;
}
void FlowViewWindow::updatedFrames(int numFrames)
{
if (numFrames == -1) //all frames deleted. Kill the display
{
ui->listFrameID->clear();
foundID.clear();
currentPosition = 0;
refreshIDList();
updateFrameLabel();
removeAllGraphs();
memset(refBytes, 0, 8);
memset(currBytes, 0, 8);
updateDataView();
}
else if (numFrames == -2) //all new set of frames. Reset
{
ui->listFrameID->clear();
foundID.clear();
currentPosition = 0;
refreshIDList();
if (ui->listFrameID->count() > 0)
{
changeID(ui->listFrameID->item(0)->text());
ui->listFrameID->setCurrentRow(0);
}
updateFrameLabel();
}
else //just got some new frames. See if they are relevant.
{
}
}
void FlowViewWindow::removeAllGraphs()
{
ui->graphView->clearGraphs();
@@ -145,6 +180,9 @@ void FlowViewWindow::changeID(QString newID)
//parse the ID and then load up the frame cache with just messages with that ID.
int id = newID.toInt(NULL, 16);
frameCache.clear();
if (modelFrames->count() == 0) return;
playbackTimer->stop();
playbackActive = false;
for (int x = 0; x < modelFrames->count(); x++)