CANdevStudio icon indicating copy to clipboard operation
CANdevStudio copied to clipboard

floating point values from DBC file truncated to integer

Open bomm opened this issue 2 years ago • 2 comments

When loading a DBC file that contains floating point values as factor, min or max value of a signal, the values are truncated to integer.

For example, a factor of 0.01 is truncated to 0, resulting in an error message: signalToRaw():cansignalencoder_p.cpp@143] Factor for Temperature signal is 0! Signal encoding failed. This means the internal value is affected, not only the display in the CanSignalData node.

Example file: https://github.com/cantools/cantools/blob/master/tests/files/dbc/motohawk.dbc

(I don't know if the truncation occurs in CANdb or CANdevStudio.)

bomm avatar Nov 14 '23 15:11 bomm

second this, I have the same problem, found a warning like this in the console

[2024-04-08 23:59:32.977] [cds] [error] [signalToRaw():cansignalencoder_p.cpp@143] Factor for HVB_uHvb signal is 0! Signal encoding failed.

simoneruffini avatar Apr 08 '24 22:04 simoneruffini

I found the error, the problem is in CANdb check the PR https://github.com/GENIVI/CANdb/issues/43 The current workaround is to either change your systems locale to one that uses the . as the decimal separator or just launch the application with this line before export LC_NUMERIC=en_US.UTF-8

simoneruffini avatar Apr 09 '24 16:04 simoneruffini