mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-29 19:03:59 +08:00
eefc084302
version: sunnypilot v2025.003.000 (dev) date: 2025-12-18T05:48:43 master commit: 16c052af0835f049a67b80251d8cc1114fc08bb4
30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
"""
|
|
Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors.
|
|
|
|
This file is part of sunnypilot and is licensed under the MIT License.
|
|
See the LICENSE.md file in the root directory for more details.
|
|
"""
|
|
from cereal import messaging, custom
|
|
from openpilot.common.params import Params
|
|
from openpilot.sunnypilot.sunnylink.sunnylink_state import SunnylinkState
|
|
|
|
|
|
class UIStateSP:
|
|
def __init__(self):
|
|
self.params = Params()
|
|
self.sm_services_ext = [
|
|
"modelManagerSP", "selfdriveStateSP", "longitudinalPlanSP", "backupManagerSP",
|
|
"gpsLocation", "liveTorqueParameters", "carStateSP", "liveMapDataSP", "carParamsSP", "liveDelay"
|
|
]
|
|
|
|
self.sunnylink_state = SunnylinkState()
|
|
|
|
def update(self) -> None:
|
|
self.sunnylink_state.start()
|
|
|
|
def update_params(self) -> None:
|
|
CP_SP_bytes = self.params.get("CarParamsSPPersistent")
|
|
if CP_SP_bytes is not None:
|
|
self.CP_SP = messaging.log_from_bytes(CP_SP_bytes, custom.CarParamsSP)
|
|
self.sunnylink_enabled = self.params.get_bool("SunnylinkEnabled")
|