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:
@@ -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++)
|
||||
|
||||
@@ -28,6 +28,7 @@ private slots:
|
||||
void changeLooping(bool check);
|
||||
void timerTriggered();
|
||||
void changeID(QString);
|
||||
void updatedFrames(int);
|
||||
|
||||
private:
|
||||
Ui::FlowViewWindow *ui;
|
||||
|
||||
+20
-1
@@ -50,7 +50,26 @@ void FrameInfoWindow::updatedFrames(int numFrames)
|
||||
}
|
||||
else //just got some new frames. See if they are relevant.
|
||||
{
|
||||
//not done yet. :(
|
||||
int currID = ui->listFrameID->currentItem()->text().toInt(NULL, 16);
|
||||
bool foundID = false;
|
||||
for (int x = modelFrames->count() - numFrames; x < modelFrames->count(); x++)
|
||||
{
|
||||
if (currID = modelFrames->at(x).ID)
|
||||
{
|
||||
foundID = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundID)
|
||||
{
|
||||
//the problem here is that it'll blast us out of the details as soon as this
|
||||
//happens. The only way to do this properly is to actually traverse
|
||||
//the details structure and change the text. We don't do that yet.
|
||||
//so, the line is commented out. If people need to see the updated
|
||||
//data they can click another ID and back and it'll be OK
|
||||
|
||||
//updateDetailsWindow(ui->listFrameID->currentItem()->text());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user