Skip to content

Commit 9878259

Browse files
author
Rob Tjalma
authored
feat(plugins/IED): Add icon set to IED editor containers
1 parent c2b14fb commit 9878259

22 files changed

+55
-240
lines changed

src/Logging.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
OpenDocEvent,
3636
SclhistoryEntry,
3737
} from './foundation.js';
38-
import { getFilterIcon, iconColors } from './icons.js';
38+
import { getFilterIcon, iconColors } from './icons/icons.js';
3939
import { Plugin } from './Plugging.js';
4040

4141
const icons = {

src/editors/ied/access-point-container.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import './server-container.js'
1212
import { nothing } from 'lit-html';
1313
import { getDescriptionAttribute, getNameAttribute } from '../../foundation.js';
1414
import { Nsdoc } from '../../foundation/nsdoc.js';
15+
import { accessPointIcon } from '../../icons/ied-icons.js';
1516

1617
/** [[`IED`]] plugin subeditor for editing `AccessPoint` element. */
1718
@customElement('access-point-container')
@@ -34,12 +35,13 @@ export class AccessPointContainer extends LitElement {
3435

3536
render(): TemplateResult {
3637
return html`<action-pane .label="${this.header()}">
37-
${Array.from(this.element.querySelectorAll(':scope > Server')).map(
38-
server => html`<server-container
39-
.element=${server}
40-
.nsdoc=${this.nsdoc}
41-
.ancestors=${[this.element, ...this.ancestors]}
42-
></server-container>`)}
38+
<mwc-icon slot="icon">${accessPointIcon}</mwc-icon>
39+
${Array.from(this.element.querySelectorAll(':scope > Server')).map(server =>
40+
html`<server-container
41+
.element=${server}
42+
.nsdoc=${this.nsdoc}
43+
.ancestors=${[this.element, ...this.ancestors]}
44+
></server-container>`)}
4345
</action-pane>`;
4446
}
4547

src/editors/ied/ied-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ export class IedContainer extends LitElement {
3939

4040
render(): TemplateResult {
4141
return html`<action-pane .label="${this.header()}">
42+
<mwc-icon slot="icon">developer_board</mwc-icon>
4243
<abbr slot="action" title="${translate('edit')}">
4344
<mwc-icon-button
4445
icon="edit"
4546
@click=${() => this.openEditWizard()}
4647
></mwc-icon-button>
4748
</abbr>
48-
4949
${Array.from(this.element.querySelectorAll(':scope > AccessPoint')).map(
5050
ap => html`<access-point-container
5151
.element=${ap}

src/editors/ied/ldevice-container.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { getDescriptionAttribute, getInstanceAttribute, getNameAttribute } from
1515
import { IconButtonToggle } from '@material/mwc-icon-button-toggle';
1616
import { translate } from 'lit-translate';
1717
import { Nsdoc } from '../../foundation/nsdoc.js';
18+
import { logicalDeviceIcon } from '../../icons/ied-icons.js';
1819

1920
/** [[`IED`]] plugin subeditor for editing `LDevice` element. */
2021
@customElement('ldevice-container')
@@ -45,6 +46,7 @@ export class LDeviceContainer extends LitElement {
4546
const lnElements = Array.from(this.element.querySelectorAll(':scope > LN,LN0'));
4647

4748
return html`<action-pane .label="${this.header()}">
49+
<mwc-icon slot="icon">${logicalDeviceIcon}</mwc-icon>
4850
${lnElements.length > 0 ? html`<abbr slot="action" title="${translate('iededitor.toggleChildElements')}">
4951
<mwc-icon-button-toggle
5052
on

src/editors/ied/server-container.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99

1010
import '../../action-pane.js';
1111
import { Nsdoc } from '../../foundation/nsdoc.js';
12+
import { serverIcon } from '../../icons/ied-icons.js';
1213
import './ldevice-container.js';
1314

1415
/** [[`IED`]] plugin subeditor for editing `Server` element. */
@@ -29,12 +30,13 @@ export class ServerContainer extends LitElement {
2930

3031
render(): TemplateResult {
3132
return html`<action-pane label="${this.header()}">
32-
${Array.from(this.element.querySelectorAll(':scope > LDevice')).map(
33-
server => html`<ldevice-container
34-
.element=${server}
35-
.nsdoc=${this.nsdoc}
36-
.ancestors=${[this.element, ...this.ancestors]}
37-
></ldevice-container>`)}
33+
<mwc-icon slot="icon">${serverIcon}</mwc-icon>
34+
${Array.from(this.element.querySelectorAll(':scope > LDevice')).map(server =>
35+
html`<ldevice-container
36+
.element=${server}
37+
.nsdoc=${this.nsdoc}
38+
.ancestors=${[this.element, ...this.ancestors]}
39+
></ldevice-container>`)}
3840
</action-pane>`;
3941
}
4042

src/editors/singlelinediagram/sld-drawing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
connectivityNodeIcon,
55
editIcon,
66
powerTransformerTwoWindingIcon,
7-
} from '../../icons.js';
7+
} from '../../icons/icons.js';
88

99
import {
1010
getRelativeCoordinates,

src/icons.ts renamed to src/icons/icons.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -82,50 +82,6 @@ export function getFilterIcon(
8282
</svg> `;
8383
}
8484

85-
export const iedIcon = html`<svg
86-
xmlns="http://www.w3.org/2000/svg"
87-
width="24"
88-
height="24"
89-
viewBox="0 0 24 24"
90-
>
91-
<rect
92-
width="20"
93-
height="20"
94-
x="2"
95-
y="2"
96-
rx="2"
97-
ry="2"
98-
fill="transparent"
99-
stroke="currentColor"
100-
stroke-width="1.5"
101-
/>
102-
<rect width="8" height="10" x="12" y="4" />
103-
104-
<circle cx="4" cy="6" r="0.5" />
105-
<line x1="6" y1="6" x2="10" y2="6" stroke="currentColor" stroke-width="1.5" />
106-
<circle cx="4" cy="8" r="0.5" />
107-
<line x1="6" y1="8" x2="10" y2="8" stroke="currentColor" stroke-width="1.5" />
108-
<circle cx="4" cy="10" r="0.5" />
109-
<line
110-
x1="6"
111-
y1="10"
112-
x2="10"
113-
y2="10"
114-
stroke="currentColor"
115-
stroke-width="1.5"
116-
/>
117-
118-
<rect x="4" y="13.5" width="2" height="2" />
119-
<rect x="4" y="16" width="2" height="2" />
120-
<rect x="4" y="18.5" width="2" height="2" />
121-
<rect x="6.5" y="13.5" width="2" height="2" />
122-
<rect x="6.5" y="16" width="2" height="2" />
123-
<rect x="6.5" y="18.5" width="2" height="2" />
124-
<rect x="9" y="13.5" width="2" height="2" />
125-
<rect x="9" y="16" width="2" height="2" />
126-
<rect x="9" y="18.5" width="2" height="2" />
127-
</svg>`;
128-
12985
export const networkConfigIcon = html`<svg
13086
xmlns="http://www.w3.org/2000/svg"
13187
slot="icon"

src/icons/ied-icons.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { svg } from "lit-element";
2+
3+
export const accessPointIcon = svg`<svg style="width:24px;height:24px" viewBox="0 0 24 24">
4+
<path fill="currentColor" d="M4.93,4.93C3.12,6.74 2,9.24 2,12C2,14.76 3.12,17.26 4.93,19.07L6.34,17.66C4.89,16.22 4,14.22 4,12C4,9.79 4.89,7.78 6.34,6.34L4.93,4.93M19.07,4.93L17.66,6.34C19.11,7.78 20,9.79 20,12C20,14.22 19.11,16.22 17.66,17.66L19.07,19.07C20.88,17.26 22,14.76 22,12C22,9.24 20.88,6.74 19.07,4.93M7.76,7.76C6.67,8.85 6,10.35 6,12C6,13.65 6.67,15.15 7.76,16.24L9.17,14.83C8.45,14.11 8,13.11 8,12C8,10.89 8.45,9.89 9.17,9.17L7.76,7.76M16.24,7.76L14.83,9.17C15.55,9.89 16,10.89 16,12C16,13.11 15.55,14.11 14.83,14.83L16.24,16.24C17.33,15.15 18,13.65 18,12C18,10.35 17.33,8.85 16.24,7.76M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10Z" />
5+
</svg>`;
6+
7+
export const serverIcon = svg`<svg style="width:24px;height:24px" viewBox="0 0 24 24">
8+
<path fill="currentColor" d="M4,1H20A1,1 0 0,1 21,2V6A1,1 0 0,1 20,7H4A1,1 0 0,1 3,6V2A1,1 0 0,1 4,1M4,9H20A1,1 0 0,1 21,10V14A1,1 0 0,1 20,15H4A1,1 0 0,1 3,14V10A1,1 0 0,1 4,9M4,17H20A1,1 0 0,1 21,18V22A1,1 0 0,1 20,23H4A1,1 0 0,1 3,22V18A1,1 0 0,1 4,17M9,5H10V3H9V5M9,13H10V11H9V13M9,21H10V19H9V21M5,3V5H7V3H5M5,11V13H7V11H5M5,19V21H7V19H5Z" />
9+
</svg>`;
10+
11+
export const logicalDeviceIcon = svg`<svg style="width:24px;height:24px" viewBox="0 0 24 24">
12+
<path fill="currentColor" d="M13,13H18V15H13M13,9H18V11H13M6.91,7.41L11.5,12L6.91,16.6L5.5,15.18L8.68,12L5.5,8.82M5,3C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3H5Z" />
13+
</svg>`;

src/menu/Help.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import '@material/mwc-icon';
66

77
import '../finder-list.js';
88
import { newWizardEvent, Wizard } from '../foundation.js';
9-
import { openSCDIcon } from '../icons.js';
9+
import { openSCDIcon } from '../icons/icons.js';
1010
import { Directory } from '../finder-list.js';
1111

1212
function aboutBox(version: string) {

src/wizards/clientln.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
WizardActor,
1818
WizardInput,
1919
} from '../foundation.js';
20-
import { clientIcon } from '../icons.js';
20+
import { clientIcon } from '../icons/icons.js';
2121
import { openCommunicationMappingWizard } from './commmap-wizards.js';
2222

2323
function getPath(identity: string | number): string {

0 commit comments

Comments
 (0)