|
1 | 1 | #include"dbclineparser.h" |
| 2 | +#include<helpers/formatter.h> |
| 3 | +#include<stdlib.h> |
2 | 4 | #include<clocale> |
3 | 5 | #include<regex> |
4 | 6 | #include<math.h> |
@@ -515,7 +517,7 @@ bool DbcLineParser::ParseAttributeLine(AttributeDescriptor_t* attr, const std::s |
515 | 517 | return ret; |
516 | 518 | } |
517 | 519 |
|
518 | | -boolDbcLineParser::ParseValTableLine(Comment_t* comm,const std::string& line) |
| 520 | +boolDbcLineParser::ParseValTableLine(Comment_t* comm,const std::string& line, ValTable_t& vtab) |
519 | 521 | { |
520 | 522 | bool ret =false; |
521 | 523 |
|
@@ -546,10 +548,17 @@ bool DbcLineParser::ParseValTableLine(Comment_t* comm, const std::string& line) |
546 | 548 | comm->Text =""; |
547 | 549 | comm->ca_target = CommentTarget::Signal; |
548 | 550 |
|
| 551 | +// prepare value table container |
| 552 | + vtab.SigName = items[2]; |
| 553 | + vtab.vpairs.clear(); |
| 554 | + |
549 | 555 | for (size_t valpair =3; valpair < (items.size() -1); valpair +=2) |
550 | 556 | { |
551 | 557 | comm->Text +="" + items[valpair +0] +" :"; |
552 | 558 | comm->Text += items[valpair +1] +'\n'; |
| 559 | + |
| 560 | +auto valdef =make_c_name(items[valpair +1]); |
| 561 | + vtab.vpairs.push_back({valdef, (uint32_t)atoll((items[valpair +0]).c_str())}); |
553 | 562 | } |
554 | 563 |
|
555 | 564 | if (comm->Text.size() >0) |
|