ebroecker / canmatrix

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

Unnecessary Integer cast causes error during ARXML export #786

Closed ChristianSteffens closed 4 months ago

ChristianSteffens commented 6 months ago

I might be mistaken, but isn't this integer conversion unnecessary? It causes an error during ARXML export, considering that the signal values are already stored as integers.

https://github.com/ebroecker/canmatrix/blob/8ca6d787e5c3faceac273fb00f35204fd6ad300f/src/canmatrix/formats/arxml.py#L802

canmatrix\formats\arxml.py", line 800, in <lambda>
    for value in sorted(signal.values, key=lambda x: int(x, 0)):
                                                     ^^^^^^^^^
TypeError: int() can't convert non-string with explicit base
ebroecker commented 4 months ago

Hi @ChristianSteffens

after a quick view to the code it seems you are right.

ebroecker commented 4 months ago

should be merged