diff --git a/ground/openpilotgcs/src/plugins/scope/plotdata.h b/ground/openpilotgcs/src/plugins/scope/plotdata.h index a547f2b91..76112baf1 100644 --- a/ground/openpilotgcs/src/plugins/scope/plotdata.h +++ b/ground/openpilotgcs/src/plugins/scope/plotdata.h @@ -29,11 +29,6 @@ #define PLOTDATA_H #include "uavobject.h" -#include "baroaltitude.h" -#include "positionactual.h" -#include "attituderaw.h" -#include "manualcontrolcommand.h" - #include "qwt/src/qwt.h" #include "qwt/src/qwt_plot.h" diff --git a/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.cpp b/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.cpp index 12f6974b8..729ced8d3 100644 --- a/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.cpp @@ -54,15 +54,10 @@ using namespace Core; -TestDataGen* ScopeGadgetWidget::testDataGen; - // ****************************************************************** ScopeGadgetWidget::ScopeGadgetWidget(QWidget *parent) : QwtPlot(parent) { - //if(testDataGen == 0) - // testDataGen = new TestDataGen(); - setMouseTracking(true); // canvas()->setMouseTracking(true); @@ -532,68 +527,6 @@ void ScopeGadgetWidget::clearCurvePlots() } -TestDataGen::TestDataGen() -{ - // Get required UAVObjects - ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance(); - UAVObjectManager* objManager = pm->getObject(); - - baroAltitude = BaroAltitude::GetInstance(objManager); - gps = PositionActual::GetInstance(objManager); - attRaw = AttitudeRaw::GetInstance(objManager); - manCtrlCmd = ManualControlCommand::GetInstance(objManager); - - //Setup timer - periodMs = 20; - timer = new QTimer(this); - connect(timer, SIGNAL(timeout()), this, SLOT(genTestData())); - timer->start(periodMs); - - debugCounter = 0; - testTime = 0; -} - -void TestDataGen::genTestData() -{ - // Update BaroAltitude object - BaroAltitude::DataFields baroAltitudeData; - baroAltitudeData.Altitude = 500 * sin(1 * testTime) + 200 * cos(4 * testTime) + 800; - baroAltitudeData.Temperature = 30 * sin(0.5 * testTime); - baroAltitudeData.Pressure = baroAltitudeData.Altitude * 0.01 + baroAltitudeData.Temperature; - baroAltitude->setData(baroAltitudeData); - - // Update Attitude Raw data - AttitudeRaw::DataFields attData; -// attData.accels[0] = 4 * sin(2 * testTime) + 1 * cos(6 * testTime) + 4; -// attData.accels[1] = 3 * sin(2.3 * testTime) + 1.5 * cos(3.3 * testTime) + 2; -// attData.accels[2] = 4 * sin(5.3 * testTime) + 1.5 * cos(1.3 * testTime) + 1; - attData.accels[0] = 1; - attData.accels[1] = 4; - attData.accels[2] = 9; - attRaw->setData(attData); - - - ManualControlCommand::DataFields manCtlData; - manCtlData.Channel[0] = 400 * cos(2 * testTime) + 100 * sin(6 * testTime) + 400; - manCtlData.Channel[1] = 350 * cos(2.3 * testTime) + 150 * sin(3.3 * testTime) + 200; - manCtlData.Channel[2] = 450 * cos(5.3 * testTime) + 150 * sin(1.3 * testTime) + 150; - manCtrlCmd->setData(manCtlData); - - testTime += (periodMs / 1000.0); - -// debugCounter++; -// if (debugCounter % (100/periodMs) == 0 ) -// qDebug() << "Test Time = " << testTime; -} - -TestDataGen::~TestDataGen() -{ - if (timer) - timer->stop(); - - delete timer; -} - /* int csvLoggingEnable; int csvLoggingHeaderSaved; diff --git a/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.h b/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.h index 98da3beb6..4dd3f42ee 100644 --- a/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/scope/scopegadgetwidget.h @@ -62,35 +62,6 @@ private: // double baseTime; }; -/*! - \brief This class is used to inject UAVTalk messages for testing. - */ -class TestDataGen : QObject -{ - Q_OBJECT - -public: - - TestDataGen(); - ~TestDataGen(); - -private: - BaroAltitude* baroAltitude; - PositionActual* gps; - AttitudeRaw* attRaw; - ManualControlCommand* manCtrlCmd; - - QTimer *timer; - double testTime; - int periodMs; - - int debugCounter; - -private slots: - void genTestData(); -}; - - class ScopeGadgetWidget : public QwtPlot { Q_OBJECT @@ -148,8 +119,6 @@ private: QList m_connectedUAVObjects; QMap m_curvesData; - static TestDataGen* testDataGen; - QTimer *replotTimer; bool m_csvLoggingStarted;