Commit da1a7153 authored by Bryan Godbolt's avatar Bryan Godbolt

working on plots for loading rc data

parent 4b2b6c1e
...@@ -92,12 +92,16 @@ void CurveCalibrator::set(const QVector<float> &data) ...@@ -92,12 +92,16 @@ void CurveCalibrator::set(const QVector<float> &data)
{ {
if (data.size() == 5) if (data.size() == 5)
{ {
delete setpoints; // delete setpoints;
QVector<double> dataDouble; // QVector<double> dataDouble;
for (int i=0; i<data.size(); ++i) for (int i=0; i<data.size(); ++i)
dataDouble << static_cast<double>(data[i]); setpoints->replace(i, static_cast<double>(data[i]));
setpoints = new QVector<double>(dataDouble); // setpoints = new QVector<double>(dataDouble);
curve->setPen(QPen(QColor(QString("lime"))));
curve->setData(*positions, *setpoints); curve->setData(*positions, *setpoints);
curve->attach(plot);
plot->replot(); plot->replot();
} }
else else
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <QVector> #include <QVector>
#include <qwt_plot.h> #include <qwt_plot.h>
#include <qwt_plot_curve.h> #include <qwt_plot_curve.h>
//#include <qwt_array.h>
#include <QGridLayout> #include <QGridLayout>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QLabel> #include <QLabel>
...@@ -34,6 +35,7 @@ protected slots: ...@@ -34,6 +35,7 @@ protected slots:
protected: protected:
QVector<double> *setpoints; QVector<double> *setpoints;
QVector<double> *positions; QVector<double> *positions;
// QwtArrayData
QwtPlot *plot; QwtPlot *plot;
QwtPlotCurve *curve; QwtPlotCurve *curve;
......
...@@ -149,7 +149,7 @@ void RadioCalibrationWindow::parseSetpoint(const QDomElement &setpoint, const QP ...@@ -149,7 +149,7 @@ void RadioCalibrationWindow::parseSetpoint(const QDomElement &setpoint, const QP
foreach (QString setpoint, setpointList) foreach (QString setpoint, setpointList)
setpoints << setpoint.trimmed().toFloat(); setpoints << setpoint.trimmed().toFloat();
qDebug() << __FILE__ << __LINE__ << ": " << setpoint.tagName() << ": " << setpoint.attribute("name") ; // qDebug() << __FILE__ << __LINE__ << ": " << setpoint.tagName() << ": " << setpoint.attribute("name") ;
if (setpoint.tagName() == "threeSetpoint") if (setpoint.tagName() == "threeSetpoint")
{ {
if (setpoints.isEmpty()) if (setpoints.isEmpty())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment