Skip to content

Commit a997620

Browse files
author
Dennis Labordus
authored
Merge pull request #169 from com-pas/upstream-v0.19.0
Upstream v0.19.0
2 parents eda57a2 + 92ce353 commit a997620

File tree

58 files changed

+5518
-457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+5518
-457
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [0.19.0](https://github.com/openscd/open-scd/compare/v0.18.0...v0.19.0) (2022-07-11)
6+
7+
8+
### Features
9+
10+
* **editors/publisher:** filter for control blocks and DataSets ([#844](https://github.com/openscd/open-scd/issues/844)) ([4c663d0](https://github.com/openscd/open-scd/commits/4c663d0374129894eb61168404e0d47aab28694f))
11+
* **editors:** Show label of Action Pane also as tool-tip ([#838](https://github.com/openscd/open-scd/issues/838)) ([492778f](https://github.com/openscd/open-scd/commits/492778ff02812a06e96df775f1040f96b24642be))
12+
* **menu/VirtualTemplateIED:** automatically create virtual IEDs ([#806](https://github.com/openscd/open-scd/issues/806)) ([dc59736](https://github.com/openscd/open-scd/commits/dc59736111c73450cebb3b1f9963886f3dc94d90))
13+
14+
15+
### Bug Fixes
16+
17+
* **editor/subscriber:** make sure to add all mendatory attributes to ExtRef ([b814c00](https://github.com/openscd/open-scd/commits/b814c007514e18f1aacb6698eb2c747459d6f5da))
18+
* **editors/substation:** update on action ([#852](https://github.com/openscd/open-scd/issues/852)) ([7af5b5c](https://github.com/openscd/open-scd/commits/7af5b5c2e74841cb75629b10f1349dd96ae86ab2))
19+
* **editors/template:** make sure that edit wizards are always opened ([#845](https://github.com/openscd/open-scd/issues/845)) ([15c2d3b](https://github.com/openscd/open-scd/commits/15c2d3b08c1d2ef20e0b7e239c1e0a6056ed4d30))
20+
* **Pluggin/Hosting:** allow using own dialogs in menu plugins ([#843](https://github.com/openscd/open-scd/issues/843)) ([a9bad36](https://github.com/openscd/open-scd/commits/a9bad366bec77060a1f4efa4622a3d5b356753fc))
21+
522
## [0.18.0](https://github.com/openscd/open-scd/compare/v0.17.0...v0.18.0) (2022-06-30)
623

724

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@
4040
"purpose": "maskable"
4141
}
4242
],
43-
"version": "0.18.0"
43+
"version": "0.19.0"
4444
}

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "open-scd",
3-
"version": "0.18.0",
3+
"version": "0.19.0",
44
"repository": "https://github.com/openscd/open-scd.git",
55
"description": "A bottom-up substation configuration designer for projects described using SCL `IEC 61850-6` Edition 2 or greater.",
66
"keywords": [

public/js/plugins.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ export const officialPlugins = [
6262
default: true,
6363
kind: 'editor',
6464
},
65+
{
66+
name: 'Publisher',
67+
src: '/src/editors/Publisher.js',
68+
icon: 'publish',
69+
default: false,
70+
kind: 'editor',
71+
},
6572
{
6673
name: 'Open project',
6774
src: '/src/menu/CompasOpen.js',
@@ -146,6 +153,15 @@ export const officialPlugins = [
146153
requireDoc: true,
147154
position: 'middle',
148155
},
156+
{
157+
name: 'Create Virtual IED',
158+
src: '/src/menu/VirtualTemplateIED.js',
159+
icon: 'developer_board',
160+
default: false,
161+
kind: 'menu',
162+
requireDoc: true,
163+
position: 'middle'
164+
},
149165
{
150166
name: 'Subscriber Update',
151167
src: '/src/menu/SubscriberInfo.js',

src/Hosting.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import { Plugin, PluggingElement, pluginIcons } from './Plugging.js';
2121
import { SettingElement } from './Setting.js';
2222

2323
import { UserInfoEvent } from './foundation.js';
24-
import { string } from 'fast-check';
2524

2625
interface MenuItem {
2726
icon: string;
@@ -57,7 +56,7 @@ export function Hosting<
5756
@property({ attribute: false })
5857
validated: Promise<void> = Promise.resolve();
5958

60-
@property({ type: string})
59+
@property({ type: String })
6160
username: string | undefined;
6261

6362
private shouldValidate = false;
@@ -79,7 +78,7 @@ export function Hosting<
7978
newPendingStateEvent(
8079
(<MenuPlugin>(
8180
(<unknown>(
82-
(<List>ae.target).items[ae.detail.index].lastElementChild
81+
(<List>ae.target).items[ae.detail.index].nextElementSibling
8382
))
8483
)).run()
8584
)
@@ -100,7 +99,7 @@ export function Hosting<
10099
newPendingStateEvent(
101100
(<MenuPlugin>(
102101
(<unknown>(
103-
(<List>ae.target).items[ae.detail.index].lastElementChild
102+
(<List>ae.target).items[ae.detail.index].nextElementSibling
104103
))
105104
)).run()
106105
)
@@ -121,7 +120,7 @@ export function Hosting<
121120
newPendingStateEvent(
122121
(<MenuPlugin>(
123122
(<unknown>(
124-
(<List>ae.target).items[ae.detail.index].lastElementChild
123+
(<List>ae.target).items[ae.detail.index].nextElementSibling
125124
))
126125
)).run()
127126
)
@@ -145,7 +144,7 @@ export function Hosting<
145144
newPendingStateEvent(
146145
(<Validator>(
147146
(<unknown>(
148-
(<List>ae.target).items[ae.detail.index].lastElementChild
147+
(<List>ae.target).items[ae.detail.index].nextElementSibling
149148
))
150149
)).validate(true)
151150
)
@@ -234,7 +233,7 @@ export function Hosting<
234233
.querySelector('mwc-list')!
235234
.items.filter(item => item.className === 'validator')
236235
.map(item =>
237-
(<Validator>(<unknown>item.lastElementChild)).validate(false)
236+
(<Validator>(<unknown>item.nextElementSibling)).validate(false)
238237
)
239238
).then();
240239
this.dispatchEvent(newPendingStateEvent(this.validated));
@@ -257,8 +256,8 @@ export function Hosting<
257256
${me.hint
258257
? html`<span slot="secondary"><tt>${me.hint}</tt></span>`
259258
: ''}
260-
${me.content ?? ''}
261259
</mwc-list-item>
260+
${me.content ?? ''}
262261
`;
263262
}
264263

@@ -292,10 +291,14 @@ export function Hosting<
292291
: ''}
293292
<mwc-list
294293
wrapFocus
295-
@action=${(ae: CustomEvent<ActionDetail>) =>
296-
(<MenuItem>(
297-
this.menu.filter(item => item !== 'divider')[ae.detail.index]
298-
))?.action?.(ae)}
294+
@action=${(ae: CustomEvent<ActionDetail>) => {
295+
//FIXME: dirty hack to be fixed in open-scd-core
296+
// if clause not neccassary when oscd... compenents in open-scd not list
297+
if (ae.target instanceof List)
298+
(<MenuItem>(
299+
this.menu.filter(item => item !== 'divider')[ae.detail.index]
300+
))?.action?.(ae);
301+
}}
299302
>
300303
${this.menu.map(this.renderMenuItem)}
301304
</mwc-list>

src/Plugging.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { html, query, TemplateResult } from 'lit-element';
2+
import { classMap } from 'lit-html/directives/class-map';
23
import { translate } from 'lit-translate';
34

45
import '@material/mwc-button';
@@ -291,6 +292,12 @@ export function Plugging<TBase extends new (...args: any[]) => EditingElement>(
291292
.docId=${this.docId}
292293
.pluginId=${plugin.src}
293294
.nsdoc=${this.nsdoc}
295+
class="${classMap({
296+
plugin: true,
297+
menu: plugin.kind === 'menu',
298+
validator: plugin.kind === 'validator',
299+
editor: plugin.kind === 'editor',
300+
})}"
294301
></${tag}>`,
295302
};
296303
}

src/action-pane.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,17 @@ export class ActionPane extends LitElement {
7272
<nav><slot name="action"></slot></nav>`;
7373

7474
const headingLevel = Math.floor(Math.max(this.level, 1));
75+
// Sometimes a TemplateResult is passed in as Label, not a string. So only when it's a string show a title.
76+
const title = typeof this.label === 'string' ? this.label : '';
7577
switch (headingLevel) {
7678
case 1:
77-
return html`<h1>${content}</h1>`;
79+
return html`<h1 title="${title}">${content}</h1>`;
7880
case 2:
79-
return html`<h2>${content}</h2>`;
81+
return html`<h2 title="${title}">${content}</h2>`;
8082
case 3:
81-
return html`<h3>${content}</h3>`;
83+
return html`<h3 title="${title}">${content}</h3>`;
8284
default:
83-
return html`<h4>${content}</h4>`;
85+
return html`<h4 title="${title}">${content}</h4>`;
8486
}
8587
}
8688

src/editors/Publisher.ts

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import {
2+
css,
3+
html,
4+
LitElement,
5+
property,
6+
state,
7+
TemplateResult,
8+
} from 'lit-element';
9+
import { classMap } from 'lit-html/directives/class-map';
10+
11+
import '@material/mwc-formfield';
12+
import '@material/mwc-radio';
13+
14+
import './publisher/report-control-editor.js';
15+
import './publisher/gse-control-editor.js';
16+
import './publisher/sampled-value-control-editor.js';
17+
import './publisher/data-set-editor.js';
18+
19+
/** An editor [[`plugin`]] to configure `Report`, `GOOSE`, `SampledValue` control blocks and its `DataSet` */
20+
export default class PublisherPlugin extends LitElement {
21+
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
22+
@property({ attribute: false })
23+
doc!: XMLDocument;
24+
@state()
25+
private publisherType: 'Report' | 'GOOSE' | 'SampledValue' | 'DataSet' =
26+
'GOOSE';
27+
28+
render(): TemplateResult {
29+
return html`<div class="publishertypeselector">
30+
<mwc-formfield label="Report"
31+
><mwc-radio
32+
value="Report"
33+
?checked=${this.publisherType === 'Report'}
34+
@checked=${() => (this.publisherType = 'Report')}
35+
></mwc-radio></mwc-formfield
36+
><mwc-formfield label="GOOSE"
37+
><mwc-radio
38+
value="GOOSE"
39+
?checked=${this.publisherType === 'GOOSE'}
40+
@checked=${() => (this.publisherType = 'GOOSE')}
41+
></mwc-radio></mwc-formfield
42+
><mwc-formfield label="SampledValue"
43+
><mwc-radio
44+
value="SampledValue"
45+
?checked=${this.publisherType === 'SampledValue'}
46+
@checked=${() => (this.publisherType = 'SampledValue')}
47+
></mwc-radio></mwc-formfield
48+
><mwc-formfield label="DataSet"
49+
><mwc-radio
50+
value="DataSet"
51+
?checked=${this.publisherType === 'DataSet'}
52+
@checked=${() => (this.publisherType = 'DataSet')}
53+
></mwc-radio
54+
></mwc-formfield>
55+
</div>
56+
<report-control-editor
57+
.doc=${this.doc}
58+
class="${classMap({
59+
hidden: this.publisherType !== 'Report',
60+
})}"
61+
></report-control-editor
62+
><gse-control-editor
63+
.doc=${this.doc}
64+
class="${classMap({
65+
hidden: this.publisherType !== 'GOOSE',
66+
})}"
67+
></gse-control-editor
68+
><sampled-value-control-editor
69+
.doc=${this.doc}
70+
class="${classMap({
71+
hidden: this.publisherType !== 'SampledValue',
72+
})}"
73+
></sampled-value-control-editor
74+
><data-set-editor
75+
.doc=${this.doc}
76+
class="${classMap({
77+
hidden: this.publisherType !== 'DataSet',
78+
})}"
79+
></data-set-editor>`;
80+
}
81+
82+
static styles = css`
83+
.hidden {
84+
display: none;
85+
}
86+
87+
.publishertypeselector {
88+
margin: 4px 8px 16px;
89+
background-color: var(--mdc-theme-surface);
90+
width: calc(100% - 16px);
91+
justify-content: space-around;
92+
}
93+
`;
94+
}

src/editors/Templates.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const nsd7420 = fetch('public/xml/IEC_61850-7-420_2019A4.nsd')
5151
/** An editor [[`plugin`]] for editing the `DataTypeTemplates` section. */
5252
export default class TemplatesPlugin extends LitElement {
5353
/** The document being edited as provided to plugins by [[`OpenSCD`]]. */
54-
@property()
54+
@property({ attribute: false })
5555
doc!: XMLDocument;
5656

5757
async openCreateLNodeTypeWizard(): Promise<void> {
@@ -181,7 +181,7 @@ export default class TemplatesPlugin extends LitElement {
181181
</h1>
182182
<filtered-list
183183
id="lnodetypelist"
184-
@selected=${(e: SingleSelectedEvent) =>
184+
@action=${(e: SingleSelectedEvent) =>
185185
this.openLNodeTypeWizard(
186186
(<ListItem>(<List>e.target).selected).value
187187
)}
@@ -221,7 +221,7 @@ export default class TemplatesPlugin extends LitElement {
221221
</h1>
222222
<filtered-list
223223
id="dotypelist"
224-
@selected=${(e: SingleSelectedEvent) =>
224+
@action=${(e: SingleSelectedEvent) =>
225225
this.openDOTypeWizard(
226226
(<ListItem>(<List>e.target).selected).value
227227
)}
@@ -260,7 +260,7 @@ export default class TemplatesPlugin extends LitElement {
260260
</h1>
261261
<filtered-list
262262
id="datypelist"
263-
@selected=${(e: SingleSelectedEvent) =>
263+
@action=${(e: SingleSelectedEvent) =>
264264
this.openDATypeWizard(
265265
(<ListItem>(<List>e.target).selected).value
266266
)}
@@ -296,7 +296,7 @@ export default class TemplatesPlugin extends LitElement {
296296
</h1>
297297
<filtered-list
298298
id="enumtypelist"
299-
@selected=${(e: SingleSelectedEvent) =>
299+
@action=${(e: SingleSelectedEvent) =>
300300
this.openEnumTypeWizard(
301301
(<ListItem>(<List>e.target).selected).value
302302
)}

0 commit comments

Comments
 (0)