Generate enum-typed setters and constructors for signals with value descriptions#178
Open
felixvanoost wants to merge 9 commits into
Open
Generate enum-typed setters and constructors for signals with value descriptions#178felixvanoost wants to merge 9 commits into
felixvanoost wants to merge 9 commits into
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
new()constructors andset_<signal>()setters to accept enums for signals that have an associated enum type (value description in the DBC).set_<signal>_raw()setters for signals that have an associated enum type, which matches the existing behaviour ofset_<signal>before these changes. This now makes the API for the getters and setters symmetrical.This is a breaking change for DBCs that have signals with value descriptions, but should make these signals much cleaner to handle. The best approach is to directly pass the enum-typed signals into
set_<signal>, but you can retain the existing behaviour by simply usingset_<signal>_rawinstead.This PR should be stacked on top of #176.