From 7fc2927b7308c8b4a59c15635d097a135687cc40 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Thu, 15 Jun 2023 18:50:14 +0800 Subject: [PATCH] cabana: use raw signal value to match value descriptions (#28554) old-commit-hash: 6f54ebe1103c7960afcd2f3f550e56ba9a7e4667 --- tools/cabana/dbc/dbc.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/cabana/dbc/dbc.cc b/tools/cabana/dbc/dbc.cc index 269aeb4247..e0c89823c6 100644 --- a/tools/cabana/dbc/dbc.cc +++ b/tools/cabana/dbc/dbc.cc @@ -131,8 +131,9 @@ void cabana::Signal::update() { QString cabana::Signal::formatValue(double value) const { // Show enum string + int64_t raw_value = (value - offset) / factor; for (const auto &[val, desc] : val_desc) { - if (std::abs(value - val) < 1e-6) { + if (std::abs(raw_value - val) < 1e-6) { return desc; } }