mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
34 lines
826 B
C++
34 lines
826 B
C++
#pragma once
|
|
|
|
#include <QPainter>
|
|
#include "selfdrive/ui/ui.h"
|
|
|
|
#include "frogpilot/ui/qt/onroad/frogpilot_annotated_camera.h"
|
|
|
|
class HudRenderer : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
HudRenderer();
|
|
void updateState(const UIState &s);
|
|
void draw(QPainter &p, const QRect &surface_rect);
|
|
|
|
// FrogPilot variables
|
|
FrogPilotAnnotatedCameraWidget *frogpilot_nvg;
|
|
|
|
QJsonObject frogpilot_toggles;
|
|
|
|
private:
|
|
void drawSetSpeed(QPainter &p, const QRect &surface_rect);
|
|
void drawCurrentSpeed(QPainter &p, const QRect &surface_rect);
|
|
void drawText(QPainter &p, int x, int y, const QString &text, int alpha = 255);
|
|
|
|
float speed = 0;
|
|
float set_speed = 0;
|
|
bool is_cruise_set = false;
|
|
bool is_cruise_available = true;
|
|
bool is_metric = false;
|
|
bool v_ego_cluster_seen = false;
|
|
int status = STATUS_DISENGAGED;
|
|
};
|