mirror of
https://github.com/herizon1054/openpilot.git
synced 2026-06-08 11:05:03 +08:00
360 lines
13 KiB
Python
360 lines
13 KiB
Python
try:
|
||
from dragonpilot.system.ui.lib.multilang import tr
|
||
except:
|
||
from openpilot.system.ui.lib.multilang import tr
|
||
|
||
SETTINGS = [
|
||
{
|
||
"title": "Honda / Acura",
|
||
"condition": "brand == 'honda'",
|
||
"settings": [
|
||
{
|
||
"key": "dp_honda_nidec_stock_long",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Nidec: Use Stock Longitudinal Control"),
|
||
"description": lambda: tr("Use Honda's factory ACC for gas/brake control instead of openpilot. openpilot will only control steering. Requires reboot to take effect."),
|
||
"brands": ["honda"],
|
||
},
|
||
],
|
||
},
|
||
{
|
||
"title": "Toyota / Lexus",
|
||
"condition": "brand == 'toyota'",
|
||
"settings": [
|
||
{
|
||
"key": "dp_toyota_door_auto_lock_unlock",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Door Auto Lock/Unlock"),
|
||
"description": lambda: tr("Enable openpilot to auto-lock doors above 20 km/h and auto-unlock when shifting to Park."),
|
||
},
|
||
{
|
||
"key": "dp_toyota_tss1_sng",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Enable TSS1 SnG Mod"),
|
||
"description": ""
|
||
},
|
||
{
|
||
"key": "dp_toyota_stock_lon",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Use Stock Longitudinal Control"),
|
||
"description": ""
|
||
},
|
||
],
|
||
},
|
||
{
|
||
"title": "VAG",
|
||
"condition": "brand == 'volkswagen'",
|
||
"settings": [
|
||
{
|
||
"key": "dp_vag_a0_sng",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("MQB A0 SnG Mod"),
|
||
"description": ""
|
||
},
|
||
{
|
||
"key": "dp_vag_pq_steering_patch",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("PQ Steering Patch"),
|
||
"description": "",
|
||
},
|
||
{
|
||
"key": "dp_vag_avoid_eps_lockout",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Avoid EPS Lockout"),
|
||
"description": ""
|
||
},
|
||
],
|
||
},
|
||
{
|
||
"title": "Mazda",
|
||
"condition": "brand == 'mazda'",
|
||
"settings": [
|
||
],
|
||
},
|
||
{
|
||
"title": "Lateral",
|
||
"settings": [
|
||
{
|
||
"key": "dp_lat_alka",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Always-on Lane Keeping Assist (ALKA)"),
|
||
"description": lambda: tr("Enable lateral control even when ACC/cruise is disengaged, using ACC Main or LKAS button to toggle. Vehicle must be moving."),
|
||
#"brands": ["toyota", "hyundai", "honda", "volkswagen", "subaru", "mazda", "nissan", "ford"],
|
||
},
|
||
{
|
||
"key": "dp_lat_lca_speed",
|
||
"type": "spin_button_item",
|
||
"title": lambda: tr("Lane Change Assist At:"),
|
||
"description": lambda: tr("Off = Disable LCA.<br>1 mph = 1.2 km/h."),
|
||
"default": 20,
|
||
"min_val": 0,
|
||
"max_val": 100,
|
||
"step": 5,
|
||
"suffix": lambda: tr("mph"),
|
||
"special_value_text": lambda: tr("Off"),
|
||
"on_change": [{
|
||
"target": "dp_lat_lca_auto_sec",
|
||
"action": "set_enabled",
|
||
"condition": "value > 0"
|
||
}]
|
||
},
|
||
{
|
||
"key": "dp_lat_lca_auto_sec",
|
||
"type": "double_spin_button_item",
|
||
"title": lambda: tr("+ Auto Lane Change after:"),
|
||
"description": lambda: tr("Off = Disable Auto Lane Change."),
|
||
"default": 0.0,
|
||
"min_val": 0.0,
|
||
"max_val": 5.0,
|
||
"step": 0.5,
|
||
"suffix": lambda: tr("sec"),
|
||
"special_value_text": lambda: tr("Off"),
|
||
"initially_enabled_by": {
|
||
"param": "dp_lat_lca_speed",
|
||
"condition": "value > 0",
|
||
"default": 20
|
||
}
|
||
},
|
||
{
|
||
"key": "dp_lat_road_edge_detection",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Road Edge Detection (RED)"),
|
||
"description": lambda: tr("Block lane change assist when the system detects the road edge.<br>NOTE: This will show 'Car Detected in Blindspot' warning."),
|
||
},
|
||
{
|
||
"key": "dp_htd_enabled",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Enable Human Turn Detection"),
|
||
"description": lambda: tr("Unavailable during cruise control.Automatically pause steering when the driver applies large manual steering input, then smoothly resume."),
|
||
# 移除了 default: True,現在預設為關閉 (False)
|
||
"on_change": [{
|
||
"target": "dp_htd_turn_angle_threshold",
|
||
"action": "set_enabled",
|
||
"condition": "value"
|
||
}]
|
||
},
|
||
{
|
||
"key": "dp_htd_turn_angle_threshold",
|
||
"type": "spin_button_item",
|
||
"title": lambda: tr("Trigger angle"),
|
||
"description": lambda: tr("Driver steering angle that triggers HTD (degrees)."),
|
||
"default": 90,
|
||
"min_val": 60,
|
||
"max_val": 120,
|
||
"step": 5,
|
||
"suffix": lambda: tr(" °"),
|
||
"initially_enabled_by": {
|
||
"param": "dp_htd_enabled",
|
||
"condition": "value == True",
|
||
"default": False # 這裡也對應設為 False,確保一開始是灰的
|
||
}
|
||
},
|
||
{
|
||
"key": "dp_lat_offset_cm",
|
||
"type": "spin_button_item",
|
||
"title": lambda: tr("Position Offset"),
|
||
"description": lambda: tr("Fine-tune where the car drives within the lane. Positive values move the car left, negative values move right.<br>Recommended to start with small values (±5cm) and adjust based on preference."),
|
||
"default": 0,
|
||
"min_val": -15,
|
||
"max_val": 15,
|
||
"step": 1,
|
||
"suffix": lambda: tr("cm"),
|
||
},
|
||
],
|
||
},
|
||
{
|
||
"title": "Longitudinal",
|
||
"settings": [
|
||
{
|
||
"key": "dp_lon_ocm",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Overtaking Coasting Mode (OCM)"),
|
||
"description": lambda: tr("Smoothly coast down to your set speed without engine braking when you exceed the cruise speed by 20 km/h after overtaking."),
|
||
},
|
||
{
|
||
"key": "dp_lon_aem",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Adaptive Experimental Mode (AEM)"),
|
||
"description": lambda: tr("Adaptive mode switcher between ACC and Blended based on driving context."),
|
||
},
|
||
{
|
||
"key": "dp_lon_dtsc",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Dynamic Turn Speed Control (DTSC)"),
|
||
"description": lambda: tr("DTSC automatically adjusts the vehicle's predicted speed based on upcoming road curvature and grip conditions.<br>Originally from the openpilot TACO branch."),
|
||
},
|
||
{
|
||
"key": "dp_lon_apm",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Adaptive Personality Mode (APM)"),
|
||
"description": lambda: tr("The mode automatically switches based on the vehicle in front. It is recommended to maintain the standard mode."),
|
||
},
|
||
{
|
||
"key": "dp_lon_dasr",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Dynamic Accel Slew Rate (DASR)"),
|
||
"description": lambda: tr("Speed-dependent acceleration smoothing. Allows faster accel changes at low speeds for responsive city driving, smoother changes at highway speeds for comfort."),
|
||
},
|
||
{
|
||
"key": "AccelPersonalityEnabled",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Dynamic Accel Personality"),
|
||
"description": lambda: tr("Dynamic acceleration switch"),
|
||
"on_change": [{
|
||
"target": "AccelPersonality",
|
||
"action": "set_enabled",
|
||
"condition": "value"
|
||
}]
|
||
},
|
||
{
|
||
"key": "AccelPersonality",
|
||
"type": "text_spin_button_item",
|
||
"title": lambda: tr("Accel Personality"),
|
||
"description": lambda: tr("Dynamic acceleration selection mode"),
|
||
"options": [
|
||
lambda: tr("Sport"),
|
||
lambda: tr("Normal"),
|
||
lambda: tr("Eco"),
|
||
],
|
||
},
|
||
],
|
||
},
|
||
{
|
||
"title": "UI",
|
||
"condition": "not MICI",
|
||
"settings": [
|
||
{
|
||
"key": "dp_ui_display_mode",
|
||
"type": "text_spin_button_item",
|
||
"title": lambda: tr("Display Mode"),
|
||
"description": lambda: tr("Std.: Stock behavior.<br>MAIN+: ACC MAIN on = Display ON.<br>OP+: OP enabled = Display ON.<br>MAIN-: ACC MAIN on = Display OFF<br>OP-: OP enabled = Display OFF."),
|
||
"default": 0,
|
||
"options": [
|
||
lambda: tr("Std."),
|
||
lambda: tr("MAIN+"),
|
||
lambda: tr("OP+"),
|
||
lambda: tr("MAIN-"),
|
||
lambda: tr("OP-"),
|
||
],
|
||
},
|
||
{
|
||
"key": "dp_ui_hide_hud_speed_kph",
|
||
"type": "spin_button_item",
|
||
"title": lambda: tr("Hide HUD When Moves above:"),
|
||
"description": lambda: tr("To prevent screen burn-in, hide Speed, MAX Speed, and Steering/DM Icons when the car moves.<br>Off = Stock Behavior<br>1 km/h = 0.6 mph"),
|
||
"default": 0,
|
||
"min_val": 0,
|
||
"max_val": 120,
|
||
"step": 5,
|
||
"suffix": lambda: tr("km/h"),
|
||
"special_value_text": lambda: tr("Off"),
|
||
},
|
||
{
|
||
"key": "dp_ui_rainbow",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Rainbow Driving Path like Tesla"),
|
||
"description": lambda: tr("Why not?"),
|
||
},
|
||
{
|
||
"key": "dp_ui_lead",
|
||
"type": "text_spin_button_item",
|
||
"title": lambda: tr("Display Lead Stats"),
|
||
"description": lambda: tr("Display the statistics of lead car and/or radar tracking points.<br>Lead: Lead stats only<br>Radar: Radar tracking point stats only<br>All: Lead and Radar stats<br>NOTE: Radar option only works on certain vehicle models."),
|
||
"default": 0,
|
||
"options": [
|
||
lambda: tr("Off"),
|
||
lambda: tr("Lead"),
|
||
lambda: tr("Radar"),
|
||
lambda: tr("All"),
|
||
],
|
||
},
|
||
{
|
||
"key": "dp_ui_mici",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Use MICI (comma four) UI"),
|
||
"description": lambda: tr("Why not?"),
|
||
},
|
||
],
|
||
},
|
||
{
|
||
"title": "Device",
|
||
"settings": [
|
||
{
|
||
"key": "dp_dev_is_rhd",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Enable Right-Hand Drive Mode"),
|
||
"description": lambda: tr("Allow openpilot to obey right-hand traffic conventions on right driver seat."),
|
||
"condition": "LITE",
|
||
},
|
||
{
|
||
"key": "dp_dev_beep",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Enable Beep (Warning)"),
|
||
"description": lambda: tr("Use Buzzer for audiable alerts."),
|
||
"condition": "LITE",
|
||
},
|
||
{
|
||
"key": "dp_lon_ext_radar",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Use External Radar"),
|
||
"description": lambda: tr("See https://github.com/eFiniLan/openpilot-ext-radar-addon for more information."),
|
||
},
|
||
{
|
||
"key": "dp_dev_audible_alert_mode",
|
||
"type": "text_spin_button_item",
|
||
"title": lambda: tr("Audible Alert"),
|
||
"description": lambda: tr("Std.: Stock behaviour.<br>Warning: Only emits sound when there is a warning.<br>Off: Does not emit any sound at all."),
|
||
"default": 0,
|
||
"options": [
|
||
lambda: tr("Std."),
|
||
lambda: tr("Warning"),
|
||
lambda: tr("Off"),
|
||
],
|
||
"condition": "not LITE",
|
||
},
|
||
{
|
||
"key": "dp_dev_auto_shutdown_in",
|
||
"type": "spin_button_item",
|
||
"title": lambda: tr("Auto Shutdown After"),
|
||
"description": lambda: tr("0 min = Immediately"),
|
||
"default": -5,
|
||
"min_val": -5,
|
||
"max_val": 300,
|
||
"step": 5,
|
||
"suffix": lambda: tr("min"),
|
||
"special_value_text": lambda: tr("Off"),
|
||
},
|
||
{
|
||
"key": "dp_dev_opview",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Enable opview"),
|
||
"description": lambda: tr("Broadcasts telemetry to the opview App (available on Android). Requires the companion App to be running on an external display."),
|
||
},
|
||
{
|
||
"key": "dp_dev_dashy",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("dashy HUD"),
|
||
"description": lambda: tr("dashy - dragonpilot's all-in-one system hub for you.<br><br>Visit http://<device_ip>:5088 to access.<br><br>Enable this to use Tesla HUD."),
|
||
},
|
||
{
|
||
"key": "dp_dev_delay_loggerd",
|
||
"type": "spin_button_item",
|
||
"title": lambda: tr("Delay Starting Loggerd for:"),
|
||
"description": lambda: tr("Delays the startup of loggerd and its related processes when the device goes on-road.<br>This prevents the initial moments of a drive from being recorded, protecting location privacy at the start of a trip."),
|
||
"default": 0,
|
||
"min_val": 0,
|
||
"max_val": 300,
|
||
"step": 5,
|
||
"suffix": lambda: tr("sec"),
|
||
"special_value_text": lambda: tr("Off"),
|
||
},
|
||
{
|
||
"key": "dp_dev_disable_connect",
|
||
"type": "toggle_item",
|
||
"title": lambda: tr("Disable Comma Connect"),
|
||
"description": lambda: tr("Disable Comma connect service if you do not wish to upload / being tracked by the service."),
|
||
},
|
||
],
|
||
},
|
||
]
|