ebroecker / canmatrix

Converting Can (Controller Area Network) Database Formats .arxml .dbc .dbf .kcd ...
BSD 2-Clause "Simplified" License
891 stars 392 forks source link

Renaming Node / ECU via rename_ecu should clear out any existing transmitter and receiver #760

Open ChristianSteffens opened 5 months ago

ChristianSteffens commented 5 months ago

Hi,

I noticed a problem (bug?) in the db.rename_ecu method and specifically the usage of the frame.update_receiver() method.

The method should cover a rename attempt of an existing ECU throughout the complete database:

But here a catch as the frame's receiver list is not cleared / emptied before (!) updating the list, so any previous occurance of any ECU (e.g. the ECU with the old name) is still carried over.

So the correct method should empty the receiver array of the frame before updating it via the signals receiver list.

ChristianSteffens commented 1 month ago

Any interest in fixing this - if not should I raise a PR?

ebroecker commented 2 weeks ago

Hi @ChristianSteffens ,

for sure, yes, feel free to raise an PR