Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / plugins / antennatrack / antennatrackgadget.h
blob486eb3ac8ad355999b44af144f44d0463f620402
1 /**
2 ******************************************************************************
4 * @file AntennaTrackgadget.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 ANTENNATRACKGADGET_H_
29 #define ANTENNATRACKGADGET_H_
31 #include <QtSerialPort/QSerialPort>
32 #include <coreplugin/iuavgadget.h>
33 #include "antennatrackwidget.h"
34 #include "telemetryparser.h"
36 class IUAVGadget;
37 class QWidget;
38 class QString;
39 class AntennaTrackWidget;
41 using namespace Core;
43 class AntennaTrackGadget : public Core::IUAVGadget {
44 Q_OBJECT
45 public:
46 AntennaTrackGadget(QString classId, AntennaTrackWidget *widget, QWidget *parent = 0);
47 ~AntennaTrackGadget();
49 QWidget *widget()
51 return m_widget;
54 // void setMode(QString mode); // Either UAVTalk or serial port
56 void loadConfiguration(IUAVGadgetConfiguration *config);
57 public slots:
58 void onConnect();
59 void onDisconnect();
61 private slots:
62 void onDataAvailable();
64 private:
65 QPointer<AntennaTrackWidget> m_widget;
66 QPointer<QSerialPort> port;
67 QPointer<GPSParser> parser;
68 bool connected;
69 void processNewSerialData(QByteArray serialData);
70 PortSettings m_portsettings;
74 #endif // ANTENNATRACKGADGET_H_