int gap_mazda = carState.pcmCruiseGap();
This commit is contained in:
parent
b62fab754f
commit
f0564736a9
@ -2212,10 +2212,10 @@ public:
|
|||||||
auto carState = sm["carState"].getCarState();
|
auto carState = sm["carState"].getCarState();
|
||||||
|
|
||||||
// 显示巡航设定速度(km/h)
|
// 显示巡航设定速度(km/h)
|
||||||
float setSpeed = carState.getCruiseState().getSpeed() * 3.6; // 转换为 km/h
|
float setSpeed = carState.getCruiseState().getSpeed() * 3.64428; // 转换为 km/h
|
||||||
sprintf(gap_str, "%.0f", setSpeed);
|
sprintf(gap_str, "%.0f", setSpeed);
|
||||||
ui_draw_text(s, dx, dy, gap_str, 40, COLOR_WHITE, BOLD);
|
ui_draw_text(s, dx, dy, gap_str, 40, COLOR_WHITE, BOLD);
|
||||||
//int gap = carState.getCruiseState().pcmCruiseGap();
|
int gap_mazda = carState.pcmCruiseGap(); //int gap_mazda = carState.getPcmCruiseGap();
|
||||||
gap_last = gap;
|
gap_last = gap;
|
||||||
|
|
||||||
dx = bx + 300 - 30;
|
dx = bx + 300 - 30;
|
||||||
@ -2225,7 +2225,7 @@ public:
|
|||||||
#ifdef __UI_TEST
|
#ifdef __UI_TEST
|
||||||
gap = 4;
|
gap = 4;
|
||||||
#endif
|
#endif
|
||||||
for (int i = 0; i < gap; i++) {
|
for (int i = 0; i < gap_mazda; i++) {
|
||||||
//ui_fill_rect(s->vg, { (int)(dx + i * ddx), (int)dy, (int)ddx - 2, 48 }, COLOR_GREEN_ALPHA(180), 4, 3);
|
//ui_fill_rect(s->vg, { (int)(dx + i * ddx), (int)dy, (int)ddx - 2, 48 }, COLOR_GREEN_ALPHA(180), 4, 3);
|
||||||
ui_fill_rect(s->vg, { (int)(dx), (int)(dy - ddy*(i+1) + 2), (int)70, (int)ddy-2}, COLOR_GREEN_ALPHA(210), 4, 3, &white_color);
|
ui_fill_rect(s->vg, { (int)(dx), (int)(dy - ddy*(i+1) + 2), (int)70, (int)ddy-2}, COLOR_GREEN_ALPHA(210), 4, 3, &white_color);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user