2 ******************************************************************************
4 * @file joystickcontrol.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup GCSControlGadgetPlugin GCSControl Gadget Plugin
10 * @brief A that mimics a transmitter joystick and updates the MCC
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef POSITIONFIELD_H
30 #define POSITIONFIELD_H
33 #include <QGraphicsView>
34 #include <QtSvg/QSvgRenderer>
35 #include <QtSvg/QGraphicsSvgItem>
41 class PositionField
: public QGraphicsView
{
45 explicit PositionField(QWidget
*parent
= 0);
50 void mouseMoveEvent(QMouseEvent
*event
);
51 void mousePressEvent(QMouseEvent
*event
);
52 void paintEvent(QPaintEvent
*event
);
53 void resizeEvent(QResizeEvent
*event
);
56 void positionClicked(double north
, double east
);
59 void updateDesiredIndicator(double north
, double east
);
60 void updateActualIndicator(double north
, double east
);
63 QSvgRenderer
*m_renderer
;
64 QGraphicsSvgItem
*m_background
;
65 QGraphicsSvgItem
*m_positiondesired
;
66 QGraphicsSvgItem
*m_positionactual
;
69 #endif // POSITIONFIELD_H