ratal / mdfr

ASAM mdf reader in rust
GNU General Public License v3.0
9 stars 1 forks source link

String data value handling #18

Open LegrandT opened 4 months ago

LegrandT commented 4 months ago

Great package! When testing it, I found out that when the data is actually String data but the type is not specified, the get_channeldata(channel) return a unique joined string of all the values. Any idea how to prevent that ? I know that asammdf could make the separation but not sure how, any views on it ? An exemple on how the signal look like in asamdf: <Signal CAN_Name.SignalName: samples=[b'Lamp_Off' b'Lamp_On' b'Lamp_Off' b'Lamp_Off' b'Lamp_Low' b'Lamp_On'] timestamps=[5.98369986e-02 3.39207000e-01 3.99315989e-01 6.79330003e-01 7.39497018e-01 1.94965796e+03] invalidation_bits=None unit="" conversion=None source=None comment="Light info" flags="0" mastermeta="('Time', 1)" raw=False displaynames={} attachment=None>

And get_channel_data gives me

_"Lamp_OffLamp_OnLamp_OffLamp_OffLamp_LowLampOn"

ratal commented 4 months ago

Just like this, bit difficult to get where is the issue. This is probably a bug. To progress maybe you can give a screenshot of the channel block with MDFVALIDATOR from Vector or send your file after scrambling it link

LegrandT commented 3 months ago

Here is a screenshot, I hope it helps. Interesting to note that when I get the data through polar dataframe or series it comes out great, but get_channel_data returns 1 concatenated string

Image