Closed danyill closed 1 year ago
The logic seems wrong to me.
/** * Edition 2 and later SCL files allow to restrict subscription on * later binding type inputs (`ExtRef` elements) based on a `CDC` and * basic type `bType`. * @param extRef - A later binding type input in the sink IED * @returns data objects `CDC` and data attribute basic type `bType` or `null` */ export function inputRestriction(extRef: Element): { cdc: string | null; bType: string | null; } { const [pLN, pDO, pDA] = ['pLN', 'pDO', 'pDA'].map(attr => extRef.getAttribute(attr) ); if (!pLN || !pDO || !pDA) return { cdc: null, bType: null }; const anyLns = Array.from( extRef .closest('IED') ?.querySelectorAll(`LN[lnClass="${pLN}"],LN0[lnClass="${pLN}"]`) ?? [] ); for (const anyLn of anyLns) { const dataSpec = dataAttributeSpecification(anyLn, pDO, pDA); if (dataSpec.cdc !== null && dataSpec.bType !== null) return dataSpec; } return { cdc: null, bType: null }; }
This bit doesn't seem right:
const anyLns = Array.from( extRef .closest('IED') ?.querySelectorAll(`LN[lnClass="${pLN}"],LN0[lnClass="${pLN}"]`) ?? [] );
anyLns should be based off all IEDs I would have thought?
Fixed in b2d1d64ada2653c918230cd39786b8f4a47e2db7
The logic seems wrong to me.
This bit doesn't seem right:
anyLns should be based off all IEDs I would have thought?