34 #ifndef OPMAP_GADGETWIDGET_H_
35 #define OPMAP_GADGETWIDGET_H_
43 #include <QStringList>
44 #include <QStandardItemModel>
59 #include "objectpersistence.h"
60 #include <QItemSelectionModel>
62 #include "../pathplanner/flightdatamodel.h"
72 using namespace mapcontrol;
89 class WindVelocityActual;
104 void setHome(QPointF pos);
107 void setZoom(
int zoom);
108 void setPosition(QPointF pos);
109 void setMapProvider(QString provider);
110 void setShowTileGridLines(
bool showTileGridLines);
111 void setAccessMode(QString accessMode);
112 void setUseMemoryCache(
bool useMemoryCache);
113 void setCacheLocation(QString cacheLocation);
115 void SetUavPic(QString UAVPic);
116 void setMaxUpdateRate(
int update_rate);
117 void setHomePosition(QPointF pos);
118 void setOverlayOpacity(qreal value);
119 void setUserImageLocation(QString userImageLocation);
120 void setUserImageHorizontalScale(
double userImageHorizontalScale);
121 void setUserImageVerticalScale(
double userImageVerticalScale);
122 bool getGPSPosition(
double &latitude,
double &longitude,
double &altitude);
123 void setGeoCodingLanguage(QString language);
125 void defaultLocationAndZoomChanged(
double lng,
double lat,
double zoom);
126 void overlayOpacityChanged(qreal);
130 void onTelemetryConnect();
131 void onTelemetryDisconnect();
134 void resizeEvent(QResizeEvent *event);
135 void mouseMoveEvent(QMouseEvent *event);
136 void contextMenuEvent(QContextMenuEvent *event);
137 void closeEvent(QCloseEvent *);
140 void updatePosition();
142 void updateMousePos();
153 void on_toolButtonZoomM_clicked();
154 void on_toolButtonZoomP_clicked();
155 void on_toolButtonMapHome_clicked();
156 void on_toolButtonMapUAV_clicked();
157 void on_toolButtonMapUAVheading_clicked();
158 void on_horizontalSliderZoom_sliderMoved(
int position);
159 void on_toolButtonMagicWaypointMapMode_clicked();
160 void on_toolButtonNormalMapMode_clicked();
161 void on_toolButtonHomeWaypoint_clicked();
162 void on_toolButtonMoveToWP_clicked();
167 void zoomChanged(
double zoomt,
double zoom,
double zoomd);
169 void OnTileLoadComplete();
170 void OnTileLoadStart();
171 void OnTilesStillToLoad(
int number);
176 void onReloadAct_triggered();
177 void onRipAct_triggered();
178 void onCopyMouseLatLonToClipAct_triggered();
179 void onCopyMouseLatToClipAct_triggered();
180 void onCopyMouseLonToClipAct_triggered();
181 void onShowCompassRoseAct_toggled(
bool show);
182 void onShowWindCompassAction_toggled(
bool show);
183 void onShowDiagnostics_toggled(
bool show);
184 void onShowUAVInfo_toggled(
bool show);
185 void onShowUAVAct_toggled(
bool show);
186 void onShowHomeAct_toggled(
bool show);
187 void onShowTrailLineAct_toggled(
bool show);
188 void onShowTrailAct_toggled(
bool show);
189 void onGoZoomInAct_triggered();
190 void onGoZoomOutAct_triggered();
191 void onGoMouseClickAct_triggered();
192 void onSetHomeAct_triggered();
193 void onGoHomeAct_triggered();
194 void onGoUAVAct_triggered();
195 void onFollowUAVpositionAct_toggled(
bool checked);
196 void onFollowUAVheadingAct_toggled(
bool checked);
198 void onOpenWayPointEditorAct_triggered();
199 void onAddWayPointAct_triggeredFromContextMenu();
200 void onAddWayPointAct_triggeredFromThis();
204 void onEditWayPointAct_triggered();
205 void onLockWayPointAct_triggered();
206 void onDeleteWayPointAct_triggered();
207 void onClearWayPointsAct_triggered();
209 void onMapModeActGroup_triggered(QAction *action);
210 void onZoomActGroup_triggered(QAction *action);
211 void onHomeMagicWaypointAct_triggered();
212 void onShowSafeAreaAct_toggled(
bool show);
213 void onSafeAreaActGroup_triggered(QAction *action);
214 void onUAVTrailTypeActGroup_triggered(QAction *action);
215 void onClearUAVtrailAct_triggered();
216 void onUAVTrailTimeActGroup_triggered(QAction *action);
217 void onUAVTrailDistanceActGroup_triggered(QAction *action);
218 void onMaxUpdateRateActGroup_triggered(QAction *action);
219 void onChangeDefaultLocalAndZoom();
220 void on_tbFind_clicked();
222 void onOverlayOpacityActGroup_triggered(QAction *action);
223 void on_leFind_returnPressed();
231 int m_prev_tile_number;
235 QStringList findPlaceWordList;
236 QCompleter *findPlaceCompleter;
237 QTimer *m_updateTimer;
238 QTimer *m_statusUpdateTimer;
239 Ui::OPMap_Widget *m_widget;
245 QStandardItemModel wayPoint_treeView_model;
247 bool m_telemetry_connected;
252 QAction *copyMouseLatLonToClipAct;
253 QAction *copyMouseLatToClipAct;
254 QAction *copyMouseLonToClipAct;
255 QAction *showCompassRoseAct;
256 QAction *showWindCompassAction;
257 QAction *showDiagnostics;
258 QAction *showUAVInfo;
259 QAction *showHomeAct;
263 QAction *goMouseClickAct;
267 QAction *followUAVpositionAct;
268 QAction *followUAVheadingAct;
270 QAction *wayPointEditorAct;
271 QAction *addWayPointActFromThis;
272 QAction *addWayPointActFromContextMenu;
273 QAction *editWayPointAct;
274 QAction *lockWayPointAct;
275 QAction *deleteWayPointAct;
276 QAction *clearWayPointsAct;
278 QAction *homeMagicWaypointAct;
280 QAction *showSafeAreaAct;
281 QAction *changeDefaultLocalAndZoom;
282 QActionGroup *safeAreaActGroup;
285 QActionGroup *uavTrailTypeActGroup;
287 QAction *clearUAVtrailAct;
288 QActionGroup *uavTrailTimeActGroup;
289 QAction *showTrailLineAct;
290 QAction *showTrailAct;
292 QActionGroup *uavTrailDistanceActGroup;
295 QActionGroup *mapModeActGroup;
298 QActionGroup *zoomActGroup;
299 QActionGroup *overlayOpacityActGroup;
303 QActionGroup *maxUpdateRateActGroup;
306 void createActions();
307 void homeMagicWaypoint();
308 void moveToMagicWaypointPosition();
309 void hideMagicWaypointControls();
310 void showMagicWaypointControls();
311 void keepMagicWaypointWithInSafeArea();
317 bool getUAVPosition(
double &latitude,
double &longitude,
double &altitude);
320 void setMapFollowingMode();
322 bool setHomeLocationObject();
326 QPointer<FlightDataModel> model;
327 QPointer<QDialog> pathPlannerDialog;
328 QPointer<ModelMapProxy> mapProxy;
329 QPointer<QItemSelectionModel> selectionModel;
Core plugin system that manages the plugins, their life cycle and their registered objects...
A QGraphicsItem representing a WayPoint.
internals::PointLatLng coord