2021-11-12 11:51:23 -05:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2021 Jon Beniston, M7RCE //
|
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef INCLUDE_PLANESPOTTERS_H
|
|
|
|
#define INCLUDE_PLANESPOTTERS_H
|
|
|
|
|
|
|
|
#include <QtCore>
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QPixmap>
|
|
|
|
#include <QHash>
|
|
|
|
|
|
|
|
#include "export.h"
|
|
|
|
|
|
|
|
class QNetworkAccessManager;
|
|
|
|
class QNetworkReply;
|
|
|
|
|
|
|
|
class SDRBASE_API PlaneSpottersPhoto : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
struct Thumbnail {
|
|
|
|
QString m_src;
|
|
|
|
int m_width;
|
|
|
|
int m_height;
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
|
|
|
QString m_id;
|
|
|
|
Thumbnail m_thumbnail;
|
|
|
|
Thumbnail m_largeThumbnail;
|
|
|
|
QString m_link;
|
ADS-B: Add support for decoding Comm-B replies in Mode-S frames. This adds TAS, IAS, Mach, Selelected Alt, Selected Heading, Turn rate, Roll angle, Autopilot enabled, Vertical and lateral navigation modes, Baro setting, Headwind, OAT, Wind speed and direction, Pressure, Static air temperature, Humidity.
2022-08-26 07:35:12 -04:00
|
|
|
QString m_photographer;
|
2021-11-12 11:51:23 -05:00
|
|
|
QPixmap m_pixmap;
|
|
|
|
};
|
|
|
|
|
|
|
|
// PlaneSpotters API wrapper
|
|
|
|
// Allows downloading of images of aircraft from https://www.planespotters.net/
|
|
|
|
// Note that API terms of use require us not to cache images on disk
|
|
|
|
class SDRBASE_API PlaneSpotters : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
PlaneSpotters();
|
|
|
|
~PlaneSpotters();
|
|
|
|
|
|
|
|
|
|
|
|
void getAircraftPhoto(const QString& icao);
|
ADS-B: Add support for decoding Comm-B replies in Mode-S frames. This adds TAS, IAS, Mach, Selelected Alt, Selected Heading, Turn rate, Roll angle, Autopilot enabled, Vertical and lateral navigation modes, Baro setting, Headwind, OAT, Wind speed and direction, Pressure, Static air temperature, Humidity.
2022-08-26 07:35:12 -04:00
|
|
|
void getAircraftPhotoByRegistration(const QString& registration);
|
2021-11-12 11:51:23 -05:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void aircraftPhoto(const PlaneSpottersPhoto *photo); // Called when photo is available.
|
|
|
|
|
|
|
|
private:
|
|
|
|
void parseJson(PlaneSpottersPhoto *photo, QByteArray bytes);
|
|
|
|
void parsePhoto(PlaneSpottersPhoto *photo, QByteArray bytes);
|
|
|
|
|
|
|
|
QNetworkAccessManager *m_networkManager;
|
|
|
|
QHash<QString, PlaneSpottersPhoto *> m_photos;
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void handleReply(QNetworkReply* reply);
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* INCLUDE_PLANESPOTTERS_H */
|