diff --git a/packages/openscd/src/foundation.ts b/packages/openscd/src/foundation.ts index b30182842f..d1f92fdc0f 100644 --- a/packages/openscd/src/foundation.ts +++ b/packages/openscd/src/foundation.ts @@ -338,7 +338,7 @@ function lNodeIdentity(e: Element): string { 'lnType', ].map(name => e.getAttribute(name)); if (iedName === 'None') - return `${identity(e.parentElement)}>(${lnClass} ${lnType})`; + return `${identity(e.parentElement)}>(${lnClass} ${lnType} ${lnInst})`; return `${iedName} ${ldInst || '(Client)'}/${prefix ?? ''} ${lnClass} ${ lnInst ?? '' }`; @@ -347,7 +347,7 @@ function lNodeIdentity(e: Element): string { function lNodeSelector(tagName: SCLTag, identity: string): string { if (identity.endsWith(')')) { const [parentIdentity, childIdentity] = pathParts(identity); - const [lnClass, lnType] = childIdentity + const [lnClass, lnType, lnInst] = childIdentity .substring(1, childIdentity.length - 1) .split(' '); @@ -360,7 +360,7 @@ function lNodeSelector(tagName: SCLTag, identity: string): string { return crossProduct( parentSelectors, ['>'], - [`${tagName}[iedName="None"][lnClass="${lnClass}"][lnType="${lnType}"]`] + [`${tagName}[iedName="None"][lnClass="${lnClass}"][lnType="${lnType}"][lnInst="${lnInst}"]`] ) .map(strings => strings.join('')) .join(','); diff --git a/packages/plugins/test/unit/menu/__snapshots__/VirtualTemplateIED.test.snap.js b/packages/plugins/test/unit/menu/__snapshots__/VirtualTemplateIED.test.snap.js index 9f308faba4..b753457b04 100644 --- a/packages/plugins/test/unit/menu/__snapshots__/VirtualTemplateIED.test.snap.js +++ b/packages/plugins/test/unit/menu/__snapshots__/VirtualTemplateIED.test.snap.js @@ -1,7 +1,7 @@ /* @web/test-runner snapshot v1 */ export const snapshots = {}; -snapshots["Plugin that creates with some user input a virtual template IED - SPECIFICATION looks like the latest snapshot"] = +snapshots["Plugin that creates with some user input a virtual template IED - SPECIFICATION looks like the latest snapshot"] = ` CSWI 1 @@ -81,7 +81,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>QC9>Earth_Switch>(CILO OpenSCD_CILO)" + value="AA1>E1>Q01>QC9>Earth_Switch>(CILO OpenSCD_CILO 1)" > CILO 1 @@ -90,7 +90,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>QC9>Earth_Switch>(XSWI OpenSCD_XSWI_EarthSwitch)" + value="AA1>E1>Q01>QC9>Earth_Switch>(XSWI OpenSCD_XSWI_EarthSwitch 1)" > XSWI 1 @@ -148,7 +148,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>QB1>Disconnector>(CSWI OpenSCD_CSWI)" + value="AA1>E1>Q01>QB1>Disconnector>(CSWI OpenSCD_CSWI 1)" > CSWI 1 @@ -157,7 +157,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>QB1>Disconnector>(XSWI OpenSCD_XSWI_DIS)" + value="AA1>E1>Q01>QB1>Disconnector>(XSWI OpenSCD_XSWI_DIS 1)" > XSWI 1 @@ -166,7 +166,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>QB1>Disconnector>(CILO OpenSCD_CILO)" + value="AA1>E1>Q01>QB1>Disconnector>(CILO OpenSCD_CILO 1)" > CILO 1 @@ -224,7 +224,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>QA1>Circuit_Breaker>(CSWI OpenSCD_CSWI)" + value="AA1>E1>Q01>QA1>Circuit_Breaker>(CSWI OpenSCD_CSWI 1)" > CSWI 1 @@ -233,7 +233,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>QA1>Circuit_Breaker>(CILO OpenSCD_CILO)" + value="AA1>E1>Q01>QA1>Circuit_Breaker>(CILO OpenSCD_CILO 1)" > CILO 1 @@ -242,7 +242,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>QA1>Circuit_Breaker>(XCBR OpenSCD_XCBR)" + value="AA1>E1>Q01>QA1>Circuit_Breaker>(XCBR OpenSCD_XCBR 1)" > XCBR 1 @@ -292,7 +292,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>Timed_Overcurrent>(PTOC OpenSCD_PTOC)" + value="AA1>E1>Q01>Timed_Overcurrent>(PTOC OpenSCD_PTOC 2)" > ID_ PTOC 2 @@ -301,7 +301,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>Timed_Overcurrent>(PTOC OpenSCD_PTOC)" + value="AA1>E1>Q01>Timed_Overcurrent>(PTOC OpenSCD_PTOC 1)" > IDD_ PTOC 1 @@ -359,7 +359,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>Distance_Protection>Zone4>(PDIS OpenSCD_PDIS)" + value="AA1>E1>Q01>Distance_Protection>Zone4>(PDIS OpenSCD_PDIS 1)" > Zone4 PDIS 1 @@ -368,7 +368,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>Distance_Protection>Zon3>(PDIS OpenSCD_PDIS)" + value="AA1>E1>Q01>Distance_Protection>Zon3>(PDIS OpenSCD_PDIS 1)" > Zon3 PDIS 1 @@ -377,7 +377,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>Distance_Protection>Zone2>(PDIS OpenSCD_PDIS)" + value="AA1>E1>Q01>Distance_Protection>Zone2>(PDIS OpenSCD_PDIS 1)" > Zone2 PDIS 1 @@ -386,7 +386,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q01>Distance_Protection>Zone1>(PDIS OpenSCD_PDIS)" + value="AA1>E1>Q01>Distance_Protection>Zone1>(PDIS OpenSCD_PDIS 1)" > Zone1 PDIS 1 @@ -444,7 +444,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q02>QB1>Disconnector>(CSWI OpenSCD_CSWI)" + value="AA1>E1>Q02>QB1>Disconnector>(CSWI OpenSCD_CSWI 1)" > CSWI 1 @@ -453,7 +453,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q02>QB1>Disconnector>(XSWI OpenSCD_XSWI_DIS)" + value="AA1>E1>Q02>QB1>Disconnector>(XSWI OpenSCD_XSWI_DIS 1)" > XSWI 1 @@ -462,7 +462,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>E1>Q02>QB1>Disconnector>(CILO OpenSCD_CILO)" + value="AA1>E1>Q02>QB1>Disconnector>(CILO OpenSCD_CILO 1)" > CILO 1 @@ -520,7 +520,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>J1>Q01>QC9>Earth_Switch>(CSWI OpenSCD_CSWI)" + value="AA1>J1>Q01>QC9>Earth_Switch>(CSWI OpenSCD_CSWI 1)" > CSWI 1 @@ -529,7 +529,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>J1>Q01>QC9>Earth_Switch>(CILO OpenSCD_CILO)" + value="AA1>J1>Q01>QC9>Earth_Switch>(CILO OpenSCD_CILO 1)" > CILO 1 @@ -538,7 +538,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE graphic="control" mwc-list-item="" tabindex="-1" - value="AA1>J1>Q01>QC9>Earth_Switch>(XSWI OpenSCD_XSWI_EarthSwitch)" + value="AA1>J1>Q01>QC9>Earth_Switch>(XSWI OpenSCD_XSWI_EarthSwitch 1)" > XSWI 1 @@ -569,7 +569,7 @@ snapshots["Plugin that creates with some user input a virtual template IED - SPE `; /* end snapshot Plugin that creates with some user input a virtual template IED - SPECIFICATION looks like the latest snapshot */ -snapshots["Plugin that creates with some user input a virtual template IED - SPECIFICATION IEDs data model show selected logical nodes and its structure"] = +snapshots["Plugin that creates with some user input a virtual template IED - SPECIFICATION IEDs data model show selected logical nodes and its structure"] = `