Skip to content

Commit ea59f70

Browse files
authored
feat(editors/laterbinding): Filter later binding GOOSE/SMV by serviceType (closes openscd#1150) (openscd#1151)
1 parent cf65a50 commit ea59f70

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/editors/subscription/later-binding/ext-ref-later-binding-list.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ export class ExtRefLaterBindingList extends LitElement {
5656
@state()
5757
currentIedElement: Element | undefined;
5858

59+
serviceTypeLookup = {
60+
GSEControl: 'GOOSE',
61+
SampledValueControl: 'SMV',
62+
};
63+
5964
constructor() {
6065
super();
6166

@@ -232,7 +237,13 @@ export class ExtRefLaterBindingList extends LitElement {
232237
<Element>this.doc.getRootNode(),
233238
this.currentSelectedFcdaElement,
234239
true
235-
).filter(extRefElement => !isSubscribed(extRefElement));
240+
).filter(
241+
extRefElement =>
242+
!isSubscribed(extRefElement) &&
243+
(!extRefElement.hasAttribute('serviceType') ||
244+
extRefElement.getAttribute('serviceType') ===
245+
this.serviceTypeLookup[this.controlTag])
246+
);
236247
}
237248

238249
private renderTitle(): TemplateResult {

test/testfiles/editors/LaterBindingGOOSE-LGOS.scd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
<ExtRef iedName="GOOSE_Publisher" serviceType="GOOSE" ldInst="QB2_Disconnector" lnClass="CSWI" lnInst="1" prefix="" doName="Pos" daName="stVal" srcLDInst="QB2_Disconnector" srcPrefix="" srcLNClass="LLN0" srcCBName="GOOSE2" intAddr="Pos;CSWI1/Pos/stVal" desc="Interlocking.Input2"/>
134134
<ExtRef iedName="GOOSE_Publisher" serviceType="GOOSE" ldInst="QB2_Disconnector" lnClass="CSWI" lnInst="1" prefix="" doName="Pos" daName="q" srcLDInst="QB2_Disconnector" srcPrefix="" srcLNClass="LLN0" srcCBName="GOOSE2" intAddr="Pos;CSWI1/Pos/q" desc="Interlocking.Input2"/>
135135
<ExtRef intAddr="someRestrictedExtRef" desc="Restricted To Pos" pLN="CSWI" pDO="Pos" pDA="stVal"/>
136+
<ExtRef intAddr="someWeirdAnalogue" serviceType="SMV"/>
136137
</Inputs>
137138
</LN>
138139
<LN prefix="" lnClass="XSWI" inst="1" lnType="Dummy.XSWI"/>
@@ -548,4 +549,4 @@
548549
<EnumVal ord="8">process</EnumVal>
549550
</EnumType>
550551
</DataTypeTemplates>
551-
</SCL>
552+
</SCL>

test/testfiles/editors/LaterBindingSMV-LSVS.scd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
<ExtRef intAddr="AmpSv;TCTR2/AmpSv/q" desc="MeasPoint.CT1"/>
8989
<ExtRef intAddr="AmpSv;TCTR3/AmpSv/instMag.i" desc="MeasPoint.CT3"/>
9090
<ExtRef intAddr="AmpSv;TCTR3/AmpSv/q" desc="MeasPoint.CT1"/>
91+
<ExtRef intAddr="sillyLikeA" serviceType="GOOSE"/>
9192
</Inputs>
9293
</LN>
9394
</LDevice>

0 commit comments

Comments
 (0)