2 ******************************************************************************
4 * @file GCSControlgadgetwidget.cpp
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup GCSControlGadgetPlugin GCSControl Gadget Plugin
10 * @brief A gadget to control the UAV, either from the keyboard or a joystick
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include "logginggadgetwidget.h"
28 #include "ui_logging.h"
31 #include <QStringList>
34 #include <QVBoxLayout>
35 #include <QPushButton>
36 #include <loggingplugin.h>
38 LoggingGadgetWidget::LoggingGadgetWidget(QWidget
*parent
) : QLabel(parent
)
40 m_logging
= new Ui_Logging();
41 m_logging
->setupUi(this);
43 ExtensionSystem::PluginManager
*pm
= ExtensionSystem::PluginManager::instance();
44 scpPlugin
= pm
->getObject
<ScopeGadgetFactory
>();
47 LoggingGadgetWidget::~LoggingGadgetWidget()
52 void LoggingGadgetWidget::setPlugin(LoggingPlugin
*p
)
55 connect(p
, SIGNAL(stateChanged(QString
)), this, SLOT(stateChanged(QString
)));
56 connect(m_logging
->playButton
, SIGNAL(clicked()), p
->getLogfile(), SLOT(resumeReplay()));
57 connect(m_logging
->playButton
, SIGNAL(clicked()), scpPlugin
, SLOT(startPlotting()));
58 connect(m_logging
->pauseButton
, SIGNAL(clicked()), p
->getLogfile(), SLOT(pauseReplay()));
59 connect(m_logging
->pauseButton
, SIGNAL(clicked()), scpPlugin
, SLOT(stopPlotting()));
60 connect(m_logging
->playbackSpeed
, SIGNAL(valueChanged(double)), p
->getLogfile(), SLOT(setReplaySpeed(double)));
66 void LoggingGadgetWidget::stateChanged(QString status
)
68 m_logging
->statusLabel
->setText(status
);