mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-10 22:42:06 +08:00
Merge branch 'py-ui-state-sp' into mici-playground
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
from openpilot.selfdrive.ui.ui_state import UIState
|
||||
from cereal import messaging
|
||||
from openpilot.common.params import Params
|
||||
|
||||
|
||||
class UIStateSP(UIState):
|
||||
_instance: 'UIStateSP | None' = None
|
||||
|
||||
def _initialize(self):
|
||||
UIState._initialize(self)
|
||||
self.params = Params()
|
||||
op_services = self.sm.services
|
||||
sp_services = [
|
||||
"modelManagerSP", "selfdriveStateSP", "longitudinalPlanSP", "backupManagerSP",
|
||||
"carControl", "gpsLocationExternal", "gpsLocation", "liveTorqueParameters",
|
||||
"carStateSP", "liveParameters", "liveMapDataSP", "carParamsSP"
|
||||
]
|
||||
self.sm = messaging.SubMaster(op_services + sp_services)
|
||||
|
||||
def update(self) -> None:
|
||||
UIState.update(self)
|
||||
|
||||
def _update_status(self) -> None:
|
||||
UIState._update_status(self)
|
||||
|
||||
def update_params(self) -> None:
|
||||
UIState.update_params(self)
|
||||
|
||||
# Global instance
|
||||
ui_state_sp = UIStateSP()
|
||||
@@ -9,6 +9,8 @@ from openpilot.selfdrive.ui.layouts.main import MainLayout
|
||||
from openpilot.selfdrive.ui.mici.layouts.main import MiciMainLayout
|
||||
from openpilot.selfdrive.ui.ui_state import ui_state
|
||||
|
||||
if gui_app.sunnypilot_ui():
|
||||
from openpilot.selfdrive.ui.sunnypilot.ui_state import ui_state_sp as ui_state
|
||||
|
||||
def main():
|
||||
cores = {5, }
|
||||
|
||||
Reference in New Issue
Block a user