mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-06-28 01:52:06 +08:00
UI: remove DM icon (#24771)
old-commit-hash: 4d836c6edd6e0f2639a3e2500794990da339eddc
This commit is contained in:
@@ -166,7 +166,6 @@ void OnroadAlerts::paintEvent(QPaintEvent *event) {
|
||||
|
||||
NvgWindow::NvgWindow(VisionStreamType type, QWidget* parent) : fps_filter(UI_FREQ, 3, 1. / UI_FREQ), CameraViewWidget("camerad", type, true, parent) {
|
||||
engage_img = loadPixmap("../assets/img_chffr_wheel.png", {img_size, img_size});
|
||||
dm_img = loadPixmap("../assets/img_driver_face.png", {img_size, img_size});
|
||||
}
|
||||
|
||||
void NvgWindow::updateState(const UIState &s) {
|
||||
@@ -186,13 +185,11 @@ void NvgWindow::updateState(const UIState &s) {
|
||||
setProperty("speed", QString::number(std::nearbyint(cur_speed)));
|
||||
setProperty("maxSpeed", maxspeed_str);
|
||||
setProperty("speedUnit", s.scene.is_metric ? "km/h" : "mph");
|
||||
setProperty("hideDM", cs.getAlertSize() != cereal::ControlsState::AlertSize::NONE);
|
||||
setProperty("status", s.status);
|
||||
|
||||
// update engageability and DM icons at 2Hz
|
||||
// update engageability at 2Hz
|
||||
if (sm.frame % (UI_FREQ / 2) == 0) {
|
||||
setProperty("engageable", cs.getEngageable() || cs.getEnabled());
|
||||
setProperty("dmActive", sm["driverMonitoringState"].getDriverMonitoringState().getIsActiveMode());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,11 +231,6 @@ void NvgWindow::drawHud(QPainter &p) {
|
||||
engage_img, bg_colors[status], 1.0);
|
||||
}
|
||||
|
||||
// dm icon
|
||||
if (!hideDM) {
|
||||
drawIcon(p, radius / 2 + (bdr_s * 2), rect().bottom() - footer_h / 2,
|
||||
dm_img, QColor(0, 0, 0, 70), dmActive ? 1.0 : 0.2);
|
||||
}
|
||||
p.restore();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,6 @@ class NvgWindow : public CameraViewWidget {
|
||||
Q_PROPERTY(QString maxSpeed MEMBER maxSpeed);
|
||||
Q_PROPERTY(bool is_cruise_set MEMBER is_cruise_set);
|
||||
Q_PROPERTY(bool engageable MEMBER engageable);
|
||||
Q_PROPERTY(bool dmActive MEMBER dmActive);
|
||||
Q_PROPERTY(bool hideDM MEMBER hideDM);
|
||||
Q_PROPERTY(int status MEMBER status);
|
||||
|
||||
public:
|
||||
@@ -45,7 +43,6 @@ private:
|
||||
void drawText(QPainter &p, int x, int y, const QString &text, int alpha = 255);
|
||||
|
||||
QPixmap engage_img;
|
||||
QPixmap dm_img;
|
||||
const int radius = 192;
|
||||
const int img_size = (radius / 2) * 1.5;
|
||||
QString speed;
|
||||
@@ -53,8 +50,6 @@ private:
|
||||
QString maxSpeed;
|
||||
bool is_cruise_set = false;
|
||||
bool engageable = false;
|
||||
bool dmActive = false;
|
||||
bool hideDM = false;
|
||||
int status = STATUS_DISENGAGED;
|
||||
|
||||
protected:
|
||||
|
||||
+1
-1
@@ -231,7 +231,7 @@ void UIState::updateStatus() {
|
||||
UIState::UIState(QObject *parent) : QObject(parent) {
|
||||
sm = std::make_unique<SubMaster, const std::initializer_list<const char *>>({
|
||||
"modelV2", "controlsState", "liveCalibration", "radarState", "deviceState", "roadCameraState",
|
||||
"pandaStates", "carParams", "driverMonitoringState", "sensorEvents", "carState", "liveLocationKalman",
|
||||
"pandaStates", "carParams", "sensorEvents", "carState", "liveLocationKalman",
|
||||
"wideRoadCameraState", "managerState", "navInstruction", "navRoute",
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user