You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
606 B
24 lines
606 B
7 months ago
|
#pragma once
|
||
|
|
||
|
#include <QPainter>
|
||
|
#include "selfdrive/ui/ui.h"
|
||
|
|
||
|
class HudRenderer : public QObject {
|
||
|
public:
|
||
|
HudRenderer();
|
||
|
void updateState(const UIState &s);
|
||
|
void draw(QPainter &p, const QRect &surface_rect);
|
||
|
|
||
|
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_metric = false;
|
||
|
bool v_ego_cluster_seen = false;
|
||
|
int status = STATUS_DISENGAGED;
|
||
|
};
|