Subscribing on minimal ExtRef definition
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.
Acceptance Criteria On checking existing subscriptions, the existing rules must be extended so that:
- have
srcLNClassdefaulting toLLN0when missing - have
srcLNInstdefaulting 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" />
What plug-ins are affected in this issue?
On which plug-ins does this occur?
- Later binding / message binding
- Goose / SMV
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)
The problem is likely to be found here:
Here, a query is constructed with the assumption that srcLNClass and srcLNInst are not empty.
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
The part in packages/plugins/src/editors/subscription/foundation#getExtRef is being used in the Message binding plugins
@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.
@DavoodSooran can you validate this story?
I suggest to close this issue and create an new issue and pull-request for the following finding: https://github.com/openscd/open-scd/issues/1556