This commit is contained in:
机械小鸽 2025-06-14 16:03:07 +08:00 committed by GitHub
parent 0f8a46cfd6
commit ea23209348
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
37 changed files with 19 additions and 19 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -219,8 +219,8 @@ static inline void fill_rect(NVGcontext* vg, const Rect1& r, const NVGcolor* col
if (stroke_width > 0) { if (stroke_width > 0) {
nvgStrokeWidth(vg, stroke_width); nvgStrokeWidth(vg, stroke_width);
if (stroke_color) nvgStrokeColor(vg, *stroke_color); if (stroke_color) nvgStrokeColor(vg, *stroke_color);
else nvgStrokeColor(vg, nvgRGB(0, 0, 0)); else nvgStrokeColor(vg, nvgRGB(0, 0, 0));
nvgStroke(vg); nvgStroke(vg);
} }
} }
@ -696,11 +696,11 @@ public:
else if (longActive) { else if (longActive) {
if (xState == 3 || xState == 5) { //XState.e2eStop, XState.e2eStopped if (xState == 3 || xState == 5) { //XState.e2eStop, XState.e2eStopped
if (v_ego < 1.0) { if (v_ego < 1.0) {
sprintf(str, "%s", (trafficState >= 1000) ? "신호오류" : "신호대기"); sprintf(str, "%s", (trafficState >= 1000) ? "信号错误" : "信号等待");
ui_draw_text(s, x, disp_y, str, disp_size, COLOR_WHITE, BOLD); ui_draw_text(s, x, disp_y, str, disp_size, COLOR_WHITE, BOLD);
} }
else { else {
ui_draw_text(s, x, disp_y, "신호감속중", disp_size, COLOR_WHITE, BOLD); ui_draw_text(s, x, disp_y, "信号减速中", disp_size, COLOR_WHITE, BOLD);
} }
#if 0 #if 0
else if (getStopDist() > 0.5) { else if (getStopDist() > 0.5) {
@ -712,7 +712,7 @@ public:
#endif #endif
} }
else if (xState == 4) { //XState.e2ePrepare else if (xState == 4) { //XState.e2ePrepare
ui_draw_text(s, x, disp_y, "E2E주행중", disp_size, COLOR_WHITE, BOLD); ui_draw_text(s, x, disp_y, "E2E模式", disp_size, COLOR_WHITE, BOLD);
} }
else if (xState == 0 || xState == 1 || xState == 2) { //XState.lead else if (xState == 0 || xState == 1 || xState == 2) { //XState.lead
draw_dist = true; draw_dist = true;
@ -1028,17 +1028,17 @@ protected:
ui_draw_text(s, bx, by + 25 * scale - 6 * (1 - scale), str, 60 * scale, COLOR_BLACK, BOLD, 0.0f, 0.0f); ui_draw_text(s, bx, by + 25 * scale - 6 * (1 - scale), str, 60 * scale, COLOR_BLACK, BOLD, 0.0f, 0.0f);
} }
} }
} }
int drawTurnInfoHud(const UIState* s) { int drawTurnInfoHud(const UIState* s) {
if (s->fb_w < 1200) return -1; if (s->fb_w < 1200) return -1;
#ifdef __UI_TEST #ifdef __UI_TEST
active_carrot = 2; active_carrot = 2;
nGoPosDist = 500000; nGoPosDist = 500000;
nGoPosTime = 4 * 60 * 60; nGoPosTime = 4 * 60 * 60;
szSdiDescr = "어린이 보호구역(스쿨존 시작 구간)"; szSdiDescr = "儿童保护区域(学校区域起始路段)";
xTurnInfo = 1; xTurnInfo = 1;
xDistToTurn = 1000; xDistToTurn = 1000;
szPosRoadName = "구문천 1길 17"; szPosRoadName = "九文川1街17号";
#endif #endif
//if (active_carrot <= 1) return; //if (active_carrot <= 1) return;
@ -1080,9 +1080,9 @@ protected:
case 4: ui_draw_image(s, { bx - icon_size / 2, by - icon_size / 2, icon_size, icon_size }, "ic_lane_change_r", 1.0f); break; case 4: ui_draw_image(s, { bx - icon_size / 2, by - icon_size / 2, icon_size, icon_size }, "ic_lane_change_r", 1.0f); break;
case 7: ui_draw_image(s, { bx - icon_size / 2, by - icon_size / 2, icon_size, icon_size }, "ic_turn_u", 1.0f); break; case 7: ui_draw_image(s, { bx - icon_size / 2, by - icon_size / 2, icon_size, icon_size }, "ic_turn_u", 1.0f); break;
case 6: ui_draw_text(s, bx, by + 20, "TG", 35, COLOR_WHITE, BOLD); break; case 6: ui_draw_text(s, bx, by + 20, "TG", 35, COLOR_WHITE, BOLD); break;
case 8: ui_draw_text(s, bx, by + 20, "목적지", 35, COLOR_WHITE, BOLD); break; case 8: ui_draw_text(s, bx, by + 20, "目的地", 35, COLOR_WHITE, BOLD); break;
default: default:
sprintf(str, "감속:%d", xTurnInfo); sprintf(str, "减速:%d", xTurnInfo);
ui_draw_text(s, bx, by + 20, str, 35, COLOR_WHITE, BOLD); ui_draw_text(s, bx, by + 20, str, 35, COLOR_WHITE, BOLD);
break; break;
} }
@ -1111,7 +1111,7 @@ protected:
int remaining_minutes = (int)nGoPosTime / 60; int remaining_minutes = (int)nGoPosTime / 60;
local->tm_min += remaining_minutes; local->tm_min += remaining_minutes;
mktime(local); mktime(local);
sprintf(str, "도착: %.1f분(%02d:%02d)", (float)nGoPosTime / 60., local->tm_hour, local->tm_min); sprintf(str, "到达: %.1f分(%02d:%02d)", (float)nGoPosTime / 60., local->tm_hour, local->tm_min);
ui_draw_text(s, tbt_x + 190, tbt_y + 80, str, 50, COLOR_WHITE, BOLD); ui_draw_text(s, tbt_x + 190, tbt_y + 80, str, 50, COLOR_WHITE, BOLD);
sprintf(str, "%.1fkm", nGoPosDist / 1000.); sprintf(str, "%.1fkm", nGoPosDist / 1000.);
ui_draw_text(s, tbt_x + 190 + 120, tbt_y + 130, str, 50, COLOR_WHITE, BOLD); ui_draw_text(s, tbt_x + 190 + 120, tbt_y + 130, str, 50, COLOR_WHITE, BOLD);
@ -1127,7 +1127,7 @@ public:
return -1; return -1;
} }
const auto carrot_man = sm["carrotMan"].getCarrotMan(); const auto carrot_man = sm["carrotMan"].getCarrotMan();
active_carrot = carrot_man.getActiveCarrot(); active_carrot = carrot_man.getActiveCarrot();
if (active_carrot > 1) { if (active_carrot > 1) {
@ -1151,7 +1151,7 @@ public:
szSdiDescr = QString::fromStdString(carrot_man.getSzSdiDescr()); szSdiDescr = QString::fromStdString(carrot_man.getSzSdiDescr());
szPosRoadName = QString::fromStdString(carrot_man.getSzPosRoadName()); szPosRoadName = QString::fromStdString(carrot_man.getSzPosRoadName());
szTBTMainText = QString::fromStdString(carrot_man.getSzTBTMainText()); szTBTMainText = QString::fromStdString(carrot_man.getSzTBTMainText());
} }
else { else {
//xTurnInfo = -1; //xTurnInfo = -1;
@ -1930,7 +1930,7 @@ public:
int max_z = lane_lines[2].getZ().size(); int max_z = lane_lines[2].getZ().size();
float z_offset = 0.0; float z_offset = 0.0;
foreach(const QString & pair, pairs) { foreach(const QString & pair, pairs) {
QStringList xy = pair.split(","); // ","로 x와 y 구분 QStringList xy = pair.split(","); // ","로 x와 y 구분
if (xy.size() == 3) { if (xy.size() == 3) {
//printf("coords = x: %.1f, y: %.1f, d:%.1f\n", xy[0].toFloat(), xy[1].toFloat(), xy[2].toFloat()); //printf("coords = x: %.1f, y: %.1f, d:%.1f\n", xy[0].toFloat(), xy[1].toFloat(), xy[2].toFloat());
float x = xy[0].toFloat(); float x = xy[0].toFloat();
@ -2114,7 +2114,7 @@ public:
void drawHud(UIState* s) { void drawHud(UIState* s) {
int show_device_state = params.getInt("ShowDeviceState"); int show_device_state = params.getInt("ShowDeviceState");
blink_timer = (blink_timer + 1) % 16; blink_timer = (blink_timer + 1) % 16;
disp_timer = (disp_timer + 1) % 64; disp_timer = (disp_timer + 1) % 64;
nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BOTTOM); nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BOTTOM);
int x = 140;// 120; int x = 140;// 120;
@ -2195,7 +2195,7 @@ public:
const SubMaster& sm = *(s->sm); const SubMaster& sm = *(s->sm);
// draw gap info // draw gap info
char driving_mode_str[32] = "연비"; char driving_mode_str[32] = "经济";
int driving_mode = myDrivingMode;// params.getInt("MyDrivingMode"); int driving_mode = myDrivingMode;// params.getInt("MyDrivingMode");
NVGcolor mode_color = COLOR_GREEN_ALPHA(210); NVGcolor mode_color = COLOR_GREEN_ALPHA(210);
NVGcolor text_color = COLOR_WHITE; NVGcolor text_color = COLOR_WHITE;
@ -2365,7 +2365,7 @@ public:
} }
if (show_datetime == 1 || show_datetime == 3) { if (show_datetime == 1 || show_datetime == 3) {
//strftime(str, sizeof(str), "%m-%d-%a", local); //strftime(str, sizeof(str), "%m-%d-%a", local);
const char* weekdays_ko[] = { "", "", "", "", "", "", "" }; const char* weekdays_ko[] = { "", "", "", "", "", "", "" };
strftime(str, sizeof(str), "%m-%d", local); // 날짜만 가져옴 strftime(str, sizeof(str), "%m-%d", local); // 날짜만 가져옴
int weekday_index = local->tm_wday; // tm_wday: 0=일, 1=월, ..., 6=토 int weekday_index = local->tm_wday; // tm_wday: 0=일, 1=월, ..., 6=토
snprintf(str + strlen(str), sizeof(str) - strlen(str), "(%s)", weekdays_ko[weekday_index]); snprintf(str + strlen(str), sizeof(str) - strlen(str), "(%s)", weekdays_ko[weekday_index]);
@ -2663,7 +2663,7 @@ void ui_draw(UIState *s, ModelRenderer* model_renderer, int w, int h) {
int path_x = drawPathEnd.getPathX(); int path_x = drawPathEnd.getPathX();
int path_y = drawPathEnd.getPathY(); int path_y = drawPathEnd.getPathY();
drawDesire.draw(s, path_x, path_y - 135); drawDesire.draw(s, path_x, path_y - 135);
drawPlot.draw(s); drawPlot.draw(s);

View File

@ -130,7 +130,7 @@ class Soundd:
if self.lang == "main_ko": if self.lang == "main_ko":
wavefile = wave.open(BASEDIR + "/selfdrive/assets/sounds/" + filename, 'r') wavefile = wave.open(BASEDIR + "/selfdrive/assets/sounds/" + filename, 'r')
else: else:
wavefile = wave.open(BASEDIR + "/selfdrive/assets/sounds_eng/" + filename, 'r') wavefile = wave.open(BASEDIR + "/selfdrive/assets/sounds_chs/" + filename, 'r')
#assert wavefile.getnchannels() == 1 #assert wavefile.getnchannels() == 1
assert wavefile.getsampwidth() == 2 assert wavefile.getsampwidth() == 2