mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-07-25 11:52:20 +08:00
FCR: Reset cached param to sync with upstream conflicts
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
import os
|
||||
import requests
|
||||
import threading
|
||||
@@ -233,19 +234,27 @@ def crash_log2(fingerprints, fw):
|
||||
def get_car(logcan, sendcan, experimental_long_allowed, num_pandas=1):
|
||||
candidate, fingerprints, vin, car_fw, source, exact_match = fingerprint(logcan, sendcan, num_pandas)
|
||||
|
||||
params = Params()
|
||||
if params.get("CarModel") is not None:
|
||||
car_model = params.get("CarModel")
|
||||
candidate = car_model.decode("utf-8")
|
||||
|
||||
if candidate is None:
|
||||
cloudlog.event("car doesn't match any fingerprints", fingerprints=fingerprints, error=True)
|
||||
candidate = "mock"
|
||||
y = threading.Thread(target=crash_log2, args=(fingerprints, car_fw,))
|
||||
y.start()
|
||||
params = Params()
|
||||
car_model = params.get("CarModel")
|
||||
if car_model is not None:
|
||||
car_model = car_model.decode("utf-8").rstrip()
|
||||
with open(os.path.join(BASEDIR, "selfdrive/car/sunnypilot_carname.json")) as f:
|
||||
car_models = json.load(f)
|
||||
if car_model in car_models.values():
|
||||
candidate = car_model
|
||||
else:
|
||||
params.put("CarModel", "")
|
||||
params.put("CarModelText", "")
|
||||
if candidate is None:
|
||||
cloudlog.event("car doesn't match any fingerprints", fingerprints=fingerprints, error=True)
|
||||
candidate = "mock"
|
||||
y = threading.Thread(target=crash_log2, args=(fingerprints, car_fw,))
|
||||
y.start()
|
||||
|
||||
x = threading.Thread(target=crash_log, args=(candidate,))
|
||||
x.start()
|
||||
if candidate != "mock":
|
||||
x = threading.Thread(target=crash_log, args=(candidate,))
|
||||
x.start()
|
||||
|
||||
CarInterface, CarController, CarState = interfaces[candidate]
|
||||
CP = CarInterface.get_params(candidate, fingerprints, car_fw, experimental_long_allowed, docs=False)
|
||||
|
||||
@@ -402,8 +402,8 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = {
|
||||
# read-only mode. This can be solved by adding your fingerprint.
|
||||
# See https://github.com/commaai/openpilot/wiki/Fingerprinting for more information
|
||||
EventName.carUnrecognized: {
|
||||
ET.PERMANENT: NormalPermanentAlert("Dashcam Mode",
|
||||
"Car Unrecognized",
|
||||
ET.PERMANENT: NormalPermanentAlert("Car Unrecognized",
|
||||
"Vehicle Settings, Select, and Restart the Car",
|
||||
priority=Priority.LOWEST),
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user