2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 3 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * You should have received a copy of the GNU General Public License along
13 * with this program; if not, write to the Free Software Foundation, Inc.,
14 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 #ifndef PFDQMLGADGETWIDGET_H_
18 #define PFDQMLGADGETWIDGET_H_
20 #include "pfdqmlgadgetconfiguration.h"
21 #include "uavobjectmanager.h"
24 class PfdQmlGadgetWidget
: public QQuickView
{
25 Q_OBJECT
Q_PROPERTY(QString earthFile READ earthFile WRITE setEarthFile NOTIFY earthFileChanged
)
26 Q_PROPERTY(bool terrainEnabled READ terrainEnabled WRITE setTerrainEnabled NOTIFY terrainEnabledChanged
)
28 Q_PROPERTY(bool actualPositionUsed READ actualPositionUsed WRITE setActualPositionUsed NOTIFY actualPositionUsedChanged
)
30 Q_PROPERTY(QString speedUnit READ speedUnit WRITE setSpeedUnit NOTIFY speedUnitChanged
)
31 Q_PROPERTY(double speedFactor READ speedFactor WRITE setSpeedFactor NOTIFY speedFactorChanged
)
32 Q_PROPERTY(QString altitudeUnit READ altitudeUnit WRITE setAltitudeUnit NOTIFY altitudeUnitChanged
)
33 Q_PROPERTY(double altitudeFactor READ altitudeFactor WRITE setAltitudeFactor NOTIFY altitudeFactorChanged
)
35 // pre-defined fallback position
36 Q_PROPERTY(double latitude READ latitude WRITE setLatitude NOTIFY latitudeChanged
)
37 Q_PROPERTY(double longitude READ longitude WRITE setLongitude NOTIFY longitudeChanged
)
38 Q_PROPERTY(double altitude READ altitude WRITE setAltitude NOTIFY altitudeChanged
)
41 PfdQmlGadgetWidget(QWindow
*parent
= 0);
42 ~PfdQmlGadgetWidget();
43 void setQmlFile(QString fn
);
45 QString
earthFile() const
49 bool terrainEnabled() const
51 return m_terrainEnabled
&& m_openGLEnabled
;
54 QString
speedUnit() const
58 double speedFactor() const
62 QString
altitudeUnit() const
64 return m_altitudeUnit
;
66 double altitudeFactor() const
68 return m_altitudeFactor
;
71 bool actualPositionUsed() const
73 return m_actualPositionUsed
;
75 double latitude() const
79 double longitude() const
83 double altitude() const
88 Q_INVOKABLE
void resetConsumedEnergy();
91 void setEarthFile(QString arg
);
92 void setTerrainEnabled(bool arg
);
94 void setSpeedUnit(QString unit
);
95 void setSpeedFactor(double factor
);
96 void setAltitudeUnit(QString unit
);
97 void setAltitudeFactor(double factor
);
99 void setOpenGLEnabled(bool arg
);
101 void setLatitude(double arg
);
102 void setLongitude(double arg
);
103 void setAltitude(double arg
);
105 void setActualPositionUsed(bool arg
);
108 void earthFileChanged(QString arg
);
109 void terrainEnabledChanged(bool arg
);
111 void actualPositionUsedChanged(bool arg
);
112 void latitudeChanged(double arg
);
113 void longitudeChanged(double arg
);
114 void altitudeChanged(double arg
);
116 void speedUnitChanged(QString arg
);
117 void speedFactorChanged(double arg
);
118 void altitudeUnitChanged(QString arg
);
119 void altitudeFactorChanged(double arg
);
122 void mouseReleaseEvent(QMouseEvent
*event
);
125 UAVObjectManager
*m_uavoManager
;
126 QString m_qmlFileName
;
128 bool m_openGLEnabled
;
129 bool m_terrainEnabled
;
131 bool m_actualPositionUsed
;
137 double m_speedFactor
;
138 QString m_altitudeUnit
;
139 double m_altitudeFactor
;
142 #endif /* PFDQMLGADGETWIDGET_H_ */