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

Use individual signal's "GenSigStartValue" as default value when merging dbc files #795

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

jmailloux
Copy link
Contributor

The previous code used the db's GenSigStartValue as the default value for all signals. That should only be used if an individual signal doesn't have a GenSigStartValue. This fixes signal's losing their GenSigStartValue after a dbc merge. Sometimes it would cause the GenSigStartValue to be outside of the min / max value.
Also specifically imported Optional so the code would run in Python 3.12.

individual signal's start values.  That could
make them be set outside of the min / max
values they have.
@ebroecker
Copy link
Owner

Hi @jmailloux ,

thanks for you pr.
It seems, you are deleting some code for using the db's GenSigStartValue even if there is no GenSigStartValue for the signal defined. No sure, I need to have a closer look...

Meanwhile, could you resolve the conflicts?
Thanks

@jmailloux
Copy link
Contributor Author

Hi @jmailloux ,

thanks for you pr. It seems, you are deleting some code for using the db's GenSigStartValue even if there is no GenSigStartValue for the signal defined. No sure, I need to have a closer look...

Meanwhile, could you resolve the conflicts? Thanks

Hi @ebroecker , no problem. I've done the merge.
I fixed a problem where the merging of dbc files would actually blow away individual signal GenSigStartValue. For merges, when the dump function is called the signal's initial value would already have been correctly set. The old code used the dbc's default GenSigStartValue, which would in effect overwrite the intended GenSigStartValue.
The updates to the load function prevent the signal's initial to be set to something that is outside the min / max values for the signal.

@ebroecker ebroecker merged commit db8298d into ebroecker:development Jun 5, 2024
1 check failed
@ebroecker
Copy link
Owner

@jmailloux

this patch fails 2 tests:

tests/test_dbc.py::test_signal_inital_value
tests/test_dbc.py::test_default_initial_value

could you please have another look on it?
[Sorry for this late finding, ...]

@jmailloux
Copy link
Contributor Author

@ebroecker - sure. I will have a look at this.

ebroecker pushed a commit that referenced this pull request Jul 4, 2024
this should be an addon to pr #795
@ebroecker
Copy link
Owner

hi @jmailloux

maybe you find time to have a look on #810

Hopefully I fixed the dbc initial value behaviour

ebroecker added a commit that referenced this pull request Jul 12, 2024
this should be an addon to pr #795

Co-authored-by: Eduard Bröcker <conuslt@eduard-broecker.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants