QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
Viewer3DTileReply.h
Go to the documentation of this file.
1#pragma once
2
3#include <QtCore/QObject>
4#include <QtCore/QPointer>
5#include <QtCore/qcontainerfwd.h>
6
7#include "Viewer3DTileInfo.h"
8
9struct QGCCacheTile;
10class QNetworkAccessManager;
11class QNetworkReply;
12class QTimer;
13
14class Viewer3DTileReply : public QObject
15{
16 Q_OBJECT
17
19
20public:
22
23 explicit Viewer3DTileReply(int zoomLevel, int tileX, int tileY, int mapId, const QString &mapType, QNetworkAccessManager *networkManager, QObject *parent = nullptr);
25
26signals:
30
31private:
32 void _prepareDownload();
33 void _onRequestFinished();
34 void _onRequestError();
35 void _onTimeout();
36 void _onCacheHit(QGCCacheTile *tile);
37 void _onCacheMiss();
38 void _disconnectReply();
39 bool _isBingEmptyTile() const;
40
41 static constexpr int kTimeoutMs = 10000;
42 static constexpr int kMaxRetries = 5;
43
44 QNetworkAccessManager *_networkManager = nullptr;
45 // QPointer: the reply is parented to the network manager and may be
46 // destroyed before us during ~Viewer3DTileQuery child cleanup.
47 QPointer<QNetworkReply> _reply;
48 QTimer *_timeoutTimer = nullptr;
49
50 TileInfo_t _tile;
51 int _timeoutCounter = 0;
52
53 static QByteArray _bingNoTileImage;
54};
void tileDone(TileInfo_t)
void tileEmpty(TileInfo_t)
friend class Viewer3DTileReplyTest
void tileGiveUp(TileInfo_t)