cabana: fixed the issue of parsing multiplexed signals (#28660)

pull/28684/head
Dean Lee 2 years ago committed by GitHub
parent d081396102
commit 6cc600e84f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      tools/cabana/dbc/dbc.cc
  2. 1
      tools/cabana/dbc/dbcfile.cc

@ -111,6 +111,9 @@ void cabana::Msg::update() {
for (auto sig : sigs) { for (auto sig : sigs) {
sig->multiplexor = sig->type == cabana::Signal::Type::Multiplexed ? multiplexor : nullptr; sig->multiplexor = sig->type == cabana::Signal::Type::Multiplexed ? multiplexor : nullptr;
if (!sig->multiplexor) { if (!sig->multiplexor) {
if (sig->type == cabana::Signal::Type::Multiplexed) {
sig->type = cabana::Signal::Type::Normal;
}
sig->multiplex_value = 0; sig->multiplex_value = 0;
} }
} }

@ -136,7 +136,6 @@ void DBCFile::parse(const QString &content) {
dbc_assert(++multiplexor_cnt < 2, "Multiple multiplexor"); dbc_assert(++multiplexor_cnt < 2, "Multiple multiplexor");
s.type = cabana::Signal::Type::Multiplexor; s.type = cabana::Signal::Type::Multiplexor;
} else { } else {
dbc_assert(multiplexor_cnt == 1, "No multiplexor");
s.type = cabana::Signal::Type::Multiplexed; s.type = cabana::Signal::Type::Multiplexed;
s.multiplex_value = indicator.mid(1).toInt(); s.multiplex_value = indicator.mid(1).toInt();
} }

Loading…
Cancel
Save