Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / plugins / antennatrack / antennatrackwidget.h
blob7eb68557123ea1d285c2eee8e4dd60db91fa1a97
1 /**
2 ******************************************************************************
4 * @file antennatrackwidget.h
5 * @author Sami Korhonen & the OpenPilot team Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup AntennaTrackGadgetPlugin Antenna Track Gadget Plugin
9 * @{
10 * @brief A gadget that communicates with antenna tracker and enables basic configuration
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
21 * for more details.
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
28 #ifndef ANTENNATRACKWIDGET_H_
29 #define ANTENNATRACKWIDGET_H_
31 #include "ui_antennatrackwidget.h"
32 #include "antennatrackgadgetconfiguration.h"
33 #include "uavobject.h"
34 #include <QGraphicsView>
35 #include <QtSvg/QSvgRenderer>
36 #include <QtSvg/QGraphicsSvgItem>
37 #include <QtSerialPort/QSerialPort>
38 #include <QPointer>
40 class Ui_AntennaTrackWidget;
42 typedef struct struct_TrackData {
43 double Latitude;
44 double Longitude;
45 double Altitude;
46 double HomeLatitude;
47 double HomeLongitude;
48 double HomeAltitude;
49 } TrackData_t;
51 class AntennaTrackWidget : public QWidget, public Ui_AntennaTrackWidget {
52 Q_OBJECT
54 public:
55 AntennaTrackWidget(QWidget *parent = 0);
56 ~AntennaTrackWidget();
57 TrackData_t TrackData;
58 void setPort(QPointer<QSerialPort> portx);
60 private slots:
61 void setPosition(double, double, double);
62 void setHomePosition(double, double, double);
63 void dumpPacket(const QString &packet);
65 private:
66 void calcAntennaPosition(void);
67 QGraphicsSvgItem *marker;
68 QPointer<QSerialPort> port;
69 double azimuth_old;
70 double elevation_old;
72 #endif /* ANTENNATRACKWIDGET_H_ */