-
Notifications
You must be signed in to change notification settings - Fork 1
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
The selector function for ExtRefs doesn't support indexing #14
Comments
I suspect the solution is to use the And this whole thing is a bit of an edge case. It would be truly righteous one day to run a battery of tests through an SCL file of testing each element with identity/selector and seeing if exactly the same element is identified. |
@JakobVogelsang do you think @danyill 's solution would suffice? |
Absolutely, this is the solution. I wonder why this worked up until now in open-scd. So far I can see There is the clause looking for |
Describe the bug
Uniqueness of the SCL ExtRef element is difficult and we have a complex
identity
function to do this job. Theidentity
function appears to correctly identify ExtRefs with the sameintAddr
but theselector
function does not.For a specific case which happens to occur in one of our testfiles where we have:
We produce the identities for these of:
But the same (complicated!) selector function:
To Reproduce
Steps to reproduce the behavior:
test/testfiles/editors/LaterBindingGOOSE2007B4.scd
Expected behavior
Either
(a) it is illegitimate to have two ExtRefs identified by the same
intAddr
(b) the selector function must support indexing.
It seems an anti-pattern to have two ExtRefs with the same
intAddr
, but it seems possible (and within the same Inputs section) from the standard. I could imagine doing this while specifying thepXX
attributes to allow "parts" of an SPS to be mapped.Additional context
While moving later-binding subscription to a core plugin (temporarily, here), I noticed this as I was storing the identity in a
data-extref
field and then using the selector to find the element rather than using closures as we do in our present plugin. Referencing the incorrect ExtRef was quite apparent to me there as it resulted in incorrect behaviour when unsubscribing.The text was updated successfully, but these errors were encountered: