mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-08-21 08:14:00 +08:00
Kilometers per hour now displayed as km/h (#2032)
Fixes #2031 Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com> old-commit-hash: 1b52930a52828b1423c59c677c9b42a5ff76125c
This commit is contained in:
@@ -176,7 +176,7 @@ class EngagementAlert(Alert):
|
||||
|
||||
def below_steer_speed_alert(CP, sm, metric):
|
||||
speed = int(round(CP.minSteerSpeed * (CV.MS_TO_KPH if metric else CV.MS_TO_MPH)))
|
||||
unit = "kph" if metric else "mph"
|
||||
unit = "km/h" if metric else "mph"
|
||||
return Alert(
|
||||
"TAKE CONTROL",
|
||||
"Steer Unavailable Below %d %s" % (speed, unit),
|
||||
@@ -185,7 +185,7 @@ def below_steer_speed_alert(CP, sm, metric):
|
||||
|
||||
def calibration_incomplete_alert(CP, sm, metric):
|
||||
speed = int(Filter.MIN_SPEED * (CV.MS_TO_KPH if metric else CV.MS_TO_MPH))
|
||||
unit = "kph" if metric else "mph"
|
||||
unit = "km/h" if metric else "mph"
|
||||
return Alert(
|
||||
"Calibration in Progress: %d%%" % sm['liveCalibration'].calPerc,
|
||||
"Drive Above %d %s" % (speed, unit),
|
||||
|
||||
@@ -516,7 +516,7 @@ static void ui_draw_vision_speed(UIState *s) {
|
||||
|
||||
snprintf(speed_str, sizeof(speed_str), "%d", (int)speed);
|
||||
ui_draw_text(s->vg, viz_speed_x + viz_speed_w / 2, 240, speed_str, 96*2.5, COLOR_WHITE, s->font_sans_bold);
|
||||
ui_draw_text(s->vg, viz_speed_x + viz_speed_w / 2, 320, s->is_metric?"kph":"mph", 36*2.5, COLOR_WHITE_ALPHA(200), s->font_sans_regular);
|
||||
ui_draw_text(s->vg, viz_speed_x + viz_speed_w / 2, 320, s->is_metric?"km/h":"mph", 36*2.5, COLOR_WHITE_ALPHA(200), s->font_sans_regular);
|
||||
}
|
||||
|
||||
static void ui_draw_vision_event(UIState *s) {
|
||||
|
||||
Reference in New Issue
Block a user