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

Subscribing on minimal ExtRef definition #1532

Closed
JakobVogelsang opened this issue May 22, 2024 · 9 comments
Closed

Subscribing on minimal ExtRef definition #1532

JakobVogelsang opened this issue May 22, 2024 · 9 comments
Assignees
Labels
Kind: Bug Something isn't working

Comments

@JakobVogelsang
Copy link
Collaborator

As a user of OpenSCD I want to be able to see already existing subscriptions in OpenSCD in all circumstances. At the moment when an ExtRef element has missing srcLNClass and srcLNInst is interpreted as unsubscribe. That however is incorrect as
described here.

grafik

Acceptance Criteria
On checking existing subscriptions, the existing rules must be extended so that:

  • have srcLNClass defaulting to LLN0 when missing
  • have srcLNInst defaulting to empty string when missing

Example
<ExtRef iedName="AA1E1Q01BCU" ldInst="MV" ... srcLDInst="LD0" srcCBName="gcb" serviceType="GOOSE" /> must be interpreted as
<ExtRef iedName="AA1E1Q01BCU" ldInst="MV" ... srcLDInst="LD0" srcLNClass="LLN0" srcLNInst="" srcCBName="gcb" serviceType="GOOSE" />

@JakobVogelsang JakobVogelsang added the Kind: Bug Something isn't working label May 22, 2024
@Sander3003
Copy link
Member

What plug-ins are affected in this issue?

@pascalwilbrink
Copy link
Member

pascalwilbrink commented May 24, 2024

On which plug-ins does this occur?

  • Later binding / message binding
  • Goose / SMV

@JakobVogelsang
Copy link
Collaborator Author

It could appear in all the six subscriber plugins:

  • Later binding (GOOSE)
  • Later binding (SMV)
  • Message binding (GOOSE)
  • Message binding (SMV)
  • Data binding (GOOSE)
  • Data binding (SMV)

@JakobVogelsang
Copy link
Collaborator Author

The problem is likely to be found here:

grafik

Here, a query is constructed with the assumption that srcLNClass and srcLNInst are not empty.

@trusz trusz added this to Next Jul 2, 2024
@clepski
Copy link
Collaborator

clepski commented Jul 4, 2024

After having looked into the issue for GOOSE later binding the code that fetches the list for the subscribed list is here

https://github.com/openscd/open-scd/blob/main/packages/plugins/src/editors/subscription/later-binding/foundation.ts#L258-L271

and does not call packages/plugins/src/editors/subscription/foundation#getExtRef at all.

The filter for srcLNClass and srcLNInst is here

https://github.com/openscd/open-scd/blob/main/packages/plugins/src/editors/subscription/later-binding/foundation.ts#L164-L188

It looks like the check for srcLNClass fails, because a missing value is transformed to empty string and compared to lnElement.lnClass which is probably 'LLN0'. The srcLNInst passes, because a missing value is interpreted as empty string which is the default value by coincidence.

Take note that the comparison function converts missing element, missing attribute and missing value to empty string.

https://github.com/openscd/open-scd/blob/main/packages/plugins/src/editors/subscription/later-binding/foundation.ts#L126-L144

@clepski
Copy link
Collaborator

clepski commented Jul 4, 2024

The part in packages/plugins/src/editors/subscription/foundation#getExtRef is being used in the Message binding plugins

@JakobVogelsang
Copy link
Collaborator Author

@clepski this would be the file for the regression test. It has SMV and GOOSE services linked to the ExtRef and both would fail to show correct subscription at the moment.

dafaultSrcLNClassSrcLNInst.scd.zip

@Sander3003
Copy link
Member

@DavoodSooran can you validate this story?

@Sander3003
Copy link
Member

I suggest to close this issue and create an new issue and pull-request for the following finding: #1556

@github-project-automation github-project-automation bot moved this from In Progress to Done in Next Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind: Bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

4 participants