From 29c0798cd565774c45d24e50dd76b0284c555309 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Fri, 25 Aug 2017 12:53:10 -0400 Subject: [PATCH 1/2] Fix compiling on Windows --- SavvyCAN.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SavvyCAN.pro b/SavvyCAN.pro index 7c5d04b..7f1d15e 100644 --- a/SavvyCAN.pro +++ b/SavvyCAN.pro @@ -151,3 +151,6 @@ RESOURCES += \ icons.qrc \ images.qrc +win32 { + LIBS += opengl32.lib +} From f6119acc99268cb90a2c06e9e9c250bc9d896123 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Fri, 25 Aug 2017 12:53:59 -0400 Subject: [PATCH 2/2] Fix an issue with selecting graphs via the legend in the upper corner. --- re/graphingwindow.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/re/graphingwindow.cpp b/re/graphingwindow.cpp index 8dbfdcd..87b246d 100644 --- a/re/graphingwindow.cpp +++ b/re/graphingwindow.cpp @@ -172,6 +172,7 @@ void GraphingWindow::updatedFrames(int numFrames) void GraphingWindow::plottableDoubleClick(QCPAbstractPlottable* plottable, int dataIdx, QMouseEvent* event) { Q_UNUSED(dataIdx); + qDebug() << "plottableDoubleClick"; int id = 0; //apply transforms to get the X axis value where we double clicked double coord = plottable->keyAxis()->pixelToCoord(event->localPos().x()); @@ -218,6 +219,7 @@ void GraphingWindow::titleDoubleClick(QMouseEvent* event, QCPTextElement* title) void GraphingWindow::axisLabelDoubleClick(QCPAxis *axis, QCPAxis::SelectablePart part) { + qDebug() << "axisLabelDoubleClick"; // Set an axis label by double clicking on it if (part == QCPAxis::spAxisLabel) // only react when the actual axis label is clicked, not tick label or axis backbone { @@ -283,6 +285,8 @@ void GraphingWindow::selectionChanged() or on its legend item. */ + qDebug() << "SelectionChanged"; + // make top and bottom axes be selected synchronously, and handle axis and tick labels as one selectable object: if (ui->graphingView->xAxis->selectedParts().testFlag(QCPAxis::spAxis) || ui->graphingView->xAxis->selectedParts().testFlag(QCPAxis::spTickLabels) || ui->graphingView->xAxis2->selectedParts().testFlag(QCPAxis::spAxis) || ui->graphingView->xAxis2->selectedParts().testFlag(QCPAxis::spTickLabels)) @@ -306,7 +310,13 @@ void GraphingWindow::selectionChanged() if (item->selected() || graph->selected()) { item->setSelected(true); - //graph->setSelected(true); + //select graph too. + QCPDataSelection sel; + QCPDataRange rang; + rang.setBegin(0); + rang.setEnd(graph->dataCount()); + sel.addDataRange(rang); + graph->setSelection(sel); } } } @@ -1020,6 +1030,14 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) if (params.x[j] > xmaxval) xmaxval = params.x[j]; } + if (numEntries == 0) + { + yminval = -128.0; + ymaxval = 128.0; + xminval = 0; + xmaxval = 100; + } + params.xbias = 0; ui->graphingView->addGraph(); @@ -1068,6 +1086,7 @@ void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) void GraphingWindow::moveLegend() { + qDebug() << "moveLegend"; if (QAction* contextAction = qobject_cast(sender())) // make sure this slot is really called by a context menu action, so it carries the data we need { bool ok;