remove door_check, seatbelt_check toggle

This commit is contained in:
Rick Lan
2020-04-09 17:59:31 +10:00
parent 036aad2cff
commit 3909bfaf94
4 changed files with 2 additions and 12 deletions
-2
View File
@@ -174,8 +174,6 @@ keys = {
"DragonLastModified": [TxType.PERSISTENT],
"DragonEnableRegistration": [TxType.PERSISTENT],
"DragonDynamicFollow": [TxType.PERSISTENT],
"DragonEnableDoorCheck": [TxType.PERSISTENT],
"DragonEnableSeatBeltCheck": [TxType.PERSISTENT],
"DragonEnableGearCheck": [TxType.PERSISTENT],
"DragonEnableTempMonitor": [TxType.PERSISTENT],
"DragonEnableCurvatureLearner": [TxType.PERSISTENT],
+2 -6
View File
@@ -44,8 +44,6 @@ class CarInterfaceBase():
self.ts_last_check = 0.
self.dragon_lat_ctrl = True
self.dp_last_modified = None
self.dp_door_check = True
self.dp_seatbelt_check = True
self.dp_gear_check = True
@staticmethod
@@ -116,8 +114,6 @@ class CarInterfaceBase():
self.dragon_toyota_stock_dsu = False
if not self.dragon_toyota_stock_dsu:
self.dragon_allow_gas = True if params.get("DragonAllowGas", encoding='utf8') == "1" else False
self.dp_door_check = False if params.get("DragonEnableDoorCheck", encoding='utf8') == "0" else True
self.dp_seatbelt_check = False if params.get("DragonEnableSeatBeltCheck", encoding='utf8') == "0" else True
self.dp_gear_check = False if params.get("DragonEnableGearCheck", encoding='utf8') == "0" else True
self.dp_last_modified = modified
self.ts_last_check = ts
@@ -125,9 +121,9 @@ class CarInterfaceBase():
def create_common_events(self, cs_out, extra_gears=[], gas_resume_speed=-1):
events = []
if self.dp_door_check and cs_out.doorOpen:
if cs_out.doorOpen:
events.append(create_event('doorOpen', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
if self.dp_seatbelt_check and cs_out.seatbeltUnlatched:
if cs_out.seatbeltUnlatched:
events.append(create_event('seatbeltNotLatched', [ET.NO_ENTRY, ET.SOFT_DISABLE]))
if self.dp_gear_check:
if cs_out.gearShifter != GearShifter.drive and cs_out.gearShifter not in extra_gears:
-2
View File
@@ -136,8 +136,6 @@ class CarState(CarStateBase):
enable_acc = False
if ret.seatbeltUnlatched or ret.doorOpen:
enable_acc = False
if ret.brakePressed:
enable_acc = False
ret.cruiseState.enabled = enable_acc
return ret
@@ -74,8 +74,6 @@ default_conf = {
'DragonLastModified': str(floor(time.time())),
'DragonEnableRegistration': '1',
'DragonDynamicFollow': '-2', # OFF = -2, LONG = -1, NORMAL = 0, SHORT = 1
'DragonEnableDoorCheck': '1',
'DragonEnableSeatBeltCheck': '1',
'DragonEnableGearCheck': '1',
'DragonEnableTempMonitor': '1',
'DragonEnableCurvatureLearner': '0',