canmatrix icon indicating copy to clipboard operation
canmatrix copied to clipboard

load dbc error

Open zhaoxian1989 opened this issue 1 year ago • 1 comments

code

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))

zhaoxian1989 avatar Dec 27 '24 07:12 zhaoxian1989

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

ebroecker avatar Feb 09 '25 12:02 ebroecker