2011-03-29 22:32:09 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* @file mixercurvewidget.h
|
2012-02-05 21:07:19 +01:00
|
|
|
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
|
2011-03-29 22:32:09 +02:00
|
|
|
* @addtogroup GCSPlugins GCS Plugins
|
|
|
|
* @{
|
2012-02-05 21:07:19 +01:00
|
|
|
* @addtogroup UAVObjectWidgetUtils Plugin
|
2011-03-29 22:32:09 +02:00
|
|
|
* @{
|
2012-02-05 21:07:19 +01:00
|
|
|
* @brief Utility plugin for UAVObject to Widget relation management
|
2011-03-29 22:32:09 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* 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 MIXERCURVEWIDGET_H_
|
|
|
|
#define MIXERCURVEWIDGET_H_
|
|
|
|
|
|
|
|
#include <QGraphicsView>
|
|
|
|
#include <QtSvg/QSvgRenderer>
|
|
|
|
#include <QtSvg/QGraphicsSvgItem>
|
|
|
|
#include "mixercurvepoint.h"
|
|
|
|
#include "mixercurveline.h"
|
2012-02-05 19:16:38 +01:00
|
|
|
#include "uavobjectwidgetutils_global.h"
|
2011-03-29 22:32:09 +02:00
|
|
|
|
2012-02-05 19:16:38 +01:00
|
|
|
class UAVOBJECTWIDGETUTILS_EXPORT MixerCurveWidget : public QGraphicsView
|
2011-03-29 22:32:09 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
MixerCurveWidget(QWidget *parent = 0);
|
|
|
|
~MixerCurveWidget();
|
|
|
|
void itemMoved(double itemValue); // Callback when a point is moved, to be updated
|
|
|
|
void initCurve (QList<double> points);
|
|
|
|
QList<double> getCurve();
|
2011-06-12 01:49:05 +02:00
|
|
|
void initLinearCurve(quint32 numPoints, double maxValue);
|
2011-03-29 22:32:09 +02:00
|
|
|
void setCurve(QList<double>);
|
|
|
|
void setMin(double value);
|
|
|
|
void setMax(double value);
|
|
|
|
void setRange(double min, double max);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void curveUpdated(QList<double>, double );
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
private:
|
|
|
|
QGraphicsSvgItem *plot;
|
|
|
|
QList<Node*> nodeList;
|
|
|
|
double curveMin;
|
|
|
|
double curveMax;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void showEvent(QShowEvent *event);
|
|
|
|
void resizeEvent(QResizeEvent *event);
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
#endif /* MIXERCURVEWIDGET_H_ */
|