1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Guess what? More Doxygen...

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1116 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
dankers 2010-07-16 16:01:53 +00:00 committed by dankers
parent f5c24d169e
commit c648488e75
105 changed files with 2640 additions and 2586 deletions

View File

@ -3,11 +3,11 @@
* *
* @file pfdgadget.cpp * @file pfdgadget.cpp
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdgadget.h * @file pfdgadget.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdgadgetconfiguration.cpp * @file pfdgadgetconfiguration.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Primary Flight Display Plugin Gadget configuration * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdgadgetconfiguration.h * @file pfdgadgetconfiguration.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief Primary Flight Display Plugin Gadget configuration * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdgadgetfactory.cpp * @file pfdgadgetfactory.cpp
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdgadgetfactory.h * @file pfdgadgetfactory.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdgadgetoptionspage.cpp * @file pfdgadgetoptionspage.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Primary Flight Display Plugin Gadget options page * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdgadgetoptionspage.h * @file pfdgadgetoptionspage.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Primary Flight Display Plugin Gadget options page * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdgadgetwidget.cpp * @file pfdgadgetwidget.cpp
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdgadgetwidget.h * @file pfdgadgetwidget.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdplugin.h * @file pfdplugin.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file pfdplugin.h * @file pfdplugin.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup pfdplugin
* @{ * @{
* * @addtogroup OPMapPlugin Primary Flight Display Plugin
* @{
* @brief The Primary Flight Display Gadget
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,3 +1,30 @@
/**
******************************************************************************
*
* @file pjrc_rawhid.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup RawHIDPlugin Raw HID Plugin
* @{
* @brief Impliments a HID USB connection to the flight hardware as a QIODevice
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef PJRC_RAWHID_H #ifndef PJRC_RAWHID_H
#define PJRC_RAWHID_H #define PJRC_RAWHID_H

View File

@ -1,3 +1,11 @@
/* @file pjrc_rawhid_mac.cpp
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup RawHIDPlugin Raw HID Plugin
* @{
* @brief Impliments a HID USB connection to the flight hardware as a QIODevice
*****************************************************************************/
/* Simple Raw HID functions for Linux - for use with Teensy RawHID example /* Simple Raw HID functions for Linux - for use with Teensy RawHID example
* http://www.pjrc.com/teensy/rawhid.html * http://www.pjrc.com/teensy/rawhid.html
* Copyright (c) 2009 PJRC.COM, LLC * Copyright (c) 2009 PJRC.COM, LLC
@ -28,6 +36,8 @@
* Version 1.0: Initial Release * Version 1.0: Initial Release
*/ */
#include "pjrc_rawhid.h" #include "pjrc_rawhid.h"
#include <unistd.h> #include <unistd.h>

View File

@ -1,3 +1,11 @@
/* @file pjrc_rawhid_unix.cpp
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup RawHIDPlugin Raw HID Plugin
* @{
* @brief Impliments a HID USB connection to the flight hardware as a QIODevice
*****************************************************************************/
/* Simple Raw HID functions for Linux - for use with Teensy RawHID example /* Simple Raw HID functions for Linux - for use with Teensy RawHID example
* http://www.pjrc.com/teensy/rawhid.html * http://www.pjrc.com/teensy/rawhid.html
* Copyright (c) 2009 PJRC.COM, LLC * Copyright (c) 2009 PJRC.COM, LLC

View File

@ -1,3 +1,11 @@
/* @file pjrc_rawhid_windows.cpp
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup RawHIDPlugin Raw HID Plugin
* @{
* @brief Impliments a HID USB connection to the flight hardware as a QIODevice
*****************************************************************************/
/* Simple Raw HID functions for Windows - for use with Teensy RawHID example /* Simple Raw HID functions for Windows - for use with Teensy RawHID example
* http://www.pjrc.com/teensy/rawhid.html * http://www.pjrc.com/teensy/rawhid.html
* Copyright (c) 2009 PJRC.COM, LLC * Copyright (c) 2009 PJRC.COM, LLC

View File

@ -3,11 +3,11 @@
* *
* @file rawhid.cpp * @file rawhid.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief QIODevice interface for USB RawHID * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup rawhidplugin
* @{ * @{
* * @addtogroup RawHIDPlugin Raw HID Plugin
* @{
* @brief Impliments a HID USB connection to the flight hardware as a QIODevice
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file rawhid.h * @file rawhid.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup rawhidplugin
* @{ * @{
* * @addtogroup RawHIDPlugin Raw HID Plugin
* @{
* @brief Impliments a HID USB connection to the flight hardware as a QIODevice
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file rawhid_const.h * @file rawhid_const.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup rawhidplugin
* @{ * @{
* * @addtogroup RawHIDPlugin Raw HID Plugin
* @{
* @brief Impliments a HID USB connection to the flight hardware as a QIODevice
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,13 +3,13 @@
* *
* @file rawhid_global.h * @file rawhid_global.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup rawhidplugin
* @{ * @{
* * @addtogroup RawHIDPlugin Raw HID Plugin
* @{
* @brief Impliments a HID USB connection to the flight hardware as a QIODevice
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file rawhidplugin.cpp * @file rawhidplugin.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Register connection object for the core connection manager * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup rawhidplugin
* @{ * @{
* * @addtogroup RawHIDPlugin Raw HID Plugin
* @{
* @brief Impliments a HID USB connection to the flight hardware as a QIODevice
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file rawhid.h * @file rawhid.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup rawhidplugin
* @{ * @{
* * @addtogroup RawHIDPlugin Raw HID Plugin
* @{
* @brief Impliments a HID USB connection to the flight hardware as a QIODevice
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -1,133 +1,133 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file plotdata.cpp * @file plotdata.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Implementation of plotdata. * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup scopeplugin * @addtogroup ScopePlugin Scope Gadget Plugin
* @{ * @{
* * @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "plotdata.h" #include "plotdata.h"
#include <math.h> #include <math.h>
PlotData::PlotData(QString p_uavObject, QString p_uavField) PlotData::PlotData(QString p_uavObject, QString p_uavField)
{ {
uavObject = p_uavObject; uavObject = p_uavObject;
uavField = p_uavField; uavField = p_uavField;
xData = new QVector<double>(); xData = new QVector<double>();
yData = new QVector<double>(); yData = new QVector<double>();
curve = 0; curve = 0;
scalePower = 0; scalePower = 0;
yMinimum = 0; yMinimum = 0;
yMaximum = 0; yMaximum = 0;
m_xWindowSize = 0; m_xWindowSize = 0;
} }
PlotData::~PlotData() PlotData::~PlotData()
{ {
delete xData; delete xData;
delete yData; delete yData;
} }
bool SequencialPlotData::append(UAVObject* obj) bool SequencialPlotData::append(UAVObject* obj)
{ {
if (uavObject == obj->getName()) { if (uavObject == obj->getName()) {
//Get the field of interest //Get the field of interest
UAVObjectField* field = obj->getField(uavField); UAVObjectField* field = obj->getField(uavField);
if (field) { if (field) {
//Shift data forward and put the new value at the front //Shift data forward and put the new value at the front
yData->append(field->getDouble() * pow(10, scalePower)); yData->append(field->getDouble() * pow(10, scalePower));
if (yData->size() > m_xWindowSize) { if (yData->size() > m_xWindowSize) {
yData->pop_front(); yData->pop_front();
} else } else
xData->insert(xData->size(), xData->size()); xData->insert(xData->size(), xData->size());
//notify the gui of changes in the data //notify the gui of changes in the data
dataChanged(); dataChanged();
return true; return true;
} }
} }
return false; return false;
} }
bool ChronoPlotData::append(UAVObject* obj) bool ChronoPlotData::append(UAVObject* obj)
{ {
if (uavObject == obj->getName()) { if (uavObject == obj->getName()) {
//Get the field of interest //Get the field of interest
UAVObjectField* field = obj->getField(uavField); UAVObjectField* field = obj->getField(uavField);
if (field) { if (field) {
//Put the new value at the front //Put the new value at the front
QDateTime NOW = QDateTime::currentDateTime(); QDateTime NOW = QDateTime::currentDateTime();
double newestValue = NOW.toTime_t() + NOW.time().msec() / 1000.0; double newestValue = NOW.toTime_t() + NOW.time().msec() / 1000.0;
xData->append(newestValue); xData->append(newestValue);
yData->append(field->getDouble() * pow(10, scalePower)); yData->append(field->getDouble() * pow(10, scalePower));
//Remove stale data //Remove stale data
removeStaleData(); removeStaleData();
//notify the gui of chages in the data //notify the gui of chages in the data
dataChanged(); dataChanged();
return true; return true;
} }
} }
return false; return false;
} }
void ChronoPlotData::removeStaleData() void ChronoPlotData::removeStaleData()
{ {
double newestValue; double newestValue;
double oldestValue; double oldestValue;
while (1) { while (1) {
if (xData->size() == 0) if (xData->size() == 0)
break; break;
newestValue = xData->last(); newestValue = xData->last();
oldestValue = xData->first(); oldestValue = xData->first();
if (newestValue - oldestValue > m_xWindowSize) { if (newestValue - oldestValue > m_xWindowSize) {
yData->pop_front(); yData->pop_front();
xData->pop_front(); xData->pop_front();
} else } else
break; break;
} }
} }
void ChronoPlotData::removeStaleDataTimeout() void ChronoPlotData::removeStaleDataTimeout()
{ {
removeStaleData(); removeStaleData();
dataChanged(); dataChanged();
} }
bool UAVObjectPlotData::append(UAVObject* obj) bool UAVObjectPlotData::append(UAVObject* obj)
{ {
return false; return false;
} }

View File

@ -1,162 +1,162 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file plotdata.h * @file plotdata.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Object that manages the data for a curve. * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup scopeplugin * @addtogroup ScopePlugin Scope Gadget Plugin
* @{ * @{
* * @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef PLOTDATA_H #ifndef PLOTDATA_H
#define PLOTDATA_H #define PLOTDATA_H
#include "uavobjects/uavobject.h" #include "uavobjects/uavobject.h"
#include "uavobjects/altitudeactual.h" #include "uavobjects/altitudeactual.h"
#include "uavobjects/positionactual.h" #include "uavobjects/positionactual.h"
#include "qwt/src/qwt.h" #include "qwt/src/qwt.h"
#include "qwt/src/qwt_plot.h" #include "qwt/src/qwt_plot.h"
#include "qwt/src/qwt_plot_curve.h" #include "qwt/src/qwt_plot_curve.h"
#include "qwt/src/qwt_scale_draw.h" #include "qwt/src/qwt_scale_draw.h"
#include "qwt/src/qwt_scale_widget.h" #include "qwt/src/qwt_scale_widget.h"
#include <QTimer> #include <QTimer>
#include <QTime> #include <QTime>
#include <QVector> #include <QVector>
/*! /*!
\brief Defines the different type of plots. \brief Defines the different type of plots.
*/ */
enum PlotType { enum PlotType {
SequencialPlot, SequencialPlot,
ChronoPlot, ChronoPlot,
UAVObjectPlot, UAVObjectPlot,
NPlotTypes NPlotTypes
}; };
/*! /*!
\brief Base class that keeps the data for each curve in the plot. \brief Base class that keeps the data for each curve in the plot.
*/ */
class PlotData : public QObject class PlotData : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
PlotData(QString uavObject, QString uavField); PlotData(QString uavObject, QString uavField);
~PlotData(); ~PlotData();
QString uavObject; QString uavObject;
QString uavField; QString uavField;
int scalePower; //This is the power to which each value must be raised int scalePower; //This is the power to which each value must be raised
double yMinimum; double yMinimum;
double yMaximum; double yMaximum;
double m_xWindowSize; double m_xWindowSize;
QwtPlotCurve* curve; QwtPlotCurve* curve;
QVector<double>* xData; QVector<double>* xData;
QVector<double>* yData; QVector<double>* yData;
virtual bool append(UAVObject* obj) = 0; virtual bool append(UAVObject* obj) = 0;
virtual PlotType plotType() = 0; virtual PlotType plotType() = 0;
signals: signals:
void dataChanged(); void dataChanged();
}; };
/*! /*!
\brief The sequencial plot have a fixed size buffer of data. All the curves in one plot \brief The sequencial plot have a fixed size buffer of data. All the curves in one plot
have the same size buffer. have the same size buffer.
*/ */
class SequencialPlotData : public PlotData class SequencialPlotData : public PlotData
{ {
Q_OBJECT Q_OBJECT
public: public:
SequencialPlotData(QString uavObject, QString uavField) SequencialPlotData(QString uavObject, QString uavField)
: PlotData(uavObject, uavField) {} : PlotData(uavObject, uavField) {}
~SequencialPlotData() {} ~SequencialPlotData() {}
/*! /*!
\brief Append new data to the plot \brief Append new data to the plot
*/ */
bool append(UAVObject* obj); bool append(UAVObject* obj);
/*! /*!
\brief The type of plot \brief The type of plot
*/ */
virtual PlotType plotType() { virtual PlotType plotType() {
return SequencialPlot; return SequencialPlot;
} }
}; };
/*! /*!
\brief The chrono plot have a variable sized buffer of data, where the data is for a specified time period. \brief The chrono plot have a variable sized buffer of data, where the data is for a specified time period.
*/ */
class ChronoPlotData : public PlotData class ChronoPlotData : public PlotData
{ {
Q_OBJECT Q_OBJECT
public: public:
ChronoPlotData(QString uavObject, QString uavField, double refreshInterval) ChronoPlotData(QString uavObject, QString uavField, double refreshInterval)
: PlotData(uavObject, uavField) { : PlotData(uavObject, uavField) {
scalePower = 1; scalePower = 1;
//Setup timer that removes stale data //Setup timer that removes stale data
timer = new QTimer(); timer = new QTimer();
connect(timer, SIGNAL(timeout()), this, SLOT(removeStaleDataTimeout())); connect(timer, SIGNAL(timeout()), this, SLOT(removeStaleDataTimeout()));
timer->start(refreshInterval * 1000); timer->start(refreshInterval * 1000);
} }
~ChronoPlotData() { ~ChronoPlotData() {
delete timer; delete timer;
} }
bool append(UAVObject* obj); bool append(UAVObject* obj);
virtual PlotType plotType() { virtual PlotType plotType() {
return ChronoPlot; return ChronoPlot;
} }
private: private:
void removeStaleData(); void removeStaleData();
QTimer *timer; QTimer *timer;
private slots: private slots:
void removeStaleDataTimeout(); void removeStaleDataTimeout();
}; };
/*! /*!
\brief UAVObject plot use a fixed size buffer of data, where the horizontal axis values come from \brief UAVObject plot use a fixed size buffer of data, where the horizontal axis values come from
a UAVObject field. a UAVObject field.
*/ */
class UAVObjectPlotData : public PlotData class UAVObjectPlotData : public PlotData
{ {
Q_OBJECT Q_OBJECT
public: public:
UAVObjectPlotData(QString uavObject, QString uavField) UAVObjectPlotData(QString uavObject, QString uavField)
: PlotData(uavObject, uavField) {} : PlotData(uavObject, uavField) {}
~UAVObjectPlotData() {} ~UAVObjectPlotData() {}
bool append(UAVObject* obj); bool append(UAVObject* obj);
virtual PlotType plotType() { virtual PlotType plotType() {
return UAVObjectPlot; return UAVObjectPlot;
} }
}; };
#endif // PLOTDATA_H #endif // PLOTDATA_H

View File

@ -1,67 +1,67 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file scopegadget.cpp * @file scopegadget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Gadget configuration * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup scopeplugin * @addtogroup ScopePlugin Scope Gadget Plugin
* @{ * @{
* * @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "scopegadget.h" #include "scopegadget.h"
#include "scopegadgetconfiguration.h" #include "scopegadgetconfiguration.h"
#include "scopegadgetwidget.h" #include "scopegadgetwidget.h"
ScopeGadget::ScopeGadget(QString classId, ScopeGadgetWidget *widget, QWidget *parent) : ScopeGadget::ScopeGadget(QString classId, ScopeGadgetWidget *widget, QWidget *parent) :
IUAVGadget(classId, parent), IUAVGadget(classId, parent),
m_widget(widget) m_widget(widget)
{ {
} }
void ScopeGadget::loadConfiguration(IUAVGadgetConfiguration* config) void ScopeGadget::loadConfiguration(IUAVGadgetConfiguration* config)
{ {
ScopeGadgetConfiguration *sgConfig = qobject_cast<ScopeGadgetConfiguration*>(config); ScopeGadgetConfiguration *sgConfig = qobject_cast<ScopeGadgetConfiguration*>(config);
ScopeGadgetWidget* widget = qobject_cast<ScopeGadgetWidget*>(m_widget); ScopeGadgetWidget* widget = qobject_cast<ScopeGadgetWidget*>(m_widget);
widget->setXWindowSize(sgConfig->dataSize()); widget->setXWindowSize(sgConfig->dataSize());
widget->setRefreshInterval(sgConfig->refreshInterval()); widget->setRefreshInterval(sgConfig->refreshInterval());
if(sgConfig->plotType() == SequencialPlot ) if(sgConfig->plotType() == SequencialPlot )
widget->setupSequencialPlot(); widget->setupSequencialPlot();
else if(sgConfig->plotType() == ChronoPlot) else if(sgConfig->plotType() == ChronoPlot)
widget->setupChronoPlot(); widget->setupChronoPlot();
// else if(sgConfig->plotType() == UAVObjectPlot) // else if(sgConfig->plotType() == UAVObjectPlot)
// widget->setupUAVObjectPlot(); // widget->setupUAVObjectPlot();
foreach (PlotCurveConfiguration* plotCurveConfig, sgConfig->plotCurveConfigs()) { foreach (PlotCurveConfiguration* plotCurveConfig, sgConfig->plotCurveConfigs()) {
QString uavObject = plotCurveConfig->uavObject; QString uavObject = plotCurveConfig->uavObject;
QString uavField = plotCurveConfig->uavField; QString uavField = plotCurveConfig->uavField;
int scale = plotCurveConfig->yScalePower; int scale = plotCurveConfig->yScalePower;
QRgb color = plotCurveConfig->color; QRgb color = plotCurveConfig->color;
widget->addCurvePlot(uavObject,uavField,scale,QPen(QColor(color))); widget->addCurvePlot(uavObject,uavField,scale,QPen(QColor(color)));
} }
} }
ScopeGadget::~ScopeGadget() ScopeGadget::~ScopeGadget()
{ {
} }

View File

@ -1,67 +1,67 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file scopegadget.h * @file scopegadget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Plugin Gadget * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup scopeplugin * @addtogroup ScopePlugin Scope Gadget Plugin
* @{ * @{
* * @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef SCOPEGADGET_H_ #ifndef SCOPEGADGET_H_
#define SCOPEGADGET_H_ #define SCOPEGADGET_H_
#include <coreplugin/iuavgadget.h> #include <coreplugin/iuavgadget.h>
class IUAVGadget; class IUAVGadget;
//class QList<int>; //class QList<int>;
class QWidget; class QWidget;
class QString; class QString;
class ScopeGadgetWidget; class ScopeGadgetWidget;
using namespace Core; using namespace Core;
class ScopeGadget : public Core::IUAVGadget class ScopeGadget : public Core::IUAVGadget
{ {
Q_OBJECT Q_OBJECT
public: public:
ScopeGadget(QString classId, ScopeGadgetWidget *widget, QWidget *parent = 0); ScopeGadget(QString classId, ScopeGadgetWidget *widget, QWidget *parent = 0);
~ScopeGadget(); ~ScopeGadget();
void loadConfiguration(IUAVGadgetConfiguration* config); void loadConfiguration(IUAVGadgetConfiguration* config);
QList<int> context() const { QList<int> context() const {
return m_context; return m_context;
} }
QWidget *widget() { QWidget *widget() {
return m_widget; return m_widget;
} }
QString contextHelpId() const { QString contextHelpId() const {
return QString(); return QString();
} }
private: private:
QWidget *m_widget; QWidget *m_widget;
QList<int> m_context; QList<int> m_context;
}; };
#endif // SCOPEGADGET_H_ #endif // SCOPEGADGET_H_

View File

@ -1,166 +1,166 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file scopegadgetconfiguration.cpp * @file scopegadgetconfiguration.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Plugin Gadget configuration * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup scopeplugin * @addtogroup ScopePlugin Scope Gadget Plugin
* @{ * @{
* * @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "scopegadgetconfiguration.h" #include "scopegadgetconfiguration.h"
#include <QtCore/QDataStream> #include <QtCore/QDataStream>
ScopeGadgetConfiguration::ScopeGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) : ScopeGadgetConfiguration::ScopeGadgetConfiguration(QString classId, const QByteArray &state, QObject *parent) :
IUAVGadgetConfiguration(classId, parent), IUAVGadgetConfiguration(classId, parent),
m_plotType((int)ChronoPlot), m_plotType((int)ChronoPlot),
m_dataSize(60), m_dataSize(60),
m_refreshInterval(1) m_refreshInterval(1)
{ {
uint currentStreamVersion = 0; uint currentStreamVersion = 0;
int plotCurveCount = 0; int plotCurveCount = 0;
if (state.count() > 0) { if (state.count() > 0) {
QDataStream stream(state); QDataStream stream(state);
stream >> currentStreamVersion; stream >> currentStreamVersion;
if(currentStreamVersion != m_configurationStreamVersion) if(currentStreamVersion != m_configurationStreamVersion)
return; return;
stream >> m_plotType; stream >> m_plotType;
stream >> m_dataSize; stream >> m_dataSize;
stream >> m_refreshInterval; stream >> m_refreshInterval;
stream >> plotCurveCount; stream >> plotCurveCount;
while(plotCurveCount-- > 0) while(plotCurveCount-- > 0)
{ {
QString uavObject; QString uavObject;
QString uavField; QString uavField;
QRgb color; QRgb color;
PlotCurveConfiguration* plotCurveConf = new PlotCurveConfiguration(); PlotCurveConfiguration* plotCurveConf = new PlotCurveConfiguration();
stream >> uavObject; stream >> uavObject;
plotCurveConf->uavObject = uavObject; plotCurveConf->uavObject = uavObject;
stream >> uavField; stream >> uavField;
plotCurveConf->uavField = uavField; plotCurveConf->uavField = uavField;
stream >> color; stream >> color;
plotCurveConf->color = color; plotCurveConf->color = color;
stream >> plotCurveConf->yScalePower; stream >> plotCurveConf->yScalePower;
stream >> plotCurveConf->yMinimum; stream >> plotCurveConf->yMinimum;
stream >> plotCurveConf->yMaximum; stream >> plotCurveConf->yMaximum;
m_PlotCurveConfigs.append(plotCurveConf); m_PlotCurveConfigs.append(plotCurveConf);
} }
} }
} }
void ScopeGadgetConfiguration::clearPlotData() void ScopeGadgetConfiguration::clearPlotData()
{ {
PlotCurveConfiguration* poltCurveConfig; PlotCurveConfiguration* poltCurveConfig;
while(m_PlotCurveConfigs.size() > 0) while(m_PlotCurveConfigs.size() > 0)
{ {
poltCurveConfig = m_PlotCurveConfigs.first(); poltCurveConfig = m_PlotCurveConfigs.first();
m_PlotCurveConfigs.pop_front(); m_PlotCurveConfigs.pop_front();
delete poltCurveConfig; delete poltCurveConfig;
} }
} }
/** /**
* Clones a configuration. * Clones a configuration.
* *
*/ */
IUAVGadgetConfiguration *ScopeGadgetConfiguration::clone() IUAVGadgetConfiguration *ScopeGadgetConfiguration::clone()
{ {
int plotCurveCount = 0; int plotCurveCount = 0;
int plotDatasLoadIndex = 0; int plotDatasLoadIndex = 0;
ScopeGadgetConfiguration *m = new ScopeGadgetConfiguration(this->classId()); ScopeGadgetConfiguration *m = new ScopeGadgetConfiguration(this->classId());
m->setPlotType(m_plotType); m->setPlotType(m_plotType);
m->setDataSize( m_dataSize); m->setDataSize( m_dataSize);
m->setRefreashInterval( m_refreshInterval); m->setRefreashInterval( m_refreshInterval);
plotCurveCount = m_PlotCurveConfigs.size(); plotCurveCount = m_PlotCurveConfigs.size();
for(plotDatasLoadIndex = 0; plotDatasLoadIndex < plotCurveCount; plotDatasLoadIndex++) for(plotDatasLoadIndex = 0; plotDatasLoadIndex < plotCurveCount; plotDatasLoadIndex++)
{ {
PlotCurveConfiguration* currentPlotCurveConf = m_PlotCurveConfigs.at(plotDatasLoadIndex); PlotCurveConfiguration* currentPlotCurveConf = m_PlotCurveConfigs.at(plotDatasLoadIndex);
PlotCurveConfiguration* newPlotCurveConf = new PlotCurveConfiguration(); PlotCurveConfiguration* newPlotCurveConf = new PlotCurveConfiguration();
newPlotCurveConf->uavObject = currentPlotCurveConf->uavObject; newPlotCurveConf->uavObject = currentPlotCurveConf->uavObject;
newPlotCurveConf->uavField = currentPlotCurveConf->uavField; newPlotCurveConf->uavField = currentPlotCurveConf->uavField;
newPlotCurveConf->color = currentPlotCurveConf->color; newPlotCurveConf->color = currentPlotCurveConf->color;
newPlotCurveConf->yScalePower = currentPlotCurveConf->yScalePower; newPlotCurveConf->yScalePower = currentPlotCurveConf->yScalePower;
newPlotCurveConf->yMinimum = currentPlotCurveConf->yMinimum; newPlotCurveConf->yMinimum = currentPlotCurveConf->yMinimum;
newPlotCurveConf->yMaximum = currentPlotCurveConf->yMaximum; newPlotCurveConf->yMaximum = currentPlotCurveConf->yMaximum;
m->addPlotCurveConfig(newPlotCurveConf); m->addPlotCurveConfig(newPlotCurveConf);
} }
return m; return m;
} }
/** /**
* Saves a configuration. * Saves a configuration.
* *
*/ */
QByteArray ScopeGadgetConfiguration::saveState() const QByteArray ScopeGadgetConfiguration::saveState() const
{ {
int plotCurveCount = m_PlotCurveConfigs.size(); int plotCurveCount = m_PlotCurveConfigs.size();
int plotDatasLoadIndex = 0; int plotDatasLoadIndex = 0;
QByteArray bytes; QByteArray bytes;
QDataStream stream(&bytes, QIODevice::WriteOnly); QDataStream stream(&bytes, QIODevice::WriteOnly);
stream << m_configurationStreamVersion; stream << m_configurationStreamVersion;
stream << m_plotType; stream << m_plotType;
stream << m_dataSize; stream << m_dataSize;
stream << m_refreshInterval; stream << m_refreshInterval;
stream << plotCurveCount; stream << plotCurveCount;
for(plotDatasLoadIndex = 0; plotDatasLoadIndex < plotCurveCount; plotDatasLoadIndex++) for(plotDatasLoadIndex = 0; plotDatasLoadIndex < plotCurveCount; plotDatasLoadIndex++)
{ {
PlotCurveConfiguration* plotCurveConf = m_PlotCurveConfigs.at(plotDatasLoadIndex); PlotCurveConfiguration* plotCurveConf = m_PlotCurveConfigs.at(plotDatasLoadIndex);
stream << plotCurveConf->uavObject; stream << plotCurveConf->uavObject;
stream << plotCurveConf->uavField; stream << plotCurveConf->uavField;
stream << plotCurveConf->color; stream << plotCurveConf->color;
stream << plotCurveConf->yScalePower; stream << plotCurveConf->yScalePower;
stream << plotCurveConf->yMinimum; stream << plotCurveConf->yMinimum;
stream << plotCurveConf->yMaximum; stream << plotCurveConf->yMaximum;
} }
return bytes; return bytes;
} }
void ScopeGadgetConfiguration::replacePlotCurveConfig(QList<PlotCurveConfiguration*> newPlotCurveConfigs) void ScopeGadgetConfiguration::replacePlotCurveConfig(QList<PlotCurveConfiguration*> newPlotCurveConfigs)
{ {
clearPlotData(); clearPlotData();
m_PlotCurveConfigs.append(newPlotCurveConfigs); m_PlotCurveConfigs.append(newPlotCurveConfigs);
} }
ScopeGadgetConfiguration::~ScopeGadgetConfiguration() ScopeGadgetConfiguration::~ScopeGadgetConfiguration()
{ {
clearPlotData(); clearPlotData();
} }

View File

@ -1,85 +1,85 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file scopegadgetconfiguration.h * @file scopegadgetconfiguration.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Plugin Gadget configuration * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup scopeplugin * @addtogroup ScopePlugin Scope Gadget Plugin
* @{ * @{
* * @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef SCOPEGADGETCONFIGURATION_H #ifndef SCOPEGADGETCONFIGURATION_H
#define SCOPEGADGETCONFIGURATION_H #define SCOPEGADGETCONFIGURATION_H
#include "plotdata.h" #include "plotdata.h"
#include <coreplugin/iuavgadgetconfiguration.h> #include <coreplugin/iuavgadgetconfiguration.h>
#include <QVector> #include <QVector>
using namespace Core; using namespace Core;
struct PlotCurveConfiguration struct PlotCurveConfiguration
{ {
QString uavObject; QString uavObject;
QString uavField; QString uavField;
int yScalePower; //This is the power to which each value must be raised int yScalePower; //This is the power to which each value must be raised
QRgb color; QRgb color;
double yMinimum; double yMinimum;
double yMaximum; double yMaximum;
}; };
class ScopeGadgetConfiguration : public IUAVGadgetConfiguration class ScopeGadgetConfiguration : public IUAVGadgetConfiguration
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ScopeGadgetConfiguration(QString classId, const QByteArray &state = 0, QObject *parent = 0); explicit ScopeGadgetConfiguration(QString classId, const QByteArray &state = 0, QObject *parent = 0);
~ScopeGadgetConfiguration(); ~ScopeGadgetConfiguration();
//configuration setter functions //configuration setter functions
void setPlotType(int value){m_plotType = value;} void setPlotType(int value){m_plotType = value;}
void setDataSize(int value){m_dataSize = value;} void setDataSize(int value){m_dataSize = value;}
void setRefreashInterval(int value){m_refreshInterval = value;} void setRefreashInterval(int value){m_refreshInterval = value;}
void addPlotCurveConfig(PlotCurveConfiguration* value){m_PlotCurveConfigs.append(value);} void addPlotCurveConfig(PlotCurveConfiguration* value){m_PlotCurveConfigs.append(value);}
void replacePlotCurveConfig(QList<PlotCurveConfiguration*> m_PlotCurveConfigs); void replacePlotCurveConfig(QList<PlotCurveConfiguration*> m_PlotCurveConfigs);
//configurations getter functions //configurations getter functions
int plotType(){return m_plotType;} int plotType(){return m_plotType;}
int dataSize(){return m_dataSize;} int dataSize(){return m_dataSize;}
int refreshInterval(){return m_refreshInterval;} int refreshInterval(){return m_refreshInterval;}
QList<PlotCurveConfiguration*> plotCurveConfigs(){return m_PlotCurveConfigs;} QList<PlotCurveConfiguration*> plotCurveConfigs(){return m_PlotCurveConfigs;}
QByteArray saveState() const; QByteArray saveState() const;
IUAVGadgetConfiguration *clone(); IUAVGadgetConfiguration *clone();
private: private:
static const uint m_configurationStreamVersion = 1000;//Increment this if the stream format is not compatible with previous versions. This would cause existing configs to be discarded. static const uint m_configurationStreamVersion = 1000;//Increment this if the stream format is not compatible with previous versions. This would cause existing configs to be discarded.
int m_plotType; //The type of the plot int m_plotType; //The type of the plot
int m_dataSize; //The size of the data buffer to render in the curve plot int m_dataSize; //The size of the data buffer to render in the curve plot
int m_refreshInterval; //The interval to replot the curve widget. The data buffer is refresh as the data comes in. int m_refreshInterval; //The interval to replot the curve widget. The data buffer is refresh as the data comes in.
QList<PlotCurveConfiguration*> m_PlotCurveConfigs; QList<PlotCurveConfiguration*> m_PlotCurveConfigs;
void clearPlotData(); void clearPlotData();
}; };
#endif // SCOPEGADGETCONFIGURATION_H #endif // SCOPEGADGETCONFIGURATION_H

View File

@ -3,11 +3,11 @@
* *
* @file scopegadgetfactory.cpp * @file scopegadgetfactory.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Gadget Factory * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup scopeplugin
* @{ * @{
* * @addtogroup ScopePlugin Scope Gadget Plugin
* @{
* @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file scopegadgetfactory.h * @file scopegadgetfactory.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Plugin Gadget Factory * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup scopeplugin
* @{ * @{
* * @addtogroup ScopePlugin Scope Gadget Plugin
* @{
* @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,282 +1,282 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file scopegadgetoptionspage.cpp * @file scopegadgetoptionspage.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Plugin Gadget options page * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup scopeplugin * @addtogroup ScopePlugin Scope Gadget Plugin
* @{ * @{
* * @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "scopegadgetoptionspage.h" #include "scopegadgetoptionspage.h"
#include "scopegadgetconfiguration.h" #include "scopegadgetconfiguration.h"
#include "ui_scopegadgetoptionspage.h" #include "ui_scopegadgetoptionspage.h"
#include "extensionsystem/pluginmanager.h" #include "extensionsystem/pluginmanager.h"
#include "uavobjects/uavobjectmanager.h" #include "uavobjects/uavobjectmanager.h"
#include "uavobjects/uavdataobject.h" #include "uavobjects/uavdataobject.h"
ScopeGadgetOptionsPage::ScopeGadgetOptionsPage(ScopeGadgetConfiguration *config, QObject *parent) : ScopeGadgetOptionsPage::ScopeGadgetOptionsPage(ScopeGadgetConfiguration *config, QObject *parent) :
IOptionsPage(parent), IOptionsPage(parent),
m_config(config) m_config(config)
{ {
//nothing to do here... //nothing to do here...
} }
//creates options page widget (uses the UI file) //creates options page widget (uses the UI file)
QWidget* ScopeGadgetOptionsPage::createPage(QWidget *parent) QWidget* ScopeGadgetOptionsPage::createPage(QWidget *parent)
{ {
options_page = new Ui::ScopeGadgetOptionsPage(); options_page = new Ui::ScopeGadgetOptionsPage();
//main widget //main widget
QWidget *optionsPageWidget = new QWidget; QWidget *optionsPageWidget = new QWidget;
//main layout //main layout
options_page->setupUi(optionsPageWidget); options_page->setupUi(optionsPageWidget);
options_page->cmbPlotType->addItem("Sequencial Plot",""); options_page->cmbPlotType->addItem("Sequencial Plot","");
options_page->cmbPlotType->addItem("Chronological Plot",""); options_page->cmbPlotType->addItem("Chronological Plot","");
// Fills the combo boxes for the UAVObjects // Fills the combo boxes for the UAVObjects
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>(); UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
QList< QList<UAVDataObject*> > objList = objManager->getDataObjects(); QList< QList<UAVDataObject*> > objList = objManager->getDataObjects();
foreach (QList<UAVDataObject*> list, objList) { foreach (QList<UAVDataObject*> list, objList) {
foreach (UAVDataObject* obj, list) { foreach (UAVDataObject* obj, list) {
options_page->cmbUAVObjects->addItem(obj->getName()); options_page->cmbUAVObjects->addItem(obj->getName());
} }
} }
//Connect signals to slots cmbUAVObjects.currentIndexChanged //Connect signals to slots cmbUAVObjects.currentIndexChanged
connect(options_page->cmbUAVObjects, SIGNAL(currentIndexChanged(QString)), this, SLOT(on_cmbUAVObjects_currentIndexChanged(QString))); connect(options_page->cmbUAVObjects, SIGNAL(currentIndexChanged(QString)), this, SLOT(on_cmbUAVObjects_currentIndexChanged(QString)));
if(options_page->cmbUAVObjects->currentIndex() >= 0) if(options_page->cmbUAVObjects->currentIndex() >= 0)
on_cmbUAVObjects_currentIndexChanged(options_page->cmbUAVObjects->currentText()); on_cmbUAVObjects_currentIndexChanged(options_page->cmbUAVObjects->currentText());
options_page->cmbScale->addItem("E-9", -9); options_page->cmbScale->addItem("E-9", -9);
options_page->cmbScale->addItem("E-6", -6); options_page->cmbScale->addItem("E-6", -6);
options_page->cmbScale->addItem("E-5",-5); options_page->cmbScale->addItem("E-5",-5);
options_page->cmbScale->addItem("E-4",-4); options_page->cmbScale->addItem("E-4",-4);
options_page->cmbScale->addItem("E-3",-3); options_page->cmbScale->addItem("E-3",-3);
options_page->cmbScale->addItem("E-2",-2); options_page->cmbScale->addItem("E-2",-2);
options_page->cmbScale->addItem("E-1",-1); options_page->cmbScale->addItem("E-1",-1);
options_page->cmbScale->addItem("E0",0); options_page->cmbScale->addItem("E0",0);
options_page->cmbScale->addItem("E1",1); options_page->cmbScale->addItem("E1",1);
options_page->cmbScale->addItem("E2",2); options_page->cmbScale->addItem("E2",2);
options_page->cmbScale->addItem("E3",3); options_page->cmbScale->addItem("E3",3);
options_page->cmbScale->addItem("E4",4); options_page->cmbScale->addItem("E4",4);
options_page->cmbScale->addItem("E5",5); options_page->cmbScale->addItem("E5",5);
options_page->cmbScale->addItem("E6",6); options_page->cmbScale->addItem("E6",6);
options_page->cmbScale->addItem("E9",9); options_page->cmbScale->addItem("E9",9);
options_page->cmbScale->addItem("E12",12); options_page->cmbScale->addItem("E12",12);
options_page->cmbScale->setCurrentIndex(7); options_page->cmbScale->setCurrentIndex(7);
//Set widget values from settings //Set widget values from settings
options_page->cmbPlotType->setCurrentIndex(m_config->plotType()); options_page->cmbPlotType->setCurrentIndex(m_config->plotType());
options_page->spnDataSize->setValue(m_config->dataSize()); options_page->spnDataSize->setValue(m_config->dataSize());
options_page->spnRefreshInterval->setValue(m_config->refreshInterval()); options_page->spnRefreshInterval->setValue(m_config->refreshInterval());
//add the configured curves //add the configured curves
foreach (PlotCurveConfiguration* plotData, m_config->plotCurveConfigs()) { foreach (PlotCurveConfiguration* plotData, m_config->plotCurveConfigs()) {
QString uavObject = plotData->uavObject; QString uavObject = plotData->uavObject;
QString uavField = plotData->uavField; QString uavField = plotData->uavField;
int scale = plotData->yScalePower; int scale = plotData->yScalePower;
QVariant varColor = plotData->color; QVariant varColor = plotData->color;
addPlotCurveConfig(uavObject,uavField,scale,varColor); addPlotCurveConfig(uavObject,uavField,scale,varColor);
} }
if(m_config->plotCurveConfigs().count() > 0) if(m_config->plotCurveConfigs().count() > 0)
options_page->lstCurves->setCurrentRow(0, QItemSelectionModel::ClearAndSelect); options_page->lstCurves->setCurrentRow(0, QItemSelectionModel::ClearAndSelect);
connect(options_page->btnAddCurve, SIGNAL(clicked()), this, SLOT(on_btnAddCurve_clicked())); connect(options_page->btnAddCurve, SIGNAL(clicked()), this, SLOT(on_btnAddCurve_clicked()));
connect(options_page->btnRemoveCurve, SIGNAL(clicked()), this, SLOT(on_btnRemoveCurve_clicked())); connect(options_page->btnRemoveCurve, SIGNAL(clicked()), this, SLOT(on_btnRemoveCurve_clicked()));
connect(options_page->lstCurves, SIGNAL(currentRowChanged(int)), this, SLOT(on_lstCurves_currentRowChanged(int))); connect(options_page->lstCurves, SIGNAL(currentRowChanged(int)), this, SLOT(on_lstCurves_currentRowChanged(int)));
connect(options_page->btnColor, SIGNAL(clicked()), this, SLOT(on_btnColor_clicked())); connect(options_page->btnColor, SIGNAL(clicked()), this, SLOT(on_btnColor_clicked()));
setYAxisWidgetFromPlotCurve(); setYAxisWidgetFromPlotCurve();
return optionsPageWidget; return optionsPageWidget;
} }
void ScopeGadgetOptionsPage::on_btnColor_clicked() void ScopeGadgetOptionsPage::on_btnColor_clicked()
{ {
QColor color = QColorDialog::getColor( QColor(options_page->btnColor->text()), options_page->widget); QColor color = QColorDialog::getColor( QColor(options_page->btnColor->text()), options_page->widget);
if (color.isValid()) { if (color.isValid()) {
setButtonColor(color); setButtonColor(color);
} }
} }
/*! /*!
\brief Populate the widgets that containts the configs for the Y-Axis from \brief Populate the widgets that containts the configs for the Y-Axis from
the selected plot curve the selected plot curve
*/ */
void ScopeGadgetOptionsPage::setYAxisWidgetFromPlotCurve() void ScopeGadgetOptionsPage::setYAxisWidgetFromPlotCurve()
{ {
bool parseOK = false; bool parseOK = false;
QListWidgetItem* listItem = options_page->lstCurves->currentItem(); QListWidgetItem* listItem = options_page->lstCurves->currentItem();
if(listItem == 0) if(listItem == 0)
return; return;
int currentIndex = options_page->cmbUAVObjects->findText( listItem->data(Qt::UserRole + 0).toString()); int currentIndex = options_page->cmbUAVObjects->findText( listItem->data(Qt::UserRole + 0).toString());
options_page->cmbUAVObjects->setCurrentIndex(currentIndex); options_page->cmbUAVObjects->setCurrentIndex(currentIndex);
currentIndex = options_page->cmbUAVField->findText( listItem->data(Qt::UserRole + 1).toString()); currentIndex = options_page->cmbUAVField->findText( listItem->data(Qt::UserRole + 1).toString());
options_page->cmbUAVField->setCurrentIndex(currentIndex); options_page->cmbUAVField->setCurrentIndex(currentIndex);
currentIndex = options_page->cmbScale->findData( listItem->data(Qt::UserRole + 2), Qt::UserRole, Qt::MatchExactly); currentIndex = options_page->cmbScale->findData( listItem->data(Qt::UserRole + 2), Qt::UserRole, Qt::MatchExactly);
options_page->cmbScale->setCurrentIndex(currentIndex); options_page->cmbScale->setCurrentIndex(currentIndex);
QVariant varColor = listItem->data(Qt::UserRole + 3); QVariant varColor = listItem->data(Qt::UserRole + 3);
int rgb = varColor.toInt(&parseOK); int rgb = varColor.toInt(&parseOK);
setButtonColor(QColor((QRgb)rgb)); setButtonColor(QColor((QRgb)rgb));
} }
void ScopeGadgetOptionsPage::setButtonColor(const QColor &color) void ScopeGadgetOptionsPage::setButtonColor(const QColor &color)
{ {
options_page->btnColor->setText(color.name()); options_page->btnColor->setText(color.name());
options_page->btnColor->setPalette(QPalette(color)); options_page->btnColor->setPalette(QPalette(color));
options_page->btnColor->setAutoFillBackground(true); options_page->btnColor->setAutoFillBackground(true);
} }
/*! /*!
\brief When a new UAVObject is selected, populate the UAVObject field combo box with the correct values. \brief When a new UAVObject is selected, populate the UAVObject field combo box with the correct values.
*/ */
void ScopeGadgetOptionsPage::on_cmbUAVObjects_currentIndexChanged(QString val) void ScopeGadgetOptionsPage::on_cmbUAVObjects_currentIndexChanged(QString val)
{ {
options_page->cmbUAVField->clear(); options_page->cmbUAVField->clear();
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>(); UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
UAVDataObject* obj = dynamic_cast<UAVDataObject*>( objManager->getObject(val) ); UAVDataObject* obj = dynamic_cast<UAVDataObject*>( objManager->getObject(val) );
QList<UAVObjectField*> fieldList = obj->getFields(); QList<UAVObjectField*> fieldList = obj->getFields();
foreach (UAVObjectField* field, fieldList) { foreach (UAVObjectField* field, fieldList) {
options_page->cmbUAVField->addItem(field->getName()); options_page->cmbUAVField->addItem(field->getName());
} }
} }
/** /**
* Called when the user presses apply or OK. * Called when the user presses apply or OK.
* *
* Saves the current values * Saves the current values
* *
*/ */
void ScopeGadgetOptionsPage::apply() void ScopeGadgetOptionsPage::apply()
{ {
bool parseOK = false; bool parseOK = false;
//Apply configuration changes //Apply configuration changes
m_config->setPlotType(options_page->cmbPlotType->currentIndex()); m_config->setPlotType(options_page->cmbPlotType->currentIndex());
m_config->setDataSize(options_page->spnDataSize->value()); m_config->setDataSize(options_page->spnDataSize->value());
m_config->setRefreashInterval(options_page->spnRefreshInterval->value()); m_config->setRefreashInterval(options_page->spnRefreshInterval->value());
QList<PlotCurveConfiguration*> m_PlotCurveConfigs; QList<PlotCurveConfiguration*> m_PlotCurveConfigs;
for(int iIndex = 0; iIndex < options_page->lstCurves->count();iIndex++) { for(int iIndex = 0; iIndex < options_page->lstCurves->count();iIndex++) {
QListWidgetItem* listItem = options_page->lstCurves->item(iIndex); QListWidgetItem* listItem = options_page->lstCurves->item(iIndex);
PlotCurveConfiguration* newPlotCurveConfigs = new PlotCurveConfiguration(); PlotCurveConfiguration* newPlotCurveConfigs = new PlotCurveConfiguration();
newPlotCurveConfigs->uavObject = listItem->data(Qt::UserRole + 0).toString(); newPlotCurveConfigs->uavObject = listItem->data(Qt::UserRole + 0).toString();
newPlotCurveConfigs->uavField = listItem->data(Qt::UserRole + 1).toString(); newPlotCurveConfigs->uavField = listItem->data(Qt::UserRole + 1).toString();
newPlotCurveConfigs->yScalePower = listItem->data(Qt::UserRole + 2).toInt(&parseOK); newPlotCurveConfigs->yScalePower = listItem->data(Qt::UserRole + 2).toInt(&parseOK);
if(!parseOK) if(!parseOK)
newPlotCurveConfigs->yScalePower = 0; newPlotCurveConfigs->yScalePower = 0;
QVariant varColor = listItem->data(Qt::UserRole + 3); QVariant varColor = listItem->data(Qt::UserRole + 3);
int rgb = varColor.toInt(&parseOK); int rgb = varColor.toInt(&parseOK);
if(!parseOK) if(!parseOK)
newPlotCurveConfigs->color = QColor(Qt::black).rgb(); newPlotCurveConfigs->color = QColor(Qt::black).rgb();
else else
newPlotCurveConfigs->color = (QRgb)rgb; newPlotCurveConfigs->color = (QRgb)rgb;
m_PlotCurveConfigs.append(newPlotCurveConfigs); m_PlotCurveConfigs.append(newPlotCurveConfigs);
} }
m_config->replacePlotCurveConfig(m_PlotCurveConfigs); m_config->replacePlotCurveConfig(m_PlotCurveConfigs);
} }
/*! /*!
\brief Add a new curve to the plot. \brief Add a new curve to the plot.
*/ */
void ScopeGadgetOptionsPage::on_btnAddCurve_clicked() void ScopeGadgetOptionsPage::on_btnAddCurve_clicked()
{ {
bool parseOK = false; bool parseOK = false;
QString uavObject = options_page->cmbUAVObjects->currentText(); QString uavObject = options_page->cmbUAVObjects->currentText();
QString uavField = options_page->cmbUAVField->currentText(); QString uavField = options_page->cmbUAVField->currentText();
int scale = options_page->cmbScale->itemData(options_page->cmbScale->currentIndex()).toInt(&parseOK); int scale = options_page->cmbScale->itemData(options_page->cmbScale->currentIndex()).toInt(&parseOK);
if(!parseOK) if(!parseOK)
scale = 0; scale = 0;
//TODO: Find an existing plot curve config based on the uavobject and uav field. If it //TODO: Find an existing plot curve config based on the uavobject and uav field. If it
//exists, update it, else add a new one. //exists, update it, else add a new one.
QVariant varColor = (int)QColor(options_page->btnColor->text()).rgb(); QVariant varColor = (int)QColor(options_page->btnColor->text()).rgb();
addPlotCurveConfig(uavObject,uavField,scale,varColor); addPlotCurveConfig(uavObject,uavField,scale,varColor);
options_page->lstCurves->setCurrentRow(options_page->lstCurves->count() - 1); options_page->lstCurves->setCurrentRow(options_page->lstCurves->count() - 1);
} }
void ScopeGadgetOptionsPage::addPlotCurveConfig(QString uavObject, QString uavField, int scale, QVariant varColor) void ScopeGadgetOptionsPage::addPlotCurveConfig(QString uavObject, QString uavField, int scale, QVariant varColor)
{ {
bool parseOK = false; bool parseOK = false;
//Add a new curve config to the list //Add a new curve config to the list
QString listItemDisplayText = uavObject + "." + uavField; QString listItemDisplayText = uavObject + "." + uavField;
options_page->lstCurves->addItem(listItemDisplayText); options_page->lstCurves->addItem(listItemDisplayText);
QListWidgetItem *listWidgetItem = options_page->lstCurves->item(options_page->lstCurves->count() - 1); QListWidgetItem *listWidgetItem = options_page->lstCurves->item(options_page->lstCurves->count() - 1);
//Set the properties of the newly added list item //Set the properties of the newly added list item
QRgb rgbColor = (QRgb)varColor.toInt(&parseOK); QRgb rgbColor = (QRgb)varColor.toInt(&parseOK);
QColor color = QColor( rgbColor ); QColor color = QColor( rgbColor );
listWidgetItem->setText(listItemDisplayText); listWidgetItem->setText(listItemDisplayText);
listWidgetItem->setTextColor( color ); listWidgetItem->setTextColor( color );
//Store some additional data for the plot curve on the list item //Store some additional data for the plot curve on the list item
listWidgetItem->setData(Qt::UserRole + 0,QVariant(uavObject)); listWidgetItem->setData(Qt::UserRole + 0,QVariant(uavObject));
listWidgetItem->setData(Qt::UserRole + 1,QVariant(uavField)); listWidgetItem->setData(Qt::UserRole + 1,QVariant(uavField));
listWidgetItem->setData(Qt::UserRole + 2,QVariant(scale)); listWidgetItem->setData(Qt::UserRole + 2,QVariant(scale));
listWidgetItem->setData(Qt::UserRole + 3,varColor); listWidgetItem->setData(Qt::UserRole + 3,varColor);
} }
/*! /*!
Remove a curve config from the plot. Remove a curve config from the plot.
*/ */
void ScopeGadgetOptionsPage::on_btnRemoveCurve_clicked() void ScopeGadgetOptionsPage::on_btnRemoveCurve_clicked()
{ {
options_page->lstCurves->takeItem(options_page->lstCurves->currentIndex().row()); options_page->lstCurves->takeItem(options_page->lstCurves->currentIndex().row());
} }
void ScopeGadgetOptionsPage::finish() void ScopeGadgetOptionsPage::finish()
{ {
} }
/*! /*!
When a different plot curve config is selected, populate its values into the widgets. When a different plot curve config is selected, populate its values into the widgets.
*/ */
void ScopeGadgetOptionsPage::on_lstCurves_currentRowChanged(int currentRow) void ScopeGadgetOptionsPage::on_lstCurves_currentRowChanged(int currentRow)
{ {
setYAxisWidgetFromPlotCurve(); setYAxisWidgetFromPlotCurve();
} }

View File

@ -1,79 +1,79 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file scopegadgetoptionspage.h * @file scopegadgetoptionspage.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Plugin Gadget options page * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup scopeplugin * @addtogroup ScopePlugin Scope Gadget Plugin
* @{ * @{
* * @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef SCOPEGADGETOPTIONSPAGE_H #ifndef SCOPEGADGETOPTIONSPAGE_H
#define SCOPEGADGETOPTIONSPAGE_H #define SCOPEGADGETOPTIONSPAGE_H
#include "coreplugin/dialogs/ioptionspage.h" #include "coreplugin/dialogs/ioptionspage.h"
#include <QString> #include <QString>
#include <QStringList> #include <QStringList>
#include <QDebug> #include <QDebug>
#include <QtGui/QColorDialog> #include <QtGui/QColorDialog>
namespace Core namespace Core
{ {
class IUAVGadgetConfiguration; class IUAVGadgetConfiguration;
} }
class ScopeGadgetConfiguration; class ScopeGadgetConfiguration;
namespace Ui namespace Ui
{ {
class ScopeGadgetOptionsPage; class ScopeGadgetOptionsPage;
} }
using namespace Core; using namespace Core;
class ScopeGadgetOptionsPage : public IOptionsPage class ScopeGadgetOptionsPage : public IOptionsPage
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ScopeGadgetOptionsPage(ScopeGadgetConfiguration *config, QObject *parent = 0); explicit ScopeGadgetOptionsPage(ScopeGadgetConfiguration *config, QObject *parent = 0);
QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
void apply(); void apply();
void finish(); void finish();
private: private:
Ui::ScopeGadgetOptionsPage *options_page; Ui::ScopeGadgetOptionsPage *options_page;
ScopeGadgetConfiguration *m_config; ScopeGadgetConfiguration *m_config;
void addPlotCurveConfig(QString uavObject, QString uavField, int scale, QVariant varColor); void addPlotCurveConfig(QString uavObject, QString uavField, int scale, QVariant varColor);
void setYAxisWidgetFromPlotCurve(); void setYAxisWidgetFromPlotCurve();
void setButtonColor(const QColor &color); void setButtonColor(const QColor &color);
private slots: private slots:
void on_lstCurves_currentRowChanged(int currentRow); void on_lstCurves_currentRowChanged(int currentRow);
void on_btnRemoveCurve_clicked(); void on_btnRemoveCurve_clicked();
void on_btnAddCurve_clicked(); void on_btnAddCurve_clicked();
void on_cmbUAVObjects_currentIndexChanged(QString val); void on_cmbUAVObjects_currentIndexChanged(QString val);
void on_btnColor_clicked(); void on_btnColor_clicked();
}; };
#endif // SCOPEGADGETOPTIONSPAGE_H #endif // SCOPEGADGETOPTIONSPAGE_H

View File

@ -1,300 +1,300 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file scopegadgetwidget.cpp * @file scopegadgetwidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Gadget Widget * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup scopeplugin * @addtogroup ScopePlugin Scope Gadget Plugin
* @{ * @{
* * @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "uavobjects/uavobjectmanager.h" #include "uavobjects/uavobjectmanager.h"
#include "extensionsystem/pluginmanager.h" #include "extensionsystem/pluginmanager.h"
#include "scopegadgetwidget.h" #include "scopegadgetwidget.h"
#include "qwt/src/qwt_plot_curve.h" #include "qwt/src/qwt_plot_curve.h"
#include "qwt/src/qwt_legend.h" #include "qwt/src/qwt_legend.h"
#include <iostream> #include <iostream>
#include <math.h> #include <math.h>
#include <QDebug> #include <QDebug>
#include <QStringList> #include <QStringList>
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QVBoxLayout> #include <QtGui/QVBoxLayout>
#include <QtGui/QPushButton> #include <QtGui/QPushButton>
TestDataGen* ScopeGadgetWidget::testDataGen; TestDataGen* ScopeGadgetWidget::testDataGen;
ScopeGadgetWidget::ScopeGadgetWidget(QWidget *parent) : QwtPlot(parent) ScopeGadgetWidget::ScopeGadgetWidget(QWidget *parent) : QwtPlot(parent)
{ {
// if(testDataGen == 0) // if(testDataGen == 0)
// testDataGen = new TestDataGen(); // testDataGen = new TestDataGen();
} }
void ScopeGadgetWidget::preparePlot(PlotType plotType) void ScopeGadgetWidget::preparePlot(PlotType plotType)
{ {
m_plotType = plotType; m_plotType = plotType;
clearCurvePlots(); clearCurvePlots();
setMinimumSize(64, 64); setMinimumSize(64, 64);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
// Show a title // Show a title
setTitle("Scope"); setTitle("Scope");
// Show a legend at the bottom // Show a legend at the bottom
if (legend() == 0) { if (legend() == 0) {
QwtLegend *legend = new QwtLegend(); QwtLegend *legend = new QwtLegend();
legend->setFrameStyle(QFrame::Box | QFrame::Sunken); legend->setFrameStyle(QFrame::Box | QFrame::Sunken);
insertLegend(legend, QwtPlot::BottomLegend); insertLegend(legend, QwtPlot::BottomLegend);
} }
} }
void ScopeGadgetWidget::setupSequencialPlot() void ScopeGadgetWidget::setupSequencialPlot()
{ {
preparePlot(SequencialPlot); preparePlot(SequencialPlot);
setAxisTitle(QwtPlot::xBottom, "Index"); setAxisTitle(QwtPlot::xBottom, "Index");
setAxisScaleDraw(QwtPlot::xBottom, new QwtScaleDraw()); setAxisScaleDraw(QwtPlot::xBottom, new QwtScaleDraw());
setAxisScale(QwtPlot::xBottom, 0, m_xWindowSize); setAxisScale(QwtPlot::xBottom, 0, m_xWindowSize);
setAxisLabelRotation(QwtPlot::xBottom, 0.0); setAxisLabelRotation(QwtPlot::xBottom, 0.0);
setAxisLabelAlignment(QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom); setAxisLabelAlignment(QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom);
} }
void ScopeGadgetWidget::setupChronoPlot() void ScopeGadgetWidget::setupChronoPlot()
{ {
preparePlot(ChronoPlot); preparePlot(ChronoPlot);
setAxisTitle(QwtPlot::xBottom, "Time [h:m:s]"); setAxisTitle(QwtPlot::xBottom, "Time [h:m:s]");
setAxisScaleDraw(QwtPlot::xBottom, new TimeScaleDraw()); setAxisScaleDraw(QwtPlot::xBottom, new TimeScaleDraw());
uint NOW = QDateTime::currentDateTime().toTime_t(); uint NOW = QDateTime::currentDateTime().toTime_t();
setAxisScale(QwtPlot::xBottom, NOW - m_xWindowSize, NOW); setAxisScale(QwtPlot::xBottom, NOW - m_xWindowSize, NOW);
setAxisLabelRotation(QwtPlot::xBottom, -50.0); setAxisLabelRotation(QwtPlot::xBottom, -50.0);
setAxisLabelAlignment(QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom); setAxisLabelAlignment(QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom);
/* /*
In situations, when there is a label at the most right position of the In situations, when there is a label at the most right position of the
scale, additional space is needed to display the overlapping part scale, additional space is needed to display the overlapping part
of the label would be taken by reducing the width of scale and canvas. of the label would be taken by reducing the width of scale and canvas.
To avoid this "jumping canvas" effect, we add a permanent margin. To avoid this "jumping canvas" effect, we add a permanent margin.
We don't need to do the same for the left border, because there We don't need to do the same for the left border, because there
is enough space for the overlapping label below the left scale. is enough space for the overlapping label below the left scale.
*/ */
QwtScaleWidget *scaleWidget = axisWidget(QwtPlot::xBottom); QwtScaleWidget *scaleWidget = axisWidget(QwtPlot::xBottom);
const int fmh = QFontMetrics(scaleWidget->font()).height(); const int fmh = QFontMetrics(scaleWidget->font()).height();
scaleWidget->setMinBorderDist(0, fmh / 2); scaleWidget->setMinBorderDist(0, fmh / 2);
} }
void ScopeGadgetWidget::addCurvePlot(QString uavObject, QString uavField, int scaleOrderFactor, QPen pen) void ScopeGadgetWidget::addCurvePlot(QString uavObject, QString uavField, int scaleOrderFactor, QPen pen)
{ {
PlotData* plotData; PlotData* plotData;
if (m_plotType == SequencialPlot) if (m_plotType == SequencialPlot)
plotData = new SequencialPlotData(uavObject, uavField); plotData = new SequencialPlotData(uavObject, uavField);
else if (m_plotType == ChronoPlot) else if (m_plotType == ChronoPlot)
plotData = new ChronoPlotData(uavObject, uavField, m_refreshInterval); plotData = new ChronoPlotData(uavObject, uavField, m_refreshInterval);
//else if (m_plotType == UAVObjectPlot) //else if (m_plotType == UAVObjectPlot)
// plotData = new UAVObjectPlotData(uavObject, uavField); // plotData = new UAVObjectPlotData(uavObject, uavField);
plotData->m_xWindowSize = m_xWindowSize; plotData->m_xWindowSize = m_xWindowSize;
plotData->scalePower = scaleOrderFactor; plotData->scalePower = scaleOrderFactor;
//If the y-bounds are supplied, set them //If the y-bounds are supplied, set them
if (plotData->yMinimum != plotData->yMaximum) if (plotData->yMinimum != plotData->yMaximum)
setAxisScale(QwtPlot::yLeft, plotData->yMinimum, plotData->yMaximum); setAxisScale(QwtPlot::yLeft, plotData->yMinimum, plotData->yMaximum);
//Create the curve //Create the curve
QString curveName = (plotData->uavObject) + "." + (plotData->uavField); QString curveName = (plotData->uavObject) + "." + (plotData->uavField);
QwtPlotCurve* plotCurve = new QwtPlotCurve(curveName); QwtPlotCurve* plotCurve = new QwtPlotCurve(curveName);
plotCurve->setPen(pen); plotCurve->setPen(pen);
plotCurve->setData(*plotData->xData, *plotData->yData); plotCurve->setData(*plotData->xData, *plotData->yData);
plotCurve->attach(this); plotCurve->attach(this);
plotData->curve = plotCurve; plotData->curve = plotCurve;
//Keep the curve details for later //Keep the curve details for later
m_curvesData.insert(curveName, plotData); m_curvesData.insert(curveName, plotData);
//Get the object to monitor //Get the object to monitor
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>(); UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(objManager->getObject((plotData->uavObject))); UAVDataObject* obj = dynamic_cast<UAVDataObject*>(objManager->getObject((plotData->uavObject)));
//Link to the signal of new data only if this UAVObject has not been to connected yet //Link to the signal of new data only if this UAVObject has not been to connected yet
if (!m_connectedUAVObjects.contains(obj->getName())) { if (!m_connectedUAVObjects.contains(obj->getName())) {
m_connectedUAVObjects.append(obj->getName()); m_connectedUAVObjects.append(obj->getName());
connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(uavObjectReceived(UAVObject*))); connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(uavObjectReceived(UAVObject*)));
} }
connect(plotData, SIGNAL(dataChanged()), this, SLOT(replotNewData())); connect(plotData, SIGNAL(dataChanged()), this, SLOT(replotNewData()));
} }
void ScopeGadgetWidget::removeCurvePlot(QString uavObject, QString uavField) void ScopeGadgetWidget::removeCurvePlot(QString uavObject, QString uavField)
{ {
QString curveName = uavObject + "." + uavField; QString curveName = uavObject + "." + uavField;
PlotData* plotData = m_curvesData.take(curveName); PlotData* plotData = m_curvesData.take(curveName);
m_curvesData.remove(curveName); m_curvesData.remove(curveName);
plotData->curve->detach(); plotData->curve->detach();
delete plotData->curve; delete plotData->curve;
delete plotData; delete plotData;
} }
void ScopeGadgetWidget::uavObjectReceived(UAVObject* obj) void ScopeGadgetWidget::uavObjectReceived(UAVObject* obj)
{ {
foreach(PlotData* plotData, m_curvesData.values()) { foreach(PlotData* plotData, m_curvesData.values()) {
plotData->append(obj); plotData->append(obj);
plotData->curve->setData(*plotData->xData, *plotData->yData); plotData->curve->setData(*plotData->xData, *plotData->yData);
} }
} }
void ScopeGadgetWidget::replotNewData() void ScopeGadgetWidget::replotNewData()
{ {
if (m_plotType == ChronoPlot) { if (m_plotType == ChronoPlot) {
uint NOW = QDateTime::currentDateTime().toTime_t(); uint NOW = QDateTime::currentDateTime().toTime_t();
setAxisScale(QwtPlot::xBottom, NOW - m_xWindowSize, NOW); setAxisScale(QwtPlot::xBottom, NOW - m_xWindowSize, NOW);
} }
replot(); replot();
} }
void ScopeGadgetWidget::setupExamplePlot() void ScopeGadgetWidget::setupExamplePlot()
{ {
preparePlot(SequencialPlot); preparePlot(SequencialPlot);
// Show the axes // Show the axes
setAxisTitle(xBottom, "x"); setAxisTitle(xBottom, "x");
setAxisTitle(yLeft, "y"); setAxisTitle(yLeft, "y");
// Calculate the data, 500 points each // Calculate the data, 500 points each
const int points = 500; const int points = 500;
double x[ points ]; double x[ points ];
double sn[ points ]; double sn[ points ];
double cs[ points ]; double cs[ points ];
double sg[ points ]; double sg[ points ];
for (int i = 0; i < points; i++) { for (int i = 0; i < points; i++) {
x[i] = (3.0 * 3.14 / double(points)) * double(i); x[i] = (3.0 * 3.14 / double(points)) * double(i);
sn[i] = 2.0 * sin(x[i]); sn[i] = 2.0 * sin(x[i]);
cs[i] = 3.0 * cos(x[i]); cs[i] = 3.0 * cos(x[i]);
sg[i] = (sn[i] > 0) ? 1 : ((sn[i] < 0) ? -1 : 0); sg[i] = (sn[i] > 0) ? 1 : ((sn[i] < 0) ? -1 : 0);
} }
// add curves // add curves
QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1"); QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1");
curve1->setPen(QPen(Qt::blue)); curve1->setPen(QPen(Qt::blue));
QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2"); QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2");
curve2->setPen(QPen(Qt::red)); curve2->setPen(QPen(Qt::red));
QwtPlotCurve *curve3 = new QwtPlotCurve("Curve 3"); QwtPlotCurve *curve3 = new QwtPlotCurve("Curve 3");
curve3->setPen(QPen(Qt::green)); curve3->setPen(QPen(Qt::green));
// copy the data into the curves // copy the data into the curves
curve1->setData(x, sn, points); curve1->setData(x, sn, points);
curve2->setData(x, cs, points); curve2->setData(x, cs, points);
curve3->setData(x, sg, points); curve3->setData(x, sg, points);
curve1->attach(this); curve1->attach(this);
curve2->attach(this); curve2->attach(this);
curve3->attach(this); curve3->attach(this);
// finally, refresh the plot // finally, refresh the plot
replot(); replot();
} }
ScopeGadgetWidget::~ScopeGadgetWidget() ScopeGadgetWidget::~ScopeGadgetWidget()
{ {
//Get the object to de-monitor //Get the object to de-monitor
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager *objManager = pm->getObject<UAVObjectManager>(); UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
foreach(QString uavObjName, m_connectedUAVObjects) { foreach(QString uavObjName, m_connectedUAVObjects) {
UAVDataObject* obj = dynamic_cast<UAVDataObject*>(objManager->getObject(uavObjName)); UAVDataObject* obj = dynamic_cast<UAVDataObject*>(objManager->getObject(uavObjName));
disconnect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(uavObjectReceived(UAVObject*))); disconnect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(uavObjectReceived(UAVObject*)));
} }
clearCurvePlots(); clearCurvePlots();
} }
void ScopeGadgetWidget::clearCurvePlots() void ScopeGadgetWidget::clearCurvePlots()
{ {
foreach(PlotData* plotData, m_curvesData.values()) { foreach(PlotData* plotData, m_curvesData.values()) {
plotData->curve->detach(); plotData->curve->detach();
delete plotData->curve; delete plotData->curve;
delete plotData; delete plotData;
} }
m_curvesData.clear(); m_curvesData.clear();
} }
TestDataGen::TestDataGen() TestDataGen::TestDataGen()
{ {
// Get required UAVObjects // Get required UAVObjects
ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance(); ExtensionSystem::PluginManager* pm = ExtensionSystem::PluginManager::instance();
UAVObjectManager* objManager = pm->getObject<UAVObjectManager>(); UAVObjectManager* objManager = pm->getObject<UAVObjectManager>();
altActual = AltitudeActual::GetInstance(objManager); altActual = AltitudeActual::GetInstance(objManager);
gps = PositionActual::GetInstance(objManager); gps = PositionActual::GetInstance(objManager);
//Setup timer //Setup timer
timer = new QTimer(this); timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(genTestData())); connect(timer, SIGNAL(timeout()), this, SLOT(genTestData()));
timer->start(5000); timer->start(5000);
} }
void TestDataGen::genTestData() void TestDataGen::genTestData()
{ {
// Update AltitudeActual object // Update AltitudeActual object
AltitudeActual::DataFields altActualData; AltitudeActual::DataFields altActualData;
altActualData.Altitude = 500 * sin(0.1 * testTime) + 200 * cos(0.4 * testTime) + 800; altActualData.Altitude = 500 * sin(0.1 * testTime) + 200 * cos(0.4 * testTime) + 800;
altActualData.Temperature = 30 * sin(0.05 * testTime); altActualData.Temperature = 30 * sin(0.05 * testTime);
altActualData.Pressure = 100; altActualData.Pressure = 100;
altActual->setData(altActualData); altActual->setData(altActualData);
// Update gps objects // Update gps objects
PositionActual::DataFields gpsData; PositionActual::DataFields gpsData;
gpsData.Altitude = 0; gpsData.Altitude = 0;
gpsData.Heading = 0; gpsData.Heading = 0;
gpsData.Groundspeed = 0; gpsData.Groundspeed = 0;
gpsData.Latitude = 0; gpsData.Latitude = 0;
gpsData.Longitude = 0; gpsData.Longitude = 0;
gpsData.Satellites = 10; gpsData.Satellites = 10;
gps->setData(gpsData); gps->setData(gpsData);
testTime++; testTime++;
} }
TestDataGen::~TestDataGen() TestDataGen::~TestDataGen()
{ {
if (timer) if (timer)
timer->stop(); timer->stop();
delete timer; delete timer;
} }

View File

@ -1,133 +1,133 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file scopegadgetwidget.h * @file scopegadgetwidget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Plugin Gadget Widget * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup scopeplugin * @addtogroup ScopePlugin Scope Gadget Plugin
* @{ * @{
* * @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef SCOPEGADGETWIDGET_H_ #ifndef SCOPEGADGETWIDGET_H_
#define SCOPEGADGETWIDGET_H_ #define SCOPEGADGETWIDGET_H_
#include "plotdata.h" #include "plotdata.h"
#include "uavobjects/uavobject.h" #include "uavobjects/uavobject.h"
#include "uavobjects/altitudeactual.h" #include "uavobjects/altitudeactual.h"
#include "uavobjects/positionactual.h" #include "uavobjects/positionactual.h"
#include "qwt/src/qwt.h" #include "qwt/src/qwt.h"
#include "qwt/src/qwt_plot.h" #include "qwt/src/qwt_plot.h"
#include "qwt/src/qwt_plot_curve.h" #include "qwt/src/qwt_plot_curve.h"
#include "qwt/src/qwt_scale_draw.h" #include "qwt/src/qwt_scale_draw.h"
#include "qwt/src/qwt_scale_widget.h" #include "qwt/src/qwt_scale_widget.h"
#include <QTimer> #include <QTimer>
#include <QTime> #include <QTime>
#include <QVector> #include <QVector>
/*! /*!
\brief This class is used to render the time values on the horizontal axis for the \brief This class is used to render the time values on the horizontal axis for the
ChronoPlot. ChronoPlot.
*/ */
class TimeScaleDraw : public QwtScaleDraw class TimeScaleDraw : public QwtScaleDraw
{ {
public: public:
TimeScaleDraw() { TimeScaleDraw() {
baseTime = QDateTime::currentDateTime().toTime_t(); baseTime = QDateTime::currentDateTime().toTime_t();
} }
virtual QwtText label(double v) const { virtual QwtText label(double v) const {
QDateTime upTime = QDateTime::fromTime_t((uint)v); QDateTime upTime = QDateTime::fromTime_t((uint)v);
return upTime.toLocalTime().toString("hh:mm:ss"); return upTime.toLocalTime().toString("hh:mm:ss");
} }
private: private:
double baseTime; double baseTime;
}; };
/*! /*!
\brief This class is used to inject UAVTalk messages for testing. \brief This class is used to inject UAVTalk messages for testing.
*/ */
class TestDataGen : QObject class TestDataGen : QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
TestDataGen(); TestDataGen();
~TestDataGen(); ~TestDataGen();
private: private:
AltitudeActual* altActual; AltitudeActual* altActual;
PositionActual* gps; PositionActual* gps;
QTimer *timer; QTimer *timer;
double testTime; double testTime;
private slots: private slots:
void genTestData(); void genTestData();
}; };
class ScopeGadgetWidget : public QwtPlot class ScopeGadgetWidget : public QwtPlot
{ {
Q_OBJECT Q_OBJECT
public: public:
ScopeGadgetWidget(QWidget *parent = 0); ScopeGadgetWidget(QWidget *parent = 0);
~ScopeGadgetWidget(); ~ScopeGadgetWidget();
void setupSequencialPlot(); void setupSequencialPlot();
void setupChronoPlot(); void setupChronoPlot();
void setupUAVObjectPlot(); void setupUAVObjectPlot();
PlotType plotType(){return m_plotType;} PlotType plotType(){return m_plotType;}
void setXWindowSize(double xWindowSize){m_xWindowSize = xWindowSize;} void setXWindowSize(double xWindowSize){m_xWindowSize = xWindowSize;}
double xWindowSize(){return m_xWindowSize;} double xWindowSize(){return m_xWindowSize;}
void setRefreshInterval(double refreshInterval){m_refreshInterval = refreshInterval;} void setRefreshInterval(double refreshInterval){m_refreshInterval = refreshInterval;}
int refreshInterval(){return m_refreshInterval;} int refreshInterval(){return m_refreshInterval;}
void addCurvePlot(QString uavObject, QString uavField, int scaleOrderFactor = 0, QPen pen = QPen(Qt::black)); void addCurvePlot(QString uavObject, QString uavField, int scaleOrderFactor = 0, QPen pen = QPen(Qt::black));
void removeCurvePlot(QString uavObject, QString uavField); void removeCurvePlot(QString uavObject, QString uavField);
void clearCurvePlots(); void clearCurvePlots();
private slots: private slots:
void uavObjectReceived(UAVObject*); void uavObjectReceived(UAVObject*);
void replotNewData(); void replotNewData();
private: private:
void preparePlot(PlotType plotType); void preparePlot(PlotType plotType);
void setupExamplePlot(); void setupExamplePlot();
PlotType m_plotType; PlotType m_plotType;
double m_xWindowSize; double m_xWindowSize;
int m_refreshInterval; int m_refreshInterval;
QList<QString> m_connectedUAVObjects; QList<QString> m_connectedUAVObjects;
QMap<QString, PlotData*> m_curvesData; QMap<QString, PlotData*> m_curvesData;
static TestDataGen* testDataGen; static TestDataGen* testDataGen;
}; };
#endif /* SCOPEGADGETWIDGET_H_ */ #endif /* SCOPEGADGETWIDGET_H_ */

View File

@ -3,11 +3,11 @@
* *
* @file scopeplugin.cpp * @file scopeplugin.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Plugin * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup scopeplugin
* @{ * @{
* * @addtogroup ScopePlugin Scope Gadget Plugin
* @{
* @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file scopeplugin.h * @file scopeplugin.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Scope Plugin * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup scopeplugin
* @{ * @{
* * @addtogroup ScopePlugin Scope Gadget Plugin
* @{
* @brief The scope Gadget, graphically plots the states of UAVObjects
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -4,12 +4,13 @@
* @file serial_global.h * @file serial_global.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @brief
* @see The GNU Public License (GPL) Version 3 * @addtogroup GCSPlugins GCS Plugins
* @defgroup serialplugin
* @{ * @{
* * @addtogroup SerialPlugin Serial Connection Plugin
* @{
* @brief Impliments serial connection to the flight hardware for Telemetry
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file serialplugin.cpp * @file serialplugin.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Register connection object for the core connection manager * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup serialplugin
* @{ * @{
* * @addtogroup SerialPlugin Serial Connection Plugin
* @{
* @brief Impliments serial connection to the flight hardware for Telemetry
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file serialplugin.h * @file serialplugin.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup serialplugin
* @{ * @{
* * @addtogroup SerialPlugin Serial Connection Plugin
* @{
* @brief Impliments serial connection to the flight hardware for Telemetry
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthgadget.cpp * @file systemhealthgadget.cpp
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthgadget.h * @file systemhealthgadget.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief System health gadget to display system alarms * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthgadgetconfiguration.cpp * @file systemhealthgadgetconfiguration.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief System Health Plugin Gadget configuration * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthgadgetconfiguration.h * @file systemhealthgadgetconfiguration.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief System Health Plugin Gadget configuration * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthgadgetfactory.cpp * @file systemhealthgadgetfactory.cpp
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthgadgetfactory.h * @file systemhealthgadgetfactory.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthgadgetoptionspage.cpp * @file systemhealthgadgetoptionspage.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief System Health Plugin Gadget options page * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthgadgetoptionspage.h * @file systemhealthgadgetoptionspage.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief System Health Plugin Gadget options page * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthgadgetwidget.cpp * @file systemhealthgadgetwidget.cpp
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief System Health widget, does the actual drawing * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthgadgetwidget.h * @file systemhealthgadgetwidget.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthplugin.h * @file systemhealthplugin.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file systemhealthplugin.h * @file systemhealthplugin.h
* @author Edouard Lafargue Copyright (C) 2010. * @author Edouard Lafargue Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup systemhealthplugin
* @{ * @{
* * @addtogroup SystemHealthPlugin System Health Plugin
* @{
* @brief The System Health gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,13 +3,13 @@
* *
* @file browseritemdelegate.cpp * @file browseritemdelegate.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file browseritemdelegate.h * @file browseritemdelegate.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,11 +3,11 @@
* *
* @file mapplugin.cpp * @file mapplugin.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file browserplugin.h * @file browserplugin.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,13 +3,13 @@
* *
* @file fieldtreeitem.cpp * @file fieldtreeitem.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,11 +3,11 @@
* *
* @file fieldtreeitem.h * @file fieldtreeitem.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,13 +3,13 @@
* *
* @file treeitem.cpp * @file treeitem.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file treeitem.h * @file treeitem.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,11 +3,11 @@
* *
* @file uavobjectbrowser.cpp * @file uavobjectbrowser.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uavobjectbrowser.h * @file uavobjectbrowser.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,13 +3,13 @@
* *
* @file uavobjectbrowserconfiguration.cpp * @file uavobjectbrowserconfiguration.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file uavobjectbrowserconfiguration.h * @file uavobjectbrowserconfiguration.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,11 +3,11 @@
* *
* @file uavobjectbrowserfactory.cpp * @file uavobjectbrowserfactory.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uavobjectbrowserfactory.h * @file uavobjectbrowserfactory.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,13 +3,13 @@
* *
* @file uavobjectbrowseroptionspage.cpp * @file uavobjectbrowseroptionspage.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Options page for the UAVObject Browser Plugin * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file uavobjectbrowseroptionspage.h * @file uavobjectbrowseroptionspage.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,11 +3,11 @@
* *
* @file uavobjectbrowserwidget.cpp * @file uavobjectbrowserwidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uavobjectbrowserwidget.h * @file uavobjectbrowserwidget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,13 +3,13 @@
* *
* @file uavobjecttreemodel.cpp * @file uavobjecttreemodel.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file uavobjecttreemodel.h * @file uavobjecttreemodel.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavobjectbrowserplugin
* @{ * @{
* * @addtogroup UAVObjectBrowserPlugin UAVObject Browser Plugin
* @{
* @brief The UAVObject Browser gadget plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file telemetry.cpp * @file telemetry.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file telemetry.h * @file telemetry.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,11 +3,11 @@
* *
* @file telemetrymanager.cpp * @file telemetrymanager.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file telemetrymanager.cpp * @file telemetrymanager.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file telemetrymonitor.cpp * @file telemetrymonitor.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file telemetrymonitor.cpp * @file telemetrymonitor.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,13 +3,13 @@
* *
* @file uavtalk.cpp * @file uavtalk.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file uavtalk.h * @file uavtalk.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file uavobjects_global.h * @file uavobjects_global.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file uavtalkplugin.cpp * @file uavtalkplugin.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,13 +3,13 @@
* *
* @file uavtalkplugin.h * @file uavtalkplugin.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uavtalkplugin
* @{ * @{
* * @addtogroup UAVTalkPlugin UAVTalk Plugin
* @{
* @brief The UAVTalk protocol plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -3,11 +3,11 @@
* *
* @file uploadergadget.cpp * @file uploadergadget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Uploader Plugin Gadget * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uploadergadget.h * @file uploadergadget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Uploader Plugin Gadget configuration * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uploadergadgetconfiguration.cpp * @file uploadergadgetconfiguration.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Uploader Plugin Gadget configuration * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uploadergadgetconfiguration.h * @file uploadergadgetconfiguration.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Uploader Plugin Gadget configuration * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uploadergadgetfactory.cpp * @file uploadergadgetfactory.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Uploader Plugin Gadget factory * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uploadergadgetfactory.h * @file uploadergadgetfactory.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Uploader Plugin Gadget factory * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uploadergadgetoptionspage.cpp * @file uploadergadgetoptionspage.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Uploader Plugin Gadget options page * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uploadergadgetoptionspage.h * @file uploadergadgetoptionspage.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Uploader Plugin Gadget options page * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uploadergadgetwidget.cpp * @file uploadergadgetwidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Uploader Plugin Gadget widget * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uploadergadgetwidget.h * @file uploadergadgetwidget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief Uploader Plugin Gadget widget * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -4,11 +4,11 @@
* *
* @file uploaderplugin.cpp * @file uploaderplugin.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief A plugin to upload a file using y-modem protocol and a serial port * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -3,11 +3,11 @@
* *
* @file uploaderplugin.h * @file uploaderplugin.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @brief A plugin to upload a file using y-modem protocol and a serial port * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup uploaderplugin
* @{ * @{
* * @addtogroup YModemUploader YModem Serial Uploader Plugin
* @{
* @brief The YModem protocol serial uploader plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify

View File

@ -1,47 +1,47 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file communitywelcomepage.cpp * @file communitywelcomepage.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup welcomeplugin * @addtogroup WelcomePlugin Welcome Plugin
* @{ * @{
* * @brief The GCS Welcome plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "communitywelcomepage.h" #include "communitywelcomepage.h"
#include "communitywelcomepagewidget.h" #include "communitywelcomepagewidget.h"
namespace Welcome { namespace Welcome {
namespace Internal { namespace Internal {
CommunityWelcomePage::CommunityWelcomePage() CommunityWelcomePage::CommunityWelcomePage()
: m_page(new CommunityWelcomePageWidget) : m_page(new CommunityWelcomePageWidget)
{ {
} }
QWidget* CommunityWelcomePage::page() QWidget* CommunityWelcomePage::page()
{ {
return m_page; return m_page;
} }
} // namespace Internal } // namespace Internal
} // namespace Welcome } // namespace Welcome

View File

@ -1,59 +1,59 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file communitywelcomepage.h * @file communitywelcomepage.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup welcomeplugin * @addtogroup WelcomePlugin Welcome Plugin
* @{ * @{
* * @brief The GCS Welcome plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef COMMUNITYWELCOMEPAGE_H #ifndef COMMUNITYWELCOMEPAGE_H
#define COMMUNITYWELCOMEPAGE_H #define COMMUNITYWELCOMEPAGE_H
#include "welcome_global.h" #include "welcome_global.h"
#include <utils/iwelcomepage.h> #include <utils/iwelcomepage.h>
namespace Welcome { namespace Welcome {
namespace Internal { namespace Internal {
class CommunityWelcomePageWidget; class CommunityWelcomePageWidget;
class CommunityWelcomePage : public Utils::IWelcomePage class CommunityWelcomePage : public Utils::IWelcomePage
{ {
Q_OBJECT Q_OBJECT
public: public:
CommunityWelcomePage(); CommunityWelcomePage();
QWidget *page(); QWidget *page();
QString title() const { return tr("Community"); } QString title() const { return tr("Community"); }
int priority() const { return 30; } int priority() const { return 30; }
private: private:
CommunityWelcomePageWidget *m_page; CommunityWelcomePageWidget *m_page;
}; };
} // namespace Internal } // namespace Internal
} // namespace Welcome } // namespace Welcome
#endif // COMMUNITYWELCOMEPAGE_H #endif // COMMUNITYWELCOMEPAGE_H

View File

@ -1,85 +1,85 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file communitywelcomepagewidget.cpp * @file communitywelcomepagewidget.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup welcomeplugin * @addtogroup WelcomePlugin Welcome Plugin
* @{ * @{
* * @brief The GCS Welcome plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "communitywelcomepagewidget.h" #include "communitywelcomepagewidget.h"
#include "ui_communitywelcomepagewidget.h" #include "ui_communitywelcomepagewidget.h"
#include "rssfetcher.h" #include "rssfetcher.h"
#include <QtCore/QMap> #include <QtCore/QMap>
#include <QtGui/QDesktopServices> #include <QtGui/QDesktopServices>
#include <QtGui/QTreeWidgetItem> #include <QtGui/QTreeWidgetItem>
namespace Welcome { namespace Welcome {
namespace Internal { namespace Internal {
CommunityWelcomePageWidget::CommunityWelcomePageWidget(QWidget *parent) : CommunityWelcomePageWidget::CommunityWelcomePageWidget(QWidget *parent) :
QWidget(parent), QWidget(parent),
m_rssFetcher(new RSSFetcher(7)), m_rssFetcher(new RSSFetcher(7)),
ui(new Ui::CommunityWelcomePageWidget) ui(new Ui::CommunityWelcomePageWidget)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->labsTitleLabel->setStyledText(tr("News From the OpenPilot Project")); ui->labsTitleLabel->setStyledText(tr("News From the OpenPilot Project"));
ui->sitesTitleLabel->setStyledText(tr("OpenPilot Websites")); ui->sitesTitleLabel->setStyledText(tr("OpenPilot Websites"));
connect(ui->newsTreeWidget, SIGNAL(activated(QString)), SLOT(slotUrlClicked(QString))); connect(ui->newsTreeWidget, SIGNAL(activated(QString)), SLOT(slotUrlClicked(QString)));
connect(ui->sitesTreeWidget, SIGNAL(activated(QString)), SLOT(slotUrlClicked(QString))); connect(ui->sitesTreeWidget, SIGNAL(activated(QString)), SLOT(slotUrlClicked(QString)));
connect(m_rssFetcher, SIGNAL(newsItemReady(QString, QString, QString)), connect(m_rssFetcher, SIGNAL(newsItemReady(QString, QString, QString)),
ui->newsTreeWidget, SLOT(slotAddNewsItem(QString, QString, QString))); ui->newsTreeWidget, SLOT(slotAddNewsItem(QString, QString, QString)));
//: Add localized feed here only if one exists //: Add localized feed here only if one exists
m_rssFetcher->fetch(QUrl(tr("http://forums.openpilot.org/blog/rss/4-openpilot-development-blog"))); m_rssFetcher->fetch(QUrl(tr("http://forums.openpilot.org/blog/rss/4-openpilot-development-blog")));
QList<QPair<QString, QString> > sites; QList<QPair<QString, QString> > sites;
sites << qMakePair(tr("OpenPilot Home"), QString(QLatin1String("http://www.openpilot.org"))); sites << qMakePair(tr("OpenPilot Home"), QString(QLatin1String("http://www.openpilot.org")));
sites << qMakePair(tr("OpenPilot Wiki"), QString(QLatin1String("http://wiki.openpilot.org"))); sites << qMakePair(tr("OpenPilot Wiki"), QString(QLatin1String("http://wiki.openpilot.org")));
sites << qMakePair(tr("OpenPilot Store"), QString(QLatin1String("http://www.openpilot.org/store"))); sites << qMakePair(tr("OpenPilot Store"), QString(QLatin1String("http://www.openpilot.org/store")));
sites << qMakePair(tr("OpenPilot Forums"), QString(QLatin1String("http://forums.openpilot.org"))); sites << qMakePair(tr("OpenPilot Forums"), QString(QLatin1String("http://forums.openpilot.org")));
sites << qMakePair(tr("OpenPilot Bug Tracker"), QString(QLatin1String("http://bugs.openpilot.org"))); sites << qMakePair(tr("OpenPilot Bug Tracker"), QString(QLatin1String("http://bugs.openpilot.org")));
QListIterator<QPair<QString, QString> > it(sites); QListIterator<QPair<QString, QString> > it(sites);
while (it.hasNext()) { while (it.hasNext()) {
QPair<QString, QString> pair = it.next(); QPair<QString, QString> pair = it.next();
ui->sitesTreeWidget->addItem(pair.first, pair.second, pair.second); ui->sitesTreeWidget->addItem(pair.first, pair.second, pair.second);
} }
} }
CommunityWelcomePageWidget::~CommunityWelcomePageWidget() CommunityWelcomePageWidget::~CommunityWelcomePageWidget()
{ {
delete m_rssFetcher; delete m_rssFetcher;
delete ui; delete ui;
} }
void CommunityWelcomePageWidget::slotUrlClicked(const QString &data) void CommunityWelcomePageWidget::slotUrlClicked(const QString &data)
{ {
QDesktopServices::openUrl(QUrl(data)); QDesktopServices::openUrl(QUrl(data));
} }
} // namespace Internal } // namespace Internal
} // namespace Welcome } // namespace Welcome

View File

@ -1,63 +1,63 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file communitywelcomepagewidget.h * @file communitywelcomepagewidget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup welcomeplugin * @addtogroup WelcomePlugin Welcome Plugin
* @{ * @{
* * @brief The GCS Welcome plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef COMMUNITYWELCOMEPAGEWIDGET_H #ifndef COMMUNITYWELCOMEPAGEWIDGET_H
#define COMMUNITYWELCOMEPAGEWIDGET_H #define COMMUNITYWELCOMEPAGEWIDGET_H
#include <QWidget> #include <QWidget>
namespace Welcome { namespace Welcome {
namespace Internal { namespace Internal {
class RSSFetcher; class RSSFetcher;
namespace Ui { namespace Ui {
class CommunityWelcomePageWidget; class CommunityWelcomePageWidget;
} }
class CommunityWelcomePageWidget : public QWidget class CommunityWelcomePageWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
CommunityWelcomePageWidget(QWidget *parent = 0); CommunityWelcomePageWidget(QWidget *parent = 0);
~CommunityWelcomePageWidget(); ~CommunityWelcomePageWidget();
private slots: private slots:
void slotUrlClicked(const QString &data); void slotUrlClicked(const QString &data);
private: private:
RSSFetcher *m_rssFetcher; RSSFetcher *m_rssFetcher;
Ui::CommunityWelcomePageWidget *ui; Ui::CommunityWelcomePageWidget *ui;
}; };
} // namespace Internal } // namespace Internal
} // namespace Welcome } // namespace Welcome
#endif // COMMUNITYWELCOMEPAGEWIDGET_H #endif // COMMUNITYWELCOMEPAGEWIDGET_H

View File

@ -4,13 +4,13 @@
* @file rssfetcher.cpp * @file rssfetcher.cpp
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3
* @defgroup welcomeplugin
* @{ * @{
* * @addtogroup WelcomePlugin Welcome Plugin
* @{
* @brief The GCS Welcome plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or

View File

@ -1,75 +1,75 @@
/** /**
****************************************************************************** ******************************************************************************
* *
* @file rssfetcher.h * @file rssfetcher.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
* @brief * @addtogroup GCSPlugins GCS Plugins
* @see The GNU Public License (GPL) Version 3 * @{
* @defgroup welcomeplugin * @addtogroup WelcomePlugin Welcome Plugin
* @{ * @{
* * @brief The GCS Welcome plugin
*****************************************************************************/ *****************************************************************************/
/* /*
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or * the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details. * for more details.
* *
* You should have received a copy of the GNU General Public License along * You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc., * with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef RSSFETCHER_H #ifndef RSSFETCHER_H
#define RSSFETCHER_H #define RSSFETCHER_H
#include <QtCore/QUrl> #include <QtCore/QUrl>
#include <QtCore/QXmlStreamReader> #include <QtCore/QXmlStreamReader>
#include <QtNetwork/QHttp> #include <QtNetwork/QHttp>
namespace Welcome { namespace Welcome {
namespace Internal { namespace Internal {
class RSSFetcher : public QObject class RSSFetcher : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
RSSFetcher(int maxItems, QObject *parent = 0); RSSFetcher(int maxItems, QObject *parent = 0);
signals: signals:
void newsItemReady(const QString& title, const QString& desciption, const QString& url); void newsItemReady(const QString& title, const QString& desciption, const QString& url);
public slots: public slots:
void fetch(const QUrl &url); void fetch(const QUrl &url);
void finished(int id, bool error); void finished(int id, bool error);
void readData(const QHttpResponseHeader &); void readData(const QHttpResponseHeader &);
signals: signals:
void finished(bool error); void finished(bool error);
private: private:
void parseXml(); void parseXml();
QXmlStreamReader m_xml; QXmlStreamReader m_xml;
QString m_currentTag; QString m_currentTag;
QString m_linkString; QString m_linkString;
QString m_descriptionString; QString m_descriptionString;
QString m_titleString; QString m_titleString;
QHttp m_http; QHttp m_http;
int m_connectionId; int m_connectionId;
int m_items; int m_items;
int m_maxItems; int m_maxItems;
}; };
} // namespace Welcome } // namespace Welcome
} // namespace Internal } // namespace Internal
#endif // RSSFETCHER_H #endif // RSSFETCHER_H

Some files were not shown because too many files have changed in this diff Show More