canmatrix
canmatrix copied to clipboard
load dbc error
This line was originally intended to import the content of the ECU. However, because it is a query during the import process and no instance is created, the query result return None, which leads to an error. I would suggest changing it to look like below:
ecu=db.ecu_by_name(
temp.group(2))
if not ecu:
ecu=canmatrix.Ecu(temp.group(2))
db.add_ecu(ecu)
ecu.add_attribute(
temp.group(1),
temp.group(3))
Hi @zhaoxian1989 ,
do you have some example dbc where it fails? Or some unit-test? Usually dbc import works without problem, so I need some specific input for better understanding