Skip to content

Commit

Permalink
Revise earth switch detection logic. Closes openscd#459
Browse files Browse the repository at this point in the history
  • Loading branch information
danyill committed Dec 29, 2021
1 parent 9944b49 commit 43d0467
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/wizards/conductingequipment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ const types: Partial<Record<string, string>> = {

function typeStr(condEq: Element): string {
return condEq.getAttribute('type') === 'DIS' &&
condEq.querySelector('Terminal')?.getAttribute('cNodeName') === 'grounded'
Array.from(condEq.querySelectorAll('Terminal'))
.map(t => t.getAttribute('cNodeName'))
.includes('grounded')
? 'ERS'
: condEq.getAttribute('type') ?? '';
}
Expand Down
4 changes: 3 additions & 1 deletion src/zeroline/foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ export function getIcon(condEq: Element): TemplateResult {
function typeStr(condEq: Element): string {
if (
condEq.getAttribute('type') === 'DIS' &&
condEq.querySelector('Terminal')?.getAttribute('cNodeName') === 'grounded'
Array.from(condEq.querySelectorAll('Terminal'))
.map(t => t.getAttribute('cNodeName'))
.includes('grounded')
) {
return 'ERS';
} else {
Expand Down

0 comments on commit 43d0467

Please sign in to comment.