From cc276dfb4f42576d10407bb25c7496648e55ee7c Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Mon, 25 May 2015 20:15:20 -0400 Subject: [PATCH] CANDataGrid had the bits reversed. Whoops... This has been fixed. Added a + in the center of the flow view graph to show that the current data is actually there in the center not at the right edge like you might assume. Incremented version number. --- candatagrid.cpp | 4 +-- flowviewwindow.cpp | 16 +++++++++--- flowviewwindow.ui | 63 ++++++++++++++++++++++++++++++++++++++++++++++ mainwindow.h | 2 +- 4 files changed, 78 insertions(+), 7 deletions(-) diff --git a/candatagrid.cpp b/candatagrid.cpp index 8091452..7685597 100644 --- a/candatagrid.cpp +++ b/candatagrid.cpp @@ -82,8 +82,8 @@ void CANDataGrid::paintEvent(QPaintEvent *event) { thisBit = false; prevBit = false; - if ((thisByte & (1 << x)) == (1 << x)) thisBit = true; - if ((prevByte & (1 << x)) == (1 << x)) prevBit = true; + if ((thisByte & (1 << (7-x))) == (1 << (7-x))) thisBit = true; + if ((prevByte & (1 << (7-x))) == (1 << (7-x))) prevBit = true; if (thisBit) { diff --git a/flowviewwindow.cpp b/flowviewwindow.cpp index 1866564..2326110 100644 --- a/flowviewwindow.cpp +++ b/flowviewwindow.cpp @@ -1,8 +1,8 @@ #include "flowviewwindow.h" #include "ui_flowviewwindow.h" -const QColor FlowViewWindow::graphColors[8] = {Qt::blue, Qt::green, Qt::black, Qt::red, - Qt::gray, Qt::yellow, Qt::cyan, Qt::darkMagenta}; +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 FlowViewWindow::FlowViewWindow(QVector *frames, QWidget *parent) : @@ -25,12 +25,20 @@ FlowViewWindow::FlowViewWindow(QVector *frames, QWidget *parent) : //ui->graphView->setInteractions(); ui->graphView->xAxis->setRange(0, 8); - ui->graphView->yAxis->setRange(0, 255); + ui->graphView->yAxis->setRange(-10, 265); //run range a bit outside possible number so they aren't plotted in a hard to see place ui->graphView->axisRect()->setupFullAxesBox(); + QCPItemText *textLabel = new QCPItemText(ui->graphView); + ui->graphView->addItem(textLabel); + textLabel->setPositionAlignment(Qt::AlignTop|Qt::AlignHCenter); + textLabel->position->setType(QCPItemPosition::ptAxisRectRatio); + textLabel->position->setCoords(0.5, .5); + textLabel->setText("+"); + textLabel->setFont(QFont(font().family(), 16)); // make font a bit larger + textLabel->setPen(QPen(Qt::black)); // show black border around text + ui->graphView->xAxis->setLabel("Time Axis"); ui->graphView->yAxis->setLabel("Value Axis"); - //ui->graphView->legend->setVisible(true); QFont legendFont = font(); legendFont.setPointSize(10); QFont legendSelectedFont = font(); diff --git a/flowviewwindow.ui b/flowviewwindow.ui index 1d04761..9927a22 100644 --- a/flowviewwindow.ui +++ b/flowviewwindow.ui @@ -782,6 +782,69 @@ + + + + Data Byte Colors: + + + + + + + 0 = Blue + + + + + + + 1 = Green + + + + + + + 2 = Black + + + + + + + 3 = Red + + + + + + + 4 = Gray + + + + + + + 5 = Yellow + + + + + + + 6 = Cyan + + + + + + + 7 = Dark Magenta + + + diff --git a/mainwindow.h b/mainwindow.h index 8541939..872018b 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -13,7 +13,7 @@ #include "framesenderwindow.h" #include "dbchandler.h" -#define VERSION 103 +#define VERSION 104 namespace Ui { class MainWindow;