mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-08-21 04:53:47 +08:00
CarState: update objects when refreshing params (#96)
This commit is contained in:
@@ -94,7 +94,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
def _update(self, c):
|
||||
ret = self.CS.update(self.cp, self.cp_cam)
|
||||
self.sp_update_params(self.CS)
|
||||
self.CS = self.sp_update_params(self.CS)
|
||||
|
||||
buttonEvents = []
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ class CarInterface(CarInterfaceBase):
|
||||
# returns a car.CarState
|
||||
def _update(self, c):
|
||||
ret = self.CS.update(self.cp, self.cp_cam, self.cp_loopback)
|
||||
self.sp_update_params(self.CS)
|
||||
self.CS = self.sp_update_params(self.CS)
|
||||
|
||||
buttonEvents = []
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ class CarInterface(CarInterfaceBase):
|
||||
# returns a car.CarState
|
||||
def _update(self, c):
|
||||
ret = self.CS.update(self.cp, self.cp_cam, self.cp_body)
|
||||
self.sp_update_params(self.CS)
|
||||
self.CS = self.sp_update_params(self.CS)
|
||||
|
||||
buttonEvents = []
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ class CarInterface(CarInterfaceBase):
|
||||
|
||||
def _update(self, c):
|
||||
ret = self.CS.update(self.cp, self.cp_cam)
|
||||
self.sp_update_params(self.CS)
|
||||
self.CS = self.sp_update_params(self.CS)
|
||||
|
||||
buttonEvents = []
|
||||
|
||||
|
||||
@@ -549,6 +549,7 @@ class CarInterfaceBase(ABC):
|
||||
self.gac = self.param_s.get_bool("GapAdjustCruise")
|
||||
self.gac_mode = round(float(self.param_s.get("GapAdjustCruiseMode", encoding="utf8")))
|
||||
self.reverse_dm_cam = self.param_s.get_bool("ReverseDmCam")
|
||||
return CS
|
||||
|
||||
class RadarInterfaceBase(ABC):
|
||||
def __init__(self, CP):
|
||||
|
||||
@@ -58,7 +58,7 @@ class CarInterface(CarInterfaceBase):
|
||||
# returns a car.CarState
|
||||
def _update(self, c):
|
||||
ret = self.CS.update(self.cp, self.cp_cam)
|
||||
self.sp_update_params(self.CS)
|
||||
self.CS = self.sp_update_params(self.CS)
|
||||
|
||||
buttonEvents = []
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class CarInterface(CarInterfaceBase):
|
||||
# returns a car.CarState
|
||||
def _update(self, c):
|
||||
ret = self.CS.update(self.cp, self.cp_adas, self.cp_cam)
|
||||
self.sp_update_params(self.CS)
|
||||
self.CS = self.sp_update_params(self.CS)
|
||||
|
||||
buttonEvents = []
|
||||
#be = car.CarState.ButtonEvent.new_message()
|
||||
|
||||
@@ -121,7 +121,7 @@ class CarInterface(CarInterfaceBase):
|
||||
def _update(self, c):
|
||||
|
||||
ret = self.CS.update(self.cp, self.cp_cam, self.cp_body)
|
||||
self.sp_update_params(self.CS)
|
||||
self.CS = self.sp_update_params(self.CS)
|
||||
|
||||
buttonEvents = []
|
||||
|
||||
|
||||
@@ -256,7 +256,7 @@ class CarInterface(CarInterfaceBase):
|
||||
# returns a car.CarState
|
||||
def _update(self, c):
|
||||
ret = self.CS.update(self.cp, self.cp_cam)
|
||||
self.sp_update_params(self.CS)
|
||||
self.CS = self.sp_update_params(self.CS)
|
||||
|
||||
buttonEvents = []
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ class CarInterface(CarInterfaceBase):
|
||||
# returns a car.CarState
|
||||
def _update(self, c):
|
||||
ret = self.CS.update(self.cp, self.cp_cam, self.cp_ext, self.CP.transmissionType)
|
||||
self.sp_update_params(self.CS)
|
||||
self.CS = self.sp_update_params(self.CS)
|
||||
|
||||
buttonEvents = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user