-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmissionviewer.h
More file actions
97 lines (72 loc) · 2.14 KB
/
missionviewer.h
File metadata and controls
97 lines (72 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef MISSIONVIEWER_H
#define MISSIONVIEWER_H
#include <QDialog>
#include <QGraphicsScene>
#include <QMutex>
#include <QtNetwork/QNetworkAccessManager>
#include "imagewidget.h"
#include "interoplogin.h"
class CustomView;
namespace Ui {
class MissionViewer;
}
class MissionViewer : public QDialog
{
Q_OBJECT
public:
explicit MissionViewer(QList<ImageWidget *> *items, QWidget *parent = 0);
~MissionViewer();
void closeEvent(QCloseEvent *event);
void show();
void refresh();
LatLon scenePointToLatLon(QPointF scenePoint);
signals:
void requestUpdate();
private slots:
void moveToTarget(int row, int column);
void on_actionrefresh_triggered();
void mouseMoved(QPointF scenePoint);
void mapNetworkManagerFinished(QNetworkReply *reply);
private:
// Actions
QAction *loginAction;
QAction *postAllTargetsAction;
// animation parameters
QMutex animationLock;
bool animationOngoing = false;
int refreshInterval = 15, animationDuration = 1000; // in ms
double initialScale = 3.35; // ref val from transform().m11()
double targetZoomFactor = 6.0;
int iconLength;
Ui::MissionViewer *ui;
QRectF viewRect;
QPointF initialCenter;
double avgLat, avgLon;
QList<ImageWidget *> *items;
QList<TargetData> uniqueTargets;
QNetworkAccessManager *mapNetworkManager;
// For interoping with the auvsi server
InteropLogin::ServerInfo serverInfo;
void downloadMap(const QString &urlStr);
void drawPath();
void drawTargets();
void fillTargetTable();
void getAvgLatLon();
QPixmap pixmapFromTarget(QString& folderPath, TargetData& target);
void removeDuplicates(QList<TargetData>& original);
// run in a separate thread
void animateMovement(QPointF start, QPointF end);
enum
{
POST,
GET
};
bool auvsiRequest(const QString &api, const int requestType, const QByteArray &data,
const QString &contentTypeHeader, QByteArray &replyData);
void login();
void doLogin();
void doLogout();
void postAllTargets();
void postTargetIdx(int idx);
};
#endif // MISSIONVIEWER_H