Align End to End Previews and Translations

This commit is contained in:
firestar5683
2026-11-28 15:25:14 -06:00
parent 61c03b6fdc
commit db8c0babf3
8 changed files with 19 additions and 4 deletions
@@ -23517,3 +23517,5 @@ msgstr "Lenkung und Tasten"
msgid "Storage & Account"
msgstr "Speicher und Konto"
msgid "End to End"
msgstr "End-to-End"
@@ -23517,3 +23517,5 @@ msgstr "Dirección y botones"
msgid "Storage & Account"
msgstr "Almacenamiento y cuenta"
msgid "End to End"
msgstr "De extremo a extremo"
@@ -23517,3 +23517,5 @@ msgstr "Direction et boutons"
msgid "Storage & Account"
msgstr "Stockage et compte"
msgid "End to End"
msgstr "De bout en bout"
@@ -23513,3 +23513,5 @@ msgstr "ステアリングとボタン"
msgid "Storage & Account"
msgstr "ストレージとアカウント"
msgid "End to End"
msgstr "エンドツーエンド"
@@ -23513,3 +23513,5 @@ msgstr "조향 및 버튼"
msgid "Storage & Account"
msgstr "저장 공간 및 계정"
msgid "End to End"
msgstr "엔드투엔드"
@@ -23513,3 +23513,5 @@ msgstr "Đánh lái và nút bấm"
msgid "Storage & Account"
msgstr "Bộ nhớ và tài khoản"
msgid "End to End"
msgstr "Đầu cuối toàn trình"
@@ -22,16 +22,18 @@ export const PREVIEW_SCENES = [
{ id: "slc_display", label: "Display-only speed limit" },
]
const SCENES = PREVIEW_SCENES.map(({ id }) => id)
const E2E_PREVIEW_REASONS = { cem_stop_light: "Stopping", cem_lead: "Lead vehicle", cem_curve: "Curve" }
// Keep the sketch and its eye controls aligned with sample_state and the native onroad view.
export function previewScene(scene) {
const off = scene === "slc_disengaged"
const lateral = !off && scene !== "long_only"
const longitudinal = !off && scene !== "aol"
const experimental = scene === "experimental" || scene.startsWith("cem_")
const slowdown = E2E_PREVIEW_REASONS[scene]
const experimental = scene === "experimental" || Boolean(slowdown)
return { lateral, longitudinal, experimental,
border: off ? "#122839" : scene === "slc_pedal" ? "#919b95" : scene.startsWith("cem_") ? "#da6f25" : !longitudinal ? "#0abab5" : !lateral ? "#ff69b4" : "#167f40",
mode: off ? "Disengaged" : scene === "slc_pedal" ? "ACC - Override" : !longitudinal ? "Always On Lateral" : experimental ? "ACC - End to End" : "ACC - Chill" }
border: off ? "#122839" : scene === "slc_pedal" ? "#919b95" : slowdown ? "#da6f25" : !longitudinal ? "#0abab5" : !lateral ? "#ff69b4" : "#167f40",
mode: off ? "Disengaged" : scene === "slc_pedal" ? "ACC - Override" : !longitudinal ? "Always On Lateral" : slowdown ? `E2E · ${slowdown}` : experimental ? "ACC - End to End" : "ACC - Chill" }
}
export function sceneHidesWidget(scene, profile, id, layout = {}, widgets = {}, sprites = {}) {
@@ -37,6 +37,7 @@ from openpilot.system.ui.lib.shader_polygon import Gradient, draw_polygon
CEM_SCENE_REASONS = {"cem_stop_light": "STOP LIGHT", "cem_lead": "LEAD", "cem_curve": "CURVE"}
E2E_PREVIEW_REASONS = {"cem_stop_light": "Stopping", "cem_lead": "Lead vehicle", "cem_curve": "Curve"}
IDLE_SECONDS = 30.0
MAX_SHEET_WIDTH = 2048
ASSET_DIRECTORY = Path(__file__).parents[2] / "selfdrive/assets"
@@ -103,7 +104,7 @@ def sample_state(scene: str, document: dict) -> OnroadState:
longitudinal_active=longitudinal, stock_cruise_active=False,
lead_detected=True, gas_pressed_override=scene == 'slc_pedal',
slc_system_long_available=longitudinal, slc_wheel_confirmation_available=longitudinal, torque_utilization=0.78 if lateral else 0.0,
customization=document,
customization=document, e2e_slowdown=E2E_PREVIEW_REASONS.get(scene),
slc_prompt_open=scene == 'slc_pending',
visual_preview=OnroadVisualPreview(cem_reason=CEM_SCENE_REASONS[scene], layout_sample=True) if scene in CEM_SCENE_REASONS else None)