|
|
@ -2,6 +2,7 @@ import os |
|
|
|
import json |
|
|
|
import json |
|
|
|
from openpilot.system.ui.lib.application import gui_app, Widget |
|
|
|
from openpilot.system.ui.lib.application import gui_app, Widget |
|
|
|
from openpilot.system.ui.lib.list_view import ListView, text_item, button_item |
|
|
|
from openpilot.system.ui.lib.list_view import ListView, text_item, button_item |
|
|
|
|
|
|
|
from openpilot.selfdrive.ui.onroad.driver_camera_dialog import DriverCameraDialog |
|
|
|
from openpilot.common.params import Params |
|
|
|
from openpilot.common.params import Params |
|
|
|
from openpilot.system.ui.widgets.option_dialog import MultiOptionDialog |
|
|
|
from openpilot.system.ui.widgets.option_dialog import MultiOptionDialog |
|
|
|
from openpilot.system.hardware import TICI |
|
|
|
from openpilot.system.hardware import TICI |
|
|
@ -32,7 +33,7 @@ class DeviceLayout(Widget): |
|
|
|
text_item("Dongle ID", dongle_id), |
|
|
|
text_item("Dongle ID", dongle_id), |
|
|
|
text_item("Serial", serial), |
|
|
|
text_item("Serial", serial), |
|
|
|
button_item("Pair Device", "PAIR", DESCRIPTIONS['pair_device'], self._on_pair_device), |
|
|
|
button_item("Pair Device", "PAIR", DESCRIPTIONS['pair_device'], self._on_pair_device), |
|
|
|
button_item("Driver Camera", "PREVIEW", DESCRIPTIONS['driver_camera'], self._on_driver_camera), |
|
|
|
button_item("Driver Camera", "PREVIEW", DESCRIPTIONS['driver_camera'], callback=self._on_driver_camera), |
|
|
|
button_item("Reset Calibration", "RESET", DESCRIPTIONS['reset_calibration'], self._on_reset_calibration), |
|
|
|
button_item("Reset Calibration", "RESET", DESCRIPTIONS['reset_calibration'], self._on_reset_calibration), |
|
|
|
button_item("Review Training Guide", "REVIEW", DESCRIPTIONS['review_guide'], self._on_review_training_guide), |
|
|
|
button_item("Review Training Guide", "REVIEW", DESCRIPTIONS['review_guide'], self._on_review_training_guide), |
|
|
|
] |
|
|
|
] |
|
|
@ -44,6 +45,7 @@ class DeviceLayout(Widget): |
|
|
|
|
|
|
|
|
|
|
|
self._list_widget = ListView(items) |
|
|
|
self._list_widget = ListView(items) |
|
|
|
self._select_language_dialog: MultiOptionDialog | None = None |
|
|
|
self._select_language_dialog: MultiOptionDialog | None = None |
|
|
|
|
|
|
|
self._driver_camera: DriverCameraDialog | None = None |
|
|
|
|
|
|
|
|
|
|
|
def _render(self, rect): |
|
|
|
def _render(self, rect): |
|
|
|
self._list_widget.render(rect) |
|
|
|
self._list_widget.render(rect) |
|
|
@ -66,9 +68,13 @@ class DeviceLayout(Widget): |
|
|
|
|
|
|
|
|
|
|
|
self._select_language_dialog = None |
|
|
|
self._select_language_dialog = None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _on_driver_camera(self): |
|
|
|
|
|
|
|
if not self._driver_camera: |
|
|
|
|
|
|
|
self._driver_camera = DriverCameraDialog() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gui_app.set_modal_overlay(self._driver_camera, callback=lambda result: setattr(self, '_driver_camera', None)) |
|
|
|
|
|
|
|
|
|
|
|
def _on_pair_device(self): pass |
|
|
|
def _on_pair_device(self): pass |
|
|
|
def _on_driver_camera(self): pass |
|
|
|
|
|
|
|
def _on_reset_calibration(self): pass |
|
|
|
def _on_reset_calibration(self): pass |
|
|
|
def _on_review_training_guide(self): pass |
|
|
|
def _on_review_training_guide(self): pass |
|
|
|
def _on_regulatory(self): pass |
|
|
|
def _on_regulatory(self): pass |
|
|
|