Fix for crash in Flow View when a frame doesn't have 8 data bytes

This commit is contained in:
Collin Kidder
2019-02-24 16:57:18 -05:00
parent 72e1b72094
commit 1177e81bec
+7 -2
View File
@@ -444,7 +444,8 @@ void FlowViewWindow::updatedFrames(int numFrames)
{ {
for (int k = 0; k < 8; k++) for (int k = 0; k < 8; k++)
{ {
graphRef[k]->addData(newX[k], newY[k]); if (graphRef[k] && graphRef[k]->data())
graphRef[k]->addData(newX[k], newY[k]);
} }
ui->graphView->replot(); ui->graphView->replot();
updateDataView(); updateDataView();
@@ -465,6 +466,8 @@ void FlowViewWindow::createGraph(int byteNum)
int tempVal; int tempVal;
float minval=1000000, maxval = -100000; float minval=1000000, maxval = -100000;
qDebug() << "Create Graph " << byteNum;
bool graphByTime = ui->cbTimeGraph->isChecked(); bool graphByTime = ui->cbTimeGraph->isChecked();
int numEntries = frameCache.count(); int numEntries = frameCache.count();
@@ -533,6 +536,7 @@ void FlowViewWindow::updateFrameLabel()
void FlowViewWindow::changeID(QString newID) void FlowViewWindow::changeID(QString newID)
{ {
qDebug() << "change id " << newID;
//parse the ID and then load up the frame cache with just messages with that ID. //parse the ID and then load up the frame cache with just messages with that ID.
uint32_t id = (uint32_t)Utility::ParseStringToNum(newID); uint32_t id = (uint32_t)Utility::ParseStringToNum(newID);
frameCache.clear(); frameCache.clear();
@@ -555,7 +559,8 @@ void FlowViewWindow::changeID(QString newID)
if (frameCache.count() == 0) return; if (frameCache.count() == 0) return;
removeAllGraphs(); removeAllGraphs();
for (uint32_t c = 0; c < frameCache.at(0).len; c++) //for (uint32_t c = 0; c < frameCache.at(0).len; c++)
for (uint32_t c = 0; c < 8; c++)
{ {
createGraph(c); createGraph(c);
} }