Update hud.h

This commit is contained in:
infiniteCable
2025-04-23 16:05:00 +02:00
committed by GitHub
parent 44d400fb91
commit 859116c42a
+14
View File
@@ -7,6 +7,7 @@
#else
#include "selfdrive/ui/ui.h"
#endif
#include "common/params.h"
class HudRenderer : public QObject {
Q_OBJECT
@@ -18,9 +19,11 @@ public:
virtual void draw(QPainter &p, const QRect &surface_rect);
protected:
void triggerParentUpdate();
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);
void drawBatteryDetailsPanel(QPainter &p, const QRect &surface_rect);
float speed = 0;
float set_speed = 0;
@@ -29,4 +32,15 @@ protected:
bool is_metric = false;
bool v_ego_cluster_seen = false;
int status = STATUS_DISENGAGED;
struct BatteryDetails {
float capacity = 0.0f; // Wh
float charge = 0.0f; // Wh
float soc = 0.0f; // %
float temperature = 0.0f; // °C
bool heaterActive = false;
float voltage = 0.0f; // V
float current = 0.0f; // A
float power = 0.0f; // W
};
BatteryDetails battery_details;
};