Support relation attributes in attribute_structs - #192
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
fa35025 to
180dcce
Compare
for more information, see https://pre-commit.ci
|
|
||
| ```rust,ignore | ||
| impl SomeMessage { | ||
| pub const SOME_SIGNAL_ECU2_SIG_TIMEOUT: relation::SigTimeoutInfo = |
There was a problem hiding this comment.
Would it make sense as a use case to filter only the attributes for a specific node/ECU without including the node name (like SOME_SIGNAL_SIG_TIMEOUT)? The code wouldn’t have to hardcode the nodename for reusability?
There was a problem hiding this comment.
Good idea, I've added an optional for_node argument that generates constants only for a specific node/ECU and removes the node prefix from the generated constant names.
| continue; | ||
| } | ||
| let node_ident = | ||
| sanitize_name(node, "x", ToSnakeCase::to_snake_case).to_uppercase(); |
There was a problem hiding this comment.
used on two places, can we unify like its done with MessageExt?
| dbc: &'a Dbc, | ||
| node_name: &str, | ||
| message_id: MessageId, | ||
| signal_name: &str, |
There was a problem hiding this comment.
(could passing Option<&str> reduce duplication with resolved_node_message_attribute?)
824df38 to
a7d891d
Compare
for more information, see https://pre-commit.ci
Adds support for DBC
BA_DEF_REL_/BA_REL_relation attributes to the existingattribute_structsoption. This is useful for DBCs that define per-node/signal or per-node/message metadata, like a per-receiverGenSigTimeoutTime, that can't be expressed as a plain message or signal attribute. I have added an example in the README to show the syntax.