Skip to content

Commit

Permalink
feat(editors/subtation): add l-node-editor to Substation
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobVogelsang committed May 9, 2022
1 parent 11d09a6 commit b7e57d6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/editors/substation/substation-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ export class SubstationEditor extends LitElement {
this.addMenu.anchor = <HTMLElement>this.addButton;
}

private renderLNodes(): TemplateResult {
if (!this.showfunctions) return html``;

const lNodes = getChildElementsByTagName(this.element, 'LNode');

return lNodes.length
? html`<div class="container lnode">
${lNodes.map(
lNode => html`<l-node-editor .element=${lNode}></l-node-editor>`
)}
</div>`
: html``;
}

renderFunctions(): TemplateResult {
if (!this.showfunctions) return html``;

Expand Down Expand Up @@ -207,7 +221,7 @@ export class SubstationEditor extends LitElement {
>${this.renderAddButtons()}</mwc-menu
>
</abbr>
${this.renderIedContainer()}${this.renderFunctions()}
${this.renderIedContainer()}${this.renderLNodes()}${this.renderFunctions()}
${this.renderPowerTransformerContainer()}
${Array.from(this.element.querySelectorAll(selectors.VoltageLevel)).map(
voltageLevel =>
Expand Down
3 changes: 3 additions & 0 deletions test/testfiles/zeroline/functions.scd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
</History>
</Header>
<Substation name="AA1" desc="Substation">
<LNode iedName="IED1" ldInst="CircuitBreaker_CB1" prefix="" lnClass="XCBR" lnInst="1"/>
<LNode iedName="IED1" ldInst="CircuitBreaker_CB1" prefix="" lnClass="CSWI" lnInst="1"/>
<LNode iedName="IED1" ldInst="CircuitBreaker_CB1" prefix="" lnClass="CILO" lnInst="1"/>
<Function name="myFunc" desc="myDesc" type="myFuncType">
<SubFunction name="mySubFunc"/>
</Function>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@ snapshots["substation-editor with function filter deactivated looks like the lat
</mwc-list-item>
</mwc-menu>
</abbr>
<div class="container lnode">
<l-node-editor>
</l-node-editor>
<l-node-editor>
</l-node-editor>
<l-node-editor>
</l-node-editor>
</div>
<function-editor>
</function-editor>
<div class="ptrContent">
Expand All @@ -283,6 +291,8 @@ snapshots["substation-editor with function filter deactivated looks like the lat
</div>
<voltage-level-editor showfunctions="">
</voltage-level-editor>
<voltage-level-editor showfunctions="">
</voltage-level-editor>
</action-pane>
`;
/* end snapshot substation-editor with function filter deactivated looks like the latest snapshot */
Expand Down

0 comments on commit b7e57d6

Please sign in to comment.