47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#ifndef GUIDEDISPLAYWIDGET_H
|
|
#define GUIDEDISPLAYWIDGET_H
|
|
|
|
#include <QColor>
|
|
#include <QJsonObject>
|
|
#include <QRectF>
|
|
#include <QStringList>
|
|
#include <QWidget>
|
|
|
|
class QPainter;
|
|
class QPaintEvent;
|
|
|
|
class GuideDisplayWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit GuideDisplayWidget(QWidget* parent = nullptr);
|
|
|
|
void SetStatus(const QJsonObject& status);
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent* event) override;
|
|
|
|
private:
|
|
void DrawLedText(QPainter& painter,
|
|
const QRectF& area,
|
|
const QStringList& lines,
|
|
const QColor& color,
|
|
qreal relativeSize = 0.16) const;
|
|
void DrawStopSign(QPainter& painter,
|
|
const QRectF& area,
|
|
const QString& text = QStringLiteral("STOP")) const;
|
|
void DrawCaptureGuidance(QPainter& painter,
|
|
const QRectF& screen) const;
|
|
void DrawGuidance(QPainter& painter,
|
|
const QRectF& screen,
|
|
bool showCorrection) const;
|
|
QString AircraftText() const;
|
|
|
|
private:
|
|
QJsonObject m_status;
|
|
int m_stateCode = 12;
|
|
};
|
|
|
|
#endif // GUIDEDISPLAYWIDGET_H
|