Skip to main content

dbc_codegen2/ir/
dbc.rs

1use crate::ir::{Message, Node, Signal, SignalLayout, message_layout::MessageLayout};
2
3#[derive(Debug, Default)]
4pub struct DbcFile {
5    pub nodes: Vec<Node>,
6    pub messages: Vec<Message>,
7    pub message_layouts: Vec<MessageLayout>,
8    pub signals: Vec<Signal>,
9    pub signal_layouts: Vec<SignalLayout>
10    //TODO: split signal into SignalLayout and SignalInstance
11    //      All core fields -> Layout
12    //      Instance has layout idx, name, receivers
13    //      Messages hold SignalInstanceIdx, also add MessageLayout
14    //      Later, in one of the passes all MessageLayouts are determined
15    //      Something like this should work
16
17    //TODO: consider how to use can_dbc::value_tables. Basically,
18    //      these are global enums for signal values
19
20    //TODO: can_dbc::comments and attribute_* stuff may be
21    //      used as metadata in generated code
22
23    //TODO: consider how to use can_dbc::signal_types and 
24    //      signal_type_refs. original dbc-codegen does not
25    //      support them. They allow to define a signal once
26    //      and then reuse them later.
27
28    //TODO: can_dbc::extended_multiplex is probably also needed
29}