-
Notifications
You must be signed in to change notification settings - Fork 207
Gracefully handle readonly entries in PdoMap.save() (fixes #541) #593
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
Gracefully handle readonly entries in PdoMap.save() (fixes #541) #593
Conversation
For PDO communication or mapping parameters which are read-only on a node, the PdoMap.save() method currently aborts with an SDO exception. However, individual parameters may simply not support configuration changes. Rely on the Object Dictionary to tell which ones are expected to fail and skip them. For communication record entries, log what is not being saved.
This is an alternative approach to #542, with improvements based on the discussion there. |
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
The one missing line reported by Codecov is related to the hack for supporting Curtis' mixed up mapping entries. I don't feel like putting effort into that part. |
I'd like to add something to consider. I know that this PR is not considering the upcoming asyncio PR yet, but I'd like to inform that the I would have love if we were able to take this into consideration when refactoring |
I'm not at all opposed to refactoring this as needed. However, to move forward quickly, I'd rather limit this PR's scope to fixing the actual unwanted / faulty behavior. |
No problem. As a consequence I need to update the asyncio PR to reflect the result of this PR. |
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 you formatting with black on the new stuff? Because its going a bit back an forth between splitting on the lines and joining them. E.g. base.py L439 is split up, while L450 is collected together.
It's cosmetics. The code changes looks good.
Yes, I take black as a reference for how to format new / changed code. In this case, it's simply based on the line length limit of 96 I have configured. The old style was non-conformant in both cases, and the new loop variable allowed some shortening. |
For PDO communication or mapping parameters which are read-only on a
node, the
PdoMap.save()
method currently aborts with an SDO exception.However, individual parameters may simply not support configuration
changes. Rely on the Object Dictionary to tell which ones are
expected to fail and skip them. For communication record entries, log
what is not being saved.