mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-23 23:12:04 +08:00
nav: show warning for routing problems (#29055)
* all my debugging stuff * this works * add comment * bb navd * navInstruction is valid when we get a non-empty route response * now don't need this * stash * big cleanup * clean up * clean up * debug * final clean up * one line * flip order * update translations * is this simpler?
This commit is contained in:
@@ -211,7 +211,14 @@ void MapWindow::updateState(const UIState &s) {
|
||||
}
|
||||
initLayers();
|
||||
|
||||
setError(locationd_valid ? "" : tr("Waiting for GPS"));
|
||||
if (!locationd_valid) {
|
||||
setError(tr("Waiting for GPS"));
|
||||
} else if (routing_problem) {
|
||||
setError(tr("Waiting for internet"));
|
||||
} else {
|
||||
setError("");
|
||||
}
|
||||
|
||||
if (locationd_valid) {
|
||||
// Update current location marker
|
||||
auto point = coordinate_to_collection(*last_position);
|
||||
@@ -236,6 +243,12 @@ void MapWindow::updateState(const UIState &s) {
|
||||
}
|
||||
|
||||
if (sm.updated("navInstruction")) {
|
||||
// an invalid navInstruction packet with a nav destination is only possible if:
|
||||
// - API exception/no internet
|
||||
// - route response is empty
|
||||
auto dest = coordinate_from_param("NavDestination");
|
||||
routing_problem = !sm.valid("navInstruction") && dest.has_value();
|
||||
|
||||
if (sm.valid("navInstruction")) {
|
||||
auto i = sm["navInstruction"].getNavInstruction();
|
||||
map_eta->updateETA(i.getTimeRemaining(), i.getTimeRemainingTypical(), i.getDistanceRemaining());
|
||||
@@ -393,6 +406,7 @@ void MapWindow::offroadTransition(bool offroad) {
|
||||
if (offroad) {
|
||||
clearRoute();
|
||||
uiState()->scene.navigate_on_openpilot = false;
|
||||
routing_problem = false;
|
||||
} else {
|
||||
auto dest = coordinate_from_param("NavDestination");
|
||||
emit requestVisible(dest.has_value());
|
||||
|
||||
@@ -101,6 +101,7 @@ private:
|
||||
std::optional<float> last_bearing;
|
||||
FirstOrderFilter velocity_filter;
|
||||
bool locationd_valid = false;
|
||||
bool routing_problem = false;
|
||||
|
||||
QWidget *map_overlay;
|
||||
QLabel *error;
|
||||
|
||||
@@ -403,6 +403,10 @@
|
||||
<source>Waiting for GPS</source>
|
||||
<translation>Warten auf GPS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Waiting for internet</source>
|
||||
<translation type="unfinished">Auf Internet warten</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MultiOptionDialog</name>
|
||||
|
||||
@@ -402,6 +402,10 @@
|
||||
<source>Waiting for GPS</source>
|
||||
<translation>GPS信号を探しています</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Waiting for internet</source>
|
||||
<translation type="unfinished">インターネット接続を待機中</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MultiOptionDialog</name>
|
||||
|
||||
@@ -402,6 +402,10 @@
|
||||
<source>Waiting for GPS</source>
|
||||
<translation>GPS 수신중</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Waiting for internet</source>
|
||||
<translation type="unfinished">인터넷 대기중</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MultiOptionDialog</name>
|
||||
|
||||
@@ -403,6 +403,10 @@
|
||||
<source>Waiting for GPS</source>
|
||||
<translation>Esperando por GPS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Waiting for internet</source>
|
||||
<translation type="unfinished">Esperando pela internet</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MultiOptionDialog</name>
|
||||
|
||||
@@ -402,6 +402,10 @@
|
||||
<source>Waiting for GPS</source>
|
||||
<translation>等待 GPS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Waiting for internet</source>
|
||||
<translation type="unfinished">等待网络连接</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MultiOptionDialog</name>
|
||||
|
||||
@@ -402,6 +402,10 @@
|
||||
<source>Waiting for GPS</source>
|
||||
<translation>等待 GPS</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Waiting for internet</source>
|
||||
<translation type="unfinished">連接至網路中</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MultiOptionDialog</name>
|
||||
|
||||
Reference in New Issue
Block a user