-
Notifications
You must be signed in to change notification settings - Fork 37
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
Begin creating script that converts YAML file to DBC file. #21
base: main
Are you sure you want to change the base?
Conversation
|
||
def dbcSignalGenerator(signals_dict, dbc_file): | ||
''' | ||
Input: DBC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doc string could be better
|
||
yaml_dict = loadYaml(yaml_filename) | ||
messagesTX_dict = yaml_dict["Messages-TX"] | ||
messagesRX_dict = yaml_dict["Messages-RX"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment out if not using for now
nice work! only major comment is that it would be nice if you put some thought into error catching, generally better to have functions return a success/error code rather than have them just run and write something to a file |
…jackiezeng01/main
…jackiezeng01/main
…jackiezeng01/main
|
||
# Parse signal dict and set variables to be used to generate DBC | ||
SIGNAL_NAME = signal | ||
global BIT_START |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any particular reason why we need this to be global instead of just initializing it as BIT_START=0
at the top of function?
# lets start by just extracting the info thats therews | ||
output = {} | ||
for index, row in data.iterrows(): | ||
if index > 16 or index < 11: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
magic numbers? please leave a comment for this
row_out['purpose'] = row['Purpose'].strip() | ||
|
||
signal_names = [] | ||
for i in range(8): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there always 8 signals? can we make this a flexible range instead of hard-coded?
Is this still being worked on? |
No description provided.