mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-15 14:22:11 +08:00
sidebar: indicator for GPS fix (#21556)
* sidebar: indicator for GPS fix * fix cutoff old-commit-hash: a2f9259ebf2fb3c98dc560221e0f33f20955d825
This commit is contained in:
@@ -25,7 +25,7 @@ void Sidebar::drawMetric(QPainter &p, const QString &label, const QString &val,
|
||||
p.setPen(QColor(0xff, 0xff, 0xff));
|
||||
if (val.isEmpty()) {
|
||||
configFont(p, "Open Sans", 35, "Bold");
|
||||
const QRect r = QRect(rect.x() + 35, rect.y(), rect.width() - 50, rect.height());
|
||||
const QRect r = QRect(rect.x() + 30, rect.y(), rect.width() - 40, rect.height());
|
||||
p.drawText(r, Qt::AlignCenter, label);
|
||||
} else {
|
||||
configFont(p, "Open Sans", 58, "Bold");
|
||||
@@ -85,6 +85,9 @@ void Sidebar::updateState(const UIState &s) {
|
||||
if (s.scene.pandaType == cereal::PandaState::PandaType::UNKNOWN) {
|
||||
pandaStatus = danger_color;
|
||||
pandaStr = "NO\nPANDA";
|
||||
} else if (!sm["liveLocationKalman"].getLiveLocationKalman().getGpsOK()) {
|
||||
pandaStatus = warning_color;
|
||||
pandaStr = "GPS\nSEARCHING";
|
||||
}
|
||||
setProperty("pandaStr", pandaStr);
|
||||
setProperty("pandaStatus", pandaStatus);
|
||||
|
||||
+1
-7
@@ -168,12 +168,6 @@ static void update_state(UIState *s) {
|
||||
} else if ((s->sm->frame - s->sm->rcv_frame("pandaState")) > 5*UI_FREQ) {
|
||||
scene.pandaType = cereal::PandaState::PandaType::UNKNOWN;
|
||||
}
|
||||
if (sm.updated("ubloxGnss")) {
|
||||
auto data = sm["ubloxGnss"].getUbloxGnss();
|
||||
if (data.which() == cereal::UbloxGnss::MEASUREMENT_REPORT) {
|
||||
scene.satelliteCount = data.getMeasurementReport().getNumMeas();
|
||||
}
|
||||
}
|
||||
if (sm.updated("carParams")) {
|
||||
scene.longitudinal_control = sm["carParams"].getCarParams().getOpenpilotLongitudinalControl();
|
||||
}
|
||||
@@ -278,7 +272,7 @@ static void update_status(UIState *s) {
|
||||
QUIState::QUIState(QObject *parent) : QObject(parent) {
|
||||
ui_state.sm = std::make_unique<SubMaster, const std::initializer_list<const char *>>({
|
||||
"modelV2", "controlsState", "liveCalibration", "radarState", "deviceState", "roadCameraState",
|
||||
"pandaState", "carParams", "driverMonitoringState", "sensorEvents", "carState", "ubloxGnss",
|
||||
"pandaState", "carParams", "driverMonitoringState", "sensorEvents", "carState", "liveLocationKalman",
|
||||
});
|
||||
|
||||
ui_state.fb_w = vwp_w;
|
||||
|
||||
@@ -83,9 +83,6 @@ typedef struct UIScene {
|
||||
|
||||
cereal::PandaState::PandaType pandaType;
|
||||
|
||||
// gps
|
||||
int satelliteCount;
|
||||
|
||||
// modelV2
|
||||
float lane_line_probs[4];
|
||||
float road_edge_stds[2];
|
||||
|
||||
Reference in New Issue
Block a user