From da1a7153ddcfc344538f104d1bc456fb5bcd549f Mon Sep 17 00:00:00 2001 From: Bryan Godbolt Date: Wed, 6 Oct 2010 09:02:09 -0600 Subject: [PATCH] working on plots for loading rc data --- src/ui/RadioCalibration/CurveCalibrator.cc | 12 ++++++++---- src/ui/RadioCalibration/CurveCalibrator.h | 2 ++ src/ui/RadioCalibration/RadioCalibrationWindow.cc | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ui/RadioCalibration/CurveCalibrator.cc b/src/ui/RadioCalibration/CurveCalibrator.cc index dfaf279977..7338c80de3 100644 --- a/src/ui/RadioCalibration/CurveCalibrator.cc +++ b/src/ui/RadioCalibration/CurveCalibrator.cc @@ -92,12 +92,16 @@ void CurveCalibrator::set(const QVector &data) { if (data.size() == 5) { - delete setpoints; - QVector dataDouble; +// delete setpoints; +// QVector dataDouble; for (int i=0; i(data[i]); - setpoints = new QVector(dataDouble); + setpoints->replace(i, static_cast(data[i])); +// setpoints = new QVector(dataDouble); + curve->setPen(QPen(QColor(QString("lime")))); curve->setData(*positions, *setpoints); + + + curve->attach(plot); plot->replot(); } else diff --git a/src/ui/RadioCalibration/CurveCalibrator.h b/src/ui/RadioCalibration/CurveCalibrator.h index 6fd3e454d4..8e0aeb3835 100644 --- a/src/ui/RadioCalibration/CurveCalibrator.h +++ b/src/ui/RadioCalibration/CurveCalibrator.h @@ -5,6 +5,7 @@ #include #include #include +//#include #include #include #include @@ -34,6 +35,7 @@ protected slots: protected: QVector *setpoints; QVector *positions; +// QwtArrayData QwtPlot *plot; QwtPlotCurve *curve; diff --git a/src/ui/RadioCalibration/RadioCalibrationWindow.cc b/src/ui/RadioCalibration/RadioCalibrationWindow.cc index 5114ff4ed2..a1bcfc59ef 100644 --- a/src/ui/RadioCalibration/RadioCalibrationWindow.cc +++ b/src/ui/RadioCalibration/RadioCalibrationWindow.cc @@ -149,7 +149,7 @@ void RadioCalibrationWindow::parseSetpoint(const QDomElement &setpoint, const QP foreach (QString setpoint, setpointList) 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 (setpoints.isEmpty()) -- GitLab