2010-08-20 23:18:20 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @file configtaskwidget.h
|
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
|
|
|
* @addtogroup GCSPlugins GCS Plugins
|
|
|
|
* @{
|
|
|
|
* @addtogroup ConfigPlugin Config Plugin
|
|
|
|
* @{
|
|
|
|
* @brief The Configuration Gadget used to update settings in the firmware (task widget)
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* 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 CONFIGTASKWIDGET_H
|
|
|
|
#define CONFIGTASKWIDGET_H
|
|
|
|
|
2010-09-07 21:31:19 +02:00
|
|
|
|
2010-08-20 23:18:20 +02:00
|
|
|
#include "extensionsystem/pluginmanager.h"
|
2011-01-22 18:38:22 +01:00
|
|
|
#include "uavobjectmanager.h"
|
|
|
|
#include "uavobject.h"
|
|
|
|
#include "objectpersistence.h"
|
2010-09-07 21:31:19 +02:00
|
|
|
#include <QQueue>
|
2010-08-20 23:18:20 +02:00
|
|
|
#include <QtGui/QWidget>
|
|
|
|
#include <QList>
|
|
|
|
|
|
|
|
|
|
|
|
class ConfigTaskWidget: public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
ConfigTaskWidget(QWidget *parent = 0);
|
|
|
|
~ConfigTaskWidget();
|
2010-09-07 21:31:19 +02:00
|
|
|
void saveObjectToSD(UAVObject *obj);
|
2010-08-20 23:18:20 +02:00
|
|
|
void updateObjectPersistance(ObjectPersistence::OperationOptions op, UAVObject *obj);
|
2010-08-26 16:23:40 +02:00
|
|
|
UAVObjectManager* getObjectManager();
|
2010-08-20 23:18:20 +02:00
|
|
|
|
2011-03-28 20:43:15 +02:00
|
|
|
static double listMean(QList<double> list);
|
|
|
|
|
2011-03-29 03:29:56 +02:00
|
|
|
private slots:
|
|
|
|
void objectPersistenceTransactionCompleted(UAVObject* obj, bool success);
|
|
|
|
void objectPersistenceUpdated(UAVObject * obj);
|
2010-09-07 21:31:19 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
QQueue<UAVObject*> queue;
|
|
|
|
void saveNextObject();
|
2011-03-29 03:29:56 +02:00
|
|
|
enum {IDLE, AWAITING_ACK, AWAITING_COMPLETED} saveState;
|
2010-09-07 21:31:19 +02:00
|
|
|
|
|
|
|
|
2010-08-20 23:18:20 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CONFIGTASKWIDGET_H
|