Fixed graphing window to properly graph things that are signed

but don't exist on clean byte boundaries, updated version num.
This commit is contained in:
Collin Kidder
2015-07-19 22:00:51 -04:00
parent 90b0c6ae06
commit 39c49d8002
2 changed files with 9 additions and 5 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef CONFIG #ifndef CONFIG
#define CONFIG #define CONFIG
#define VERSION 124 #define VERSION 125
//try to keep this in sync. //try to keep this in sync.
//SavvyCAN will complain if you connect a GVRET board with a revision //SavvyCAN will complain if you connect a GVRET board with a revision
+8 -4
View File
@@ -554,9 +554,11 @@ void GraphingWindow::createGraph(GraphParams &params, bool createGraphParam)
tempValInt &= params.mask; tempValInt &= params.mask;
if (params.isSigned && tempValInt > ((shiftRef / 2) - 1)) long long twocompPoint = params.mask;
if (shiftRef < twocompPoint) twocompPoint = shiftRef;
if (params.isSigned && tempValInt > ((twocompPoint / 2) - 1))
{ {
tempValInt = tempValInt - shiftRef; tempValInt = tempValInt - twocompPoint;
} }
tempValue = (float)tempValInt; tempValue = (float)tempValInt;
@@ -600,9 +602,11 @@ void GraphingWindow::createGraph(GraphParams &params, bool createGraphParam)
} }
tempValInt &= params.mask; tempValInt &= params.mask;
if (params.isSigned && tempValInt > ((shiftRef / 2) - 1)) long long twocompPoint = params.mask;
if (shiftRef < twocompPoint) twocompPoint = shiftRef;
if (params.isSigned && tempValInt > ((twocompPoint / 2) - 1))
{ {
tempValInt = tempValInt - shiftRef; tempValInt = tempValInt - twocompPoint;
} }
tempValue = (float)tempValInt; tempValue = (float)tempValInt;