From b12828ed1acaa14b521d28c8c12fcf0367025c94 Mon Sep 17 00:00:00 2001 From: deanlee Date: Sat, 23 Nov 2024 15:57:30 +0800 Subject: [PATCH] update to new opendbc --- .../DataLoadRlog/rlog_parser.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp b/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp index b577de82c..031d65019 100644 --- a/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp +++ b/plotjuggler_plugins/DataLoadRlog/rlog_parser.cpp @@ -187,7 +187,6 @@ bool RlogMessageParser::parseCanMessage( } updated_busses.insert(bus); - parsers[bus]->last_nanos = last_nanos; auto dat = value.get("dat").as(); if (dat.size() > 64) continue; // shouldn't ever happen @@ -199,13 +198,16 @@ bool RlogMessageParser::parseCanMessage( } for (uint8_t bus : updated_busses) { - std::vector signal_values; - parsers[bus]->update(can_data_list, signal_values); - for (auto& sg : signal_values) { + auto &parser = parsers[bus]; + auto updated_addresses = parser->update(can_data_list); + for (auto address : updated_addresses) { // TODO: plot all updated values - PJ::PlotData& _data_series = getSeries(topic_name + '/' + std::to_string(bus) + '/' + - packer->lookup_message(sg.address)->name + '/' + sg.name); - _data_series.pushBack({time_stamp, (double) sg.value}); + auto *state = parser->getMessageState(address); + auto name = topic_name + '/' + std::to_string(bus) + '/' + state->name; + for (int i = 0; i < state->parse_sigs.size(); ++i) { + PJ::PlotData& _data_series = getSeries(name + '/' + state->parse_sigs[i].name); + _data_series.pushBack({time_stamp, (double) state->vals[i]}); + } } // parser state @@ -215,7 +217,6 @@ bool RlogMessageParser::parseCanMessage( {(double)p->bus_timeout, "bus_timeout"}, {(double)p->bus_timeout_threshold, "bus_timeout_threshold"}, {(double)p->first_nanos, "first_nanos"}, - {(double)p->last_nanos, "last_nanos"}, {(double)p->last_nonempty_nanos, "last_nonempty_nanos"}, {(double)p->can_invalid_cnt, "can_invalid_cnt"}, };