|
|
|
@ -3,7 +3,7 @@ import pyray as rl |
|
|
|
|
from dataclasses import dataclass |
|
|
|
|
from cereal import messaging, log |
|
|
|
|
from openpilot.system.hardware import TICI |
|
|
|
|
from openpilot.system.ui.lib.application import gui_app, FontWeight |
|
|
|
|
from openpilot.system.ui.lib.application import gui_app, FontWeight, DEBUG_FPS |
|
|
|
|
from openpilot.system.ui.lib.label import gui_text_box |
|
|
|
|
from openpilot.selfdrive.ui.ui_state import ui_state |
|
|
|
|
|
|
|
|
@ -70,8 +70,12 @@ class AlertRenderer: |
|
|
|
|
"""Generate the current alert based on selfdrive state.""" |
|
|
|
|
ss = sm['selfdriveState'] |
|
|
|
|
|
|
|
|
|
# Check if selfdriveState messages have stopped arriving |
|
|
|
|
if not sm.updated['selfdriveState']: |
|
|
|
|
recv_frame = sm.recv_frame['selfdriveState'] |
|
|
|
|
if (sm.frame - recv_frame) > 5 * DEBUG_FPS: |
|
|
|
|
# Check if waiting to start |
|
|
|
|
if sm.recv_frame['selfdriveState'] < ui_state.started_frame: |
|
|
|
|
if recv_frame < ui_state.started_frame: |
|
|
|
|
return ALERT_STARTUP_PENDING |
|
|
|
|
|
|
|
|
|
# Handle selfdrive timeout |
|
|
|
|