-
Notifications
You must be signed in to change notification settings - Fork 407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scaling of min/max/default in signals #126
Comments
I know some dbc's where the default is value for a signal is 'invalid value' which is often not in range between min and max. In my opinion the raw-default-value should be used, because scaling often leads to some arithmetical errors. I think .dbc stores the raw-default value but .sym stores the scaled value? |
In addition to calculation errors, even just converting from a string to a float can induce error. That is why I added the float factory option and use decimal (a622e5e). But, not calculating is only an option if all file formats store all values either scaled or not. Well, at least given the assumption that we want a consistent state in memory. Alternatively we could calculate losslessly using decimal and/or fractions as needed. If some formats store scaled values and others raw/unscaled values then we are stuck doing calculations since the in-memory value should be consistent. |
... slowly but surely I understand this issue :-) |
A long time later, I am working on this issue. I have done this now for Signal.initial_value |
Are the in-memory min/max/defaults supposed to be comparable to the raw integers in a CAN message? or the human value they represent? With a factor of 0.1 and a default human value of 15.1, should signal.attributes['GenSigStartValue'] be
'15.1'
or'151'
?This is coming up because some of my defaults are not getting written to my .sym file because after the scaling (introduced at the beginning 95611b1#diff-2fda6f9ac5ab0214cac52642f17fc1f7R167) the value is not in the range of the min and max and so isn't output. I just thought it would be good to know the intended in-memory value before trying to review the code.
For reference, here is a sample signal from the symbol editor. Note that the max and default both have decimals so they are scaled values, not directly comparable to any raw integer value from a message.
The text was updated successfully, but these errors were encountered: