canmatrix
canmatrix copied to clipboard
Does CanMatrix.signalDefines have to be 'dynamic'?
I just ran into an issue where I generated a CanMatrix in code (as opposed to loading from a .sym file or such) and when I dumped to a .sym the signal defaults ('GenSigStartValue') were not being output. This was because I had not added that to the signalDefines.
The sparse nature of the CanMatrix.attributes attribute itself already provides both not-present and None options for each define/attribute. What does the extra not-in-the-defines-list option mean on top of that?
I temporarily addressed my case by copy/pasting this into my code but that doesn't seem great.
db.addSignalDefines("GenSigStartValue", 'FLOAT -3.4E+038 3.4E+038')
db.addSignalDefines("HexadecimalOutput", 'BOOL False True')
db.addSignalDefines("DisplayDecimalPlaces", 'INT 0 65535')
db.addSignalDefines("LongName", 'STR')
GenSigStartValue is now a generic signal attribute: signal.initial_value
My current plan is to remove "defines" from other formats than dbc.