Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser_pyx: build value maps for requied messages #939

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions can/parser_pyx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ cdef class CANParser:
msg_name_to_address[name] = msg.address
address_to_msg_name[msg.address] = name

self.vl[msg.address] = {}
self.vl[name] = self.vl[msg.address]
self.vl_all[msg.address] = {}
self.vl_all[name] = self.vl_all[msg.address]
self.ts_nanos[msg.address] = {}
self.ts_nanos[name] = self.ts_nanos[msg.address]

# Convert message names into addresses and check existence in DBC
cdef vector[pair[uint32_t, int]] message_v
for i in range(len(messages)):
Expand All @@ -62,6 +55,14 @@ cdef class CANParser:
raise RuntimeError(f"could not find message {repr(c[0])} in DBC {self.dbc_name}")
message_v.push_back((address, c[1]))

name = address_to_msg_name[address]
self.vl[address] = {}
self.vl[name] = self.vl[address]
self.vl_all[address] = {}
self.vl_all[name] = self.vl_all[address]
self.ts_nanos[address] = {}
self.ts_nanos[name] = self.ts_nanos[address]

self.can = new cpp_CANParser(bus, dbc_name, message_v)
self.update_strings([])

Expand Down