mirror of
https://github.com/infiniteCable2/openpilot.git
synced 2026-09-15 03:53:41 +08:00
Update hud.h
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user