From b762de75bd059819cab14588804c53886130923d Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Sat, 18 Jul 2015 18:11:00 -0400 Subject: [PATCH] Small bug fixes (updated version # too) --- config.h | 2 +- frameinfowindow.cpp | 2 ++ graphingwindow.cpp | 14 +++++++------- newgraphdialog.cpp | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/config.h b/config.h index 82fb440..e4a193d 100644 --- a/config.h +++ b/config.h @@ -1,7 +1,7 @@ #ifndef CONFIG #define CONFIG -#define VERSION 123 +#define VERSION 124 //try to keep this in sync. //SavvyCAN will complain if you connect a GVRET board with a revision diff --git a/frameinfowindow.cpp b/frameinfowindow.cpp index 62389d6..4f46225 100644 --- a/frameinfowindow.cpp +++ b/frameinfowindow.cpp @@ -134,6 +134,8 @@ void FrameInfoWindow::updateDetailsWindow(QString newID) ui->treeDetails->clear(); + if (frameCache.count() == 0) return; + baseNode = new QTreeWidgetItem(); baseNode->setText(0, QString("ID: 0x") + newID ); diff --git a/graphingwindow.cpp b/graphingwindow.cpp index 6ec190f..25868af 100644 --- a/graphingwindow.cpp +++ b/graphingwindow.cpp @@ -483,7 +483,7 @@ void GraphingWindow::addNewGraph() void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) { - int tempVal; + long long tempVal; //64 bit temp value. float yminval=10000000.0, ymaxval = -1000000.0; float xminval=10000000000.0, xmaxval = -10000000000.0; @@ -531,15 +531,15 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) else if (params.endByte > params.startByte) //big endian { float tempValue; - int tempValInt; + long long tempValInt; int numBytes = (params.endByte - params.startByte) + 1; - int shiftRef = 1 << (numBytes * 8); + long long shiftRef = 1 << (numBytes * 8); uint64_t maskShifter; uint8_t tempByte; for (int j = 0; j < numEntries; j++) { tempValInt = 0; - int expon = 1; + long long expon = 1; maskShifter = params.mask; for (int c = 0; c < numBytes; c++) { @@ -578,15 +578,15 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) else //little endian { float tempValue; - int tempValInt; + long long tempValInt; int numBytes = (params.startByte - params.endByte) + 1; - int shiftRef = 1 << (numBytes * 8); + long long shiftRef = 1 << (numBytes * 8); uint64_t maskShifter; uint8_t tempByte; for (int j = 0; j < numEntries; j++) { tempValInt = 0; - int expon = 1; + long long expon = 1; maskShifter = params.mask; for (int c = 0; c < numBytes; c++) { diff --git a/newgraphdialog.cpp b/newgraphdialog.cpp index b749f4d..b8c6c7c 100644 --- a/newgraphdialog.cpp +++ b/newgraphdialog.cpp @@ -89,7 +89,7 @@ void NewGraphDialog::getParams(GraphParams ¶ms) //now catch stupidity and bring it to defaults if (params.mask == 0) params.mask = 0xFFFFFFFF; - if (fabs(params.scale) < 0.0001f) params.scale = 1.0f; + if (fabs(params.scale) < 0.00000001) params.scale = 1.0f; if (params.stride < 1) params.stride = 1; }