From 1177e81becba680f2dcf31f62601aec1520ddf57 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Sun, 24 Feb 2019 16:57:18 -0500 Subject: [PATCH] Fix for crash in Flow View when a frame doesn't have 8 data bytes --- re/flowviewwindow.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/re/flowviewwindow.cpp b/re/flowviewwindow.cpp index 0587b7c..f2e3184 100644 --- a/re/flowviewwindow.cpp +++ b/re/flowviewwindow.cpp @@ -444,7 +444,8 @@ void FlowViewWindow::updatedFrames(int numFrames) { 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(); updateDataView(); @@ -465,6 +466,8 @@ void FlowViewWindow::createGraph(int byteNum) int tempVal; float minval=1000000, maxval = -100000; + qDebug() << "Create Graph " << byteNum; + bool graphByTime = ui->cbTimeGraph->isChecked(); int numEntries = frameCache.count(); @@ -533,6 +536,7 @@ void FlowViewWindow::updateFrameLabel() 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. uint32_t id = (uint32_t)Utility::ParseStringToNum(newID); frameCache.clear(); @@ -555,7 +559,8 @@ void FlowViewWindow::changeID(QString newID) if (frameCache.count() == 0) return; 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); }