dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
gpsconstellationwidget.h
Go to the documentation of this file.
1 
12 /*
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.
17  *
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.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with this program; if not, see <http://www.gnu.org/licenses/>
25  */
26 
27 #ifndef GPSCONSTELLATIONWIDGET_H_
28 #define GPSCONSTELLATIONWIDGET_H_
29 
30 #include <QGraphicsView>
31 #include <QtSvg/QSvgRenderer>
32 #include <QtSvg/QGraphicsSvgItem>
33 
34 class GpsConstellationWidget : public QGraphicsView
35 {
36  Q_OBJECT
37 
38 public:
39  explicit GpsConstellationWidget(QWidget *parent = nullptr);
41 
42 public slots:
43  void updateSat(int index, int prn, int elevation, int azimuth, int snr);
44 
45 private slots:
46 
47 private:
48  static const int MAX_SATELLITES = 32;
49  int satellites[MAX_SATELLITES][4];
50  QGraphicsScene *scene;
51  QSvgRenderer *renderer;
52  QGraphicsSvgItem *world;
53  QGraphicsSvgItem *satIcons[MAX_SATELLITES];
54  QGraphicsSimpleTextItem *satTexts[MAX_SATELLITES];
55 
56  QPointF polarToCoord(int elevation, int azimuth);
57 
58 protected:
59  void showEvent(QShowEvent *event);
60  void resizeEvent(QResizeEvent *event);
61 };
62 #endif /* GPSCONSTELLATIONWIDGET_H_ */
void showEvent(QShowEvent *event)
void updateSat(int index, int prn, int elevation, int azimuth, int snr)
GpsConstellationWidget(QWidget *parent=nullptr)
void resizeEvent(QResizeEvent *event)