Skip to content

Commit

Permalink
Update ui.c (commaai#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
berno22 authored and kegman committed Feb 25, 2019
1 parent aaa17b1 commit 7864c75
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions selfdrive/ui/ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ static void bb_ui_draw_measures_left(UIState *s, int bb_x, int bb_y, int bb_w )
val_color = nvgRGBA(255, 0, 0, 200);
}
// temp is alway in C * 10
snprintf(val_str, sizeof(val_str), "%d C", (int)(scene->maxCpuTemp/10));
snprintf(val_str, sizeof(val_str), "%d°C", (int)(scene->maxCpuTemp/10));
snprintf(uom_str, sizeof(uom_str), "");
bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "CPU TEMP",
bb_rx, bb_ry, bb_uom_dx,
Expand All @@ -1088,7 +1088,7 @@ static void bb_ui_draw_measures_left(UIState *s, int bb_x, int bb_y, int bb_w )
val_color = nvgRGBA(255, 0, 0, 200);
}
// temp is alway in C * 1000
snprintf(val_str, sizeof(val_str), "%d C", (int)(scene->maxBatTemp/1000));
snprintf(val_str, sizeof(val_str), "%d°C", (int)(scene->maxBatTemp/1000));
snprintf(uom_str, sizeof(uom_str), "");
bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "BAT TEMP",
bb_rx, bb_ry, bb_uom_dx,
Expand Down Expand Up @@ -1137,7 +1137,7 @@ static void bb_ui_draw_measures_left(UIState *s, int bb_x, int bb_y, int bb_w )
snprintf(val_str, sizeof(val_str), "%.1f", s->scene.freeSpace* 100);
snprintf(uom_str, sizeof(uom_str), "%%");

bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "FREE",
bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "FREE SPACE",
bb_rx, bb_ry, bb_uom_dx,
val_color, lab_color, uom_color,
value_fontSize, label_fontSize, uom_fontSize );
Expand Down Expand Up @@ -1220,7 +1220,7 @@ static void bb_ui_draw_measures_right(UIState *s, int bb_x, int bb_y, int bb_w )
} else {
snprintf(uom_str, sizeof(uom_str), "mph");
}
bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "REL SPD",
bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "REL SPEED",
bb_rx, bb_ry, bb_uom_dx,
val_color, lab_color, uom_color,
value_fontSize, label_fontSize, uom_fontSize );
Expand All @@ -1241,10 +1241,10 @@ static void bb_ui_draw_measures_right(UIState *s, int bb_x, int bb_y, int bb_w )
val_color = nvgRGBA(255, 0, 0, 200);
}
// steering is in degrees
snprintf(val_str, sizeof(val_str), "%.1f",(scene->angleSteers));
snprintf(val_str, sizeof(val_str), "%.1f°",(scene->angleSteers));

snprintf(uom_str, sizeof(uom_str), "deg");
bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "STEER",
snprintf(uom_str, sizeof(uom_str), "");
bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "ACTUAL STEER",
bb_rx, bb_ry, bb_uom_dx,
val_color, lab_color, uom_color,
value_fontSize, label_fontSize, uom_fontSize );
Expand All @@ -1265,10 +1265,10 @@ static void bb_ui_draw_measures_right(UIState *s, int bb_x, int bb_y, int bb_w )
val_color = nvgRGBA(255, 0, 0, 200);
}
// steering is in degrees
snprintf(val_str, sizeof(val_str), "%.1f",(scene->angleSteersDes));
snprintf(val_str, sizeof(val_str), "%.1f°",(scene->angleSteersDes));

snprintf(uom_str, sizeof(uom_str), "deg");
bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "DES STEER",
snprintf(uom_str, sizeof(uom_str), "");
bb_h +=bb_ui_draw_measure(s, val_str, uom_str, "DESIR STEER",
bb_rx, bb_ry, bb_uom_dx,
val_color, lab_color, uom_color,
value_fontSize, label_fontSize, uom_fontSize );
Expand Down Expand Up @@ -1439,7 +1439,7 @@ static void ui_draw_vision_maxspeed(UIState *s) {
nvgFontFace(s->vg, "sans-semibold");
nvgFontSize(s->vg, 42*2.5);
nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 100));
nvgText(s->vg, viz_maxspeed_x+(viz_maxspeed_xo/2)+(viz_maxspeed_w/2), 242, "N/A", NULL);
nvgText(s->vg, viz_maxspeed_x+(viz_maxspeed_xo/2)+(viz_maxspeed_w/2), 242, "-", NULL);
}

//BB START: add new measures panel const int bb_dml_w = 180;
Expand Down Expand Up @@ -1539,7 +1539,7 @@ static void ui_draw_vision_speedlimit(UIState *s) {
} else {
nvgFontFace(s->vg, "sans-semibold");
nvgFontSize(s->vg, 42*2.5);
nvgText(s->vg, viz_speedlim_x+viz_speedlim_w/2, viz_speedlim_y + (is_speedlim_valid ? 170 : 165), "N/A", NULL);
nvgText(s->vg, viz_speedlim_x+viz_speedlim_w/2, viz_speedlim_y + (is_speedlim_valid ? 170 : 165), "-", NULL);
}
}

Expand Down

0 comments on commit 7864c75

Please sign in to comment.