GENIVI/CANdb

"VAL_TABLE_" and "VAL_" DBC Signal parsing

enricop opened this issue · 7 comments

Hello,

in this file CANdb/src/dbcparser.cpp at line192:

    pegParser["val_entry"] = [&can_db, &phrasesPairs](const peg::SemanticValues&) {
        std::vector<CANdb_t::ValTable::ValTableEntry> tab;
        std::transform(phrasesPairs.begin(), phrasesPairs.end(), std::back_inserter(tab), [](const auto& p) {
            return CANdb_t::ValTable::ValTableEntry{ p.first, p.second };
        });
        can_db.val_tables.push_back(CANdb_t::ValTable{ "", tab });
        phrasesPairs.clear();
    };

the signal id/name is not parsed from the DBC file "VAL_TABLE_" and "VAL_" section, but just an empty string ("") is used.

It should be placed in the "identifier" member of "ValTable" struct.

Would it be possible to fix this upstream or provide us just a suggestion on how to do it?
Thanks for your support,
enrico

any suggestion for implementing a perParser lamda for "VAL_" entries like the ones here? @btaczala @rkollataj @mguentner

@enricop can you provide an example dbc file for this?

hello, I've sent you a mail with the dbc.

You can find also a "dbcparser.cpp" patch we are using to workaround this issue, but we are not expert on the parsing library/logic.
candb.txt

Thank you very much for your support on this and your effort in removing boost as a dependency of CANdb.

this is the actual diff with the current upstream master branch code:
upstream_patch.txt

hello, we tested the "val_table" branch and it's ok

@enricop Yeah I'll merge the val_table branch; the thing that's still missing is VAL_ entries - I'm planning to add support for them

ok thank you. Linking the entries in the new VAL_ data structure with the VAL_TABLE_ data structure would be usefull too.