Files
StarPilot/selfdrive/ui/layouts/settings/developer.py
T
Shane Smiskol 2c59b5f8c6 raylib: common mouse press hook (#35489)
* something like this

* need these

* rest

* another pr

* what is this merge conflict

f

* fix mouse down

* rm that!

* fix that

* rearrange

* fix bug where mouse held down on widget, dragged off, then let go

* temp

* fix that

* missing init
2025-06-06 23:00:55 -07:00

55 lines
1.7 KiB
Python

from openpilot.system.ui.lib.application import Widget
from openpilot.system.ui.lib.list_view import ListView, toggle_item
from openpilot.common.params import Params
# Description constants
DESCRIPTIONS = {
'enable_adb': (
"ADB (Android Debug Bridge) allows connecting to your device over USB or over the network. " +
"See https://docs.comma.ai/how-to/connect-to-comma for more info."
),
'joystick_debug_mode': "Preview the driver facing camera to ensure that driver monitoring has good visibility. (vehicle must be off)",
}
class DeveloperLayout(Widget):
def __init__(self):
super().__init__()
self._params = Params()
items = [
toggle_item(
"Enable ADB",
description=DESCRIPTIONS["enable_adb"],
initial_state=self._params.get_bool("AdbEnabled"),
callback=self._on_enable_adb,
),
toggle_item(
"Joystick Debug Mode",
description=DESCRIPTIONS["joystick_debug_mode"],
initial_state=self._params.get_bool("JoystickDebugMode"),
callback=self._on_joystick_debug_mode,
),
toggle_item(
"Longitudinal Maneuver Mode",
description="",
initial_state=self._params.get_bool("LongitudinalManeuverMode"),
callback=self._on_long_maneuver_mode,
),
toggle_item(
"openpilot Longitudinal Control (Alpha)",
description="",
initial_state=self._params.get_bool("AlphaLongitudinalEnabled"),
callback=self._on_alpha_long_enabled,
),
]
self._list_widget = ListView(items)
def _render(self, rect):
self._list_widget.render(rect)
def _on_enable_adb(self): pass
def _on_joystick_debug_mode(self): pass
def _on_long_maneuver_mode(self): pass
def _on_alpha_long_enabled(self): pass