mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-23 06:52:07 +08:00
Merge branch 'devel-en' into devel-zht
This commit is contained in:
@@ -94,14 +94,10 @@ keys = {
|
||||
"Offroad_ConnectivityNeeded": [TxType.CLEAR_ON_MANAGER_START],
|
||||
#dragonpilot config
|
||||
"DragonEnableDashcam": [TxType.PERSISTENT],
|
||||
"DragonDisableDriverSafetyCheck": [TxType.PERSISTENT], # deprecated
|
||||
"DragonEnableDriverSafetyCheck": [TxType.PERSISTENT],
|
||||
"DragonAutoShutdownAt": [TxType.PERSISTENT],
|
||||
"DragonTempDisableSteerOnSignal": [TxType.PERSISTENT], # deprecated
|
||||
"DragonEnableSteeringOnSignal": [TxType.PERSISTENT],
|
||||
"DragonDisableLogger": [TxType.PERSISTENT], # deprecated
|
||||
"DragonEnableLogger": [TxType.PERSISTENT],
|
||||
"DragonDisableUploader": [TxType.PERSISTENT], # deprecated
|
||||
"DragonEnableUploader": [TxType.PERSISTENT],
|
||||
"DragonNoctuaMode": [TxType.PERSISTENT],
|
||||
"DragonCacheCar": [TxType.PERSISTENT],
|
||||
@@ -109,7 +105,6 @@ keys = {
|
||||
"DragonCachedFP": [TxType.PERSISTENT],
|
||||
"DragonCachedVIN": [TxType.PERSISTENT],
|
||||
"DragonAllowGas": [TxType.PERSISTENT],
|
||||
"DragonBBUI": [TxType.PERSISTENT], # deprecated
|
||||
"DragonToyotaStockDSU": [TxType.PERSISTENT],
|
||||
"DragonLatCtrl": [TxType.PERSISTENT],
|
||||
"DragonUISpeed": [TxType.PERSISTENT],
|
||||
|
||||
@@ -3,14 +3,10 @@ from common.params import Params, put_nonblocking
|
||||
|
||||
default_conf = {
|
||||
'DragonEnableDashcam': '1',
|
||||
'DragonDisableDriverSafetyCheck': '0', # deprecated
|
||||
'DragonEnableDriverSafetyCheck': '1',
|
||||
'DragonAutoShutdownAt': '30', # in minute
|
||||
'DragonTempDisableSteerOnSignal': '0', # deprecated
|
||||
'DragonEnableSteeringOnSignal': '0',
|
||||
'DragonDisableLogger': '0', # deprecated
|
||||
'DragonEnableLogger': '1',
|
||||
'DragonDisableUploader': '0', # deprecated
|
||||
'DragonEnableUploader': '1',
|
||||
'DragonNoctuaMode': '0',
|
||||
'DragonCacheCar': '0',
|
||||
@@ -18,7 +14,6 @@ default_conf = {
|
||||
'DragonCachedFP': '', # for cache car
|
||||
'DragonCachedVIN': '', # for cache car
|
||||
'DragonAllowGas': '0',
|
||||
'DragonBBUI': '0', # deprecated
|
||||
'DragonToyotaStockDSU': '0',
|
||||
'DragonLatCtrl': '1',
|
||||
'DragonUISpeed': '1',
|
||||
@@ -61,26 +56,26 @@ deprecated_conf = {
|
||||
'DragonBBUI': 'DragonUIDev',
|
||||
}
|
||||
|
||||
deprecated_conf_invert = {
|
||||
'DragonDisableDriverSafetyCheck': True,
|
||||
'DragonTempDisableSteerOnSignal': False,
|
||||
'DragonDisableLogger': True,
|
||||
'DragonDisableUploader': True,
|
||||
'DragonBBUI': False
|
||||
}
|
||||
# deprecated_conf_invert = {
|
||||
# 'DragonDisableDriverSafetyCheck': True,
|
||||
# 'DragonTempDisableSteerOnSignal': False,
|
||||
# 'DragonDisableLogger': True,
|
||||
# 'DragonDisableUploader': True,
|
||||
# 'DragonBBUI': False
|
||||
# }
|
||||
|
||||
def dragonpilot_set_params(params):
|
||||
# remove deprecated params
|
||||
for old, new in deprecated_conf.items():
|
||||
if params.get(old) is not None:
|
||||
if new is not None:
|
||||
old_val = str(params.get(old))
|
||||
new_val = old_val
|
||||
# invert the value if true
|
||||
if old in deprecated_conf_invert and deprecated_conf_invert[old] is True:
|
||||
new_val = "1" if old_val == "0" else "0"
|
||||
put_nonblocking(new, new_val)
|
||||
params.delete(old)
|
||||
# for old, new in deprecated_conf.items():
|
||||
# if params.get(old) is not None:
|
||||
# if new is not None:
|
||||
# old_val = str(params.get(old))
|
||||
# new_val = old_val
|
||||
# # invert the value if true
|
||||
# if old in deprecated_conf_invert and deprecated_conf_invert[old] is True:
|
||||
# new_val = "1" if old_val == "0" else "0"
|
||||
# put_nonblocking(new, new_val)
|
||||
# params.delete(old)
|
||||
|
||||
# set params
|
||||
for key, val in default_conf.items():
|
||||
|
||||
Reference in New Issue
Block a user