mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-15 01:42:05 +08:00
修正參數名,將自動關機設定單位換成分鐘,修正dragonconf logic
This commit is contained in:
+1
-1
@@ -79,7 +79,7 @@ keys = {
|
||||
"Version": [TxType.PERSISTENT],
|
||||
#dragonpilot config
|
||||
"DragonEnableDashcam": [TxType.PERSISTENT],
|
||||
"DragonEnableDriverMonitor": [TxType.PERSISTENT],
|
||||
"DragonDisableDriverSafetyCheck": [TxType.PERSISTENT],
|
||||
"DragonAutoShutdownAt": [TxType.PERSISTENT],
|
||||
"DragonTempDisableSteerOnSignal": [TxType.PERSISTENT],
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ class DriverStatus():
|
||||
not (standstill and self.awareness - self.step_change <= self.threshold_prompt):
|
||||
self.awareness = max(self.awareness - self.step_change, -0.1)
|
||||
|
||||
if params.get("DragonEnableDriverMonitor") == "1":
|
||||
if params.get("DragonDisableDriverSafetyCheck") == "1":
|
||||
alert = None
|
||||
if self.awareness <= 0.:
|
||||
# terminal red alert: disengagement required
|
||||
|
||||
@@ -7,8 +7,8 @@ file = '/data/dragonpilot.json'
|
||||
|
||||
default_conf = {
|
||||
'DragonEnableDashcam': '1',
|
||||
'DragonEnableDriverMonitor': '1',
|
||||
'DragonAutoShutdownAt': '1800', # shutdown after 30 mins
|
||||
'DragonDisableDriverSafetyCheck': '1',
|
||||
'DragonAutoShutdownAt': '30', # in minute
|
||||
'DragonTempDisableSteerOnSignal': '0',
|
||||
}
|
||||
|
||||
@@ -40,10 +40,11 @@ def dragonpilot_set_params(params):
|
||||
json_update_needed = True
|
||||
config.pop(key, None)
|
||||
|
||||
# write to json if it's been updated
|
||||
# write to json if update needed
|
||||
if json_update_needed:
|
||||
write_json_config(config)
|
||||
|
||||
# set params
|
||||
for key, val in config.items():
|
||||
params.put(key, str(val))
|
||||
if params.get(key) is None:
|
||||
params.put(key, str(val))
|
||||
|
||||
@@ -32,7 +32,7 @@ def get_shutdown_val():
|
||||
if val is None:
|
||||
return None
|
||||
else:
|
||||
return int(val)
|
||||
return int(val)*60 # convert to seconds
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user