mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-06-24 07:22:04 +08:00
加入關閉記錄選項
This commit is contained in:
@@ -82,6 +82,7 @@ keys = {
|
||||
"DragonDisableDriverSafetyCheck": [TxType.PERSISTENT],
|
||||
"DragonAutoShutdownAt": [TxType.PERSISTENT],
|
||||
"DragonTempDisableSteerOnSignal": [TxType.PERSISTENT],
|
||||
"DragonDisableLogger": [TxType.PERSISTENT],
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10,40 +10,10 @@ default_conf = {
|
||||
'DragonDisableDriverSafetyCheck': '0',
|
||||
'DragonAutoShutdownAt': '30', # in minute
|
||||
'DragonTempDisableSteerOnSignal': '0',
|
||||
'DragonDisableLogger': '0',
|
||||
}
|
||||
|
||||
# def write_json_config(config):
|
||||
# with open(file, 'w') as f:
|
||||
# json.dump(config, f, indent=2, sort_keys=True)
|
||||
# os.chmod(file, 0644)
|
||||
|
||||
def dragonpilot_set_params(params):
|
||||
# # create new json file
|
||||
# if not os.path.isfile(file):
|
||||
# write_json_config(default_conf)
|
||||
# config = default_conf
|
||||
# else:
|
||||
# # load from json
|
||||
# with open(file, 'r') as f:
|
||||
# config = json.load(f)
|
||||
#
|
||||
# json_update_needed = False
|
||||
# # add new keys
|
||||
# for key, val in default_conf.items():
|
||||
# if key not in config:
|
||||
# json_update_needed = True
|
||||
# config[key] = val
|
||||
#
|
||||
# # remove invalid keys
|
||||
# for key, val in config.items():
|
||||
# if key not in default_conf:
|
||||
# json_update_needed = True
|
||||
# config.pop(key, None)
|
||||
#
|
||||
# # write to json if update needed
|
||||
# if json_update_needed:
|
||||
# write_json_config(config)
|
||||
|
||||
# set params
|
||||
for key, val in default_conf.items():
|
||||
if params.get(key) is None:
|
||||
|
||||
@@ -454,7 +454,7 @@ def main():
|
||||
# the flippening!
|
||||
os.system('LD_LIBRARY_PATH="" content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1')
|
||||
|
||||
if os.getenv("NOLOG") is not None:
|
||||
if os.getenv("NOLOG") is not None or Params.get("DragonDisableLogger") == "1":
|
||||
del managed_processes['loggerd']
|
||||
del managed_processes['tombstoned']
|
||||
if os.getenv("NOUPLOAD") is not None:
|
||||
|
||||
Reference in New Issue
Block a user