Skip to content

Commit

Permalink
Ensure supervisions and unused CBs are sorted (closes #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
danyill committed Aug 29, 2024
1 parent 365edc9 commit 27ad6df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions oscd-supervision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ function getOtherIedControlElements(
const iedName = getNameAttribute(ied!);
return Array.from(
ied.ownerDocument.querySelectorAll(`LN0 > ${controlTag[controlType]}`)
).filter(cb => getNameAttribute(cb.closest('IED')!) !== iedName);
)
.filter(cb => getNameAttribute(cb.closest('IED')!) !== iedName)
.sort((a, b) => `${identity(a)}`.localeCompare(`${identity(b)}`));
}

/**
Expand All @@ -250,7 +252,7 @@ function getSupervisionLNs(

return Array.from(
ied.querySelectorAll(`LN[lnClass="${supervisionLnType[controlType]}"]`)
);
).sort((a, b) => `${identity(a)}`.localeCompare(`${identity(b)}`));
}

/**
Expand Down

0 comments on commit 27ad6df

Please sign in to comment.