Skip to content

Commit

Permalink
refactor(editors/subscriber...): Naming in GOOSE/SMV Subscriber plugi…
Browse files Browse the repository at this point in the history
…ns (#991)

* Improve terminology and headings for GOOSE and SMV subscribing plugins, closes #729 and related to #958

* Update snapshots

* Tidy up rebase

* Revert snapshots incorrectly added

* Update following review comments

* Update snapshots

* Make lists activatable, partly resolves #958

* Update translations for later binding description

* Update snapshots

* Reset selection on first entry

* Remove unnecessary styling

* Tidying title generation logic and unnecessary imports

* Update German translation
  • Loading branch information
danyill authored Sep 16, 2022
1 parent 4f1a937 commit 21e2954
Show file tree
Hide file tree
Showing 21 changed files with 233 additions and 127 deletions.
2 changes: 1 addition & 1 deletion src/editors/GooseControlSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default class GooseControlSubscriptionPlugin extends LitElement {
<div class="container">
${view == View.PUBLISHER
? html`<goose-list class="row" .doc=${this.doc}></goose-list>`
: html`<ied-list class="row" .doc=${this.doc}></ied-list>`}
: html`<ied-list class="row" .doc=${this.doc} serviceType="goose"></ied-list>`}
<subscriber-list-goose
class="row"
.doc=${this.doc}
Expand Down
2 changes: 1 addition & 1 deletion src/editors/SampledValuesSubscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class SampledValuesSubscriberPlugin extends LitElement {
<div class="container">
${view == View.PUBLISHER
? html`<smv-list class="row" .doc=${this.doc}></smv-list>`
: html`<ied-list class="row" .doc=${this.doc}></ied-list>`}
: html`<ied-list class="row" .doc=${this.doc} serviceType="smv"></ied-list>`}
<subscriber-list-smv class="row" .doc=${this.doc}></subscriber-list-smv>
</div>
</div>`;
Expand Down
2 changes: 1 addition & 1 deletion src/editors/subscription/foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export class SubscriberListContainer extends LitElement {
/** List holding all current subscribed Elements. */
subscribedElements: ListElement[] = [];

/** List holding all current avaialble Elements which are not subscribed. */
/** List holding all current available Elements which are not subscribed. */
availableElements: ListElement[] = [];

/** Current selected IED (when in Subscriber view) */
Expand Down
9 changes: 7 additions & 2 deletions src/editors/subscription/goose/goose-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,15 @@ export class GooseList extends LitElement {
);
}

protected firstUpdated(): void {
selectedGseControl = undefined;
selectedDataSet = undefined;
}

render(): TemplateResult {
return html` <section tabindex="0">
<h1>${translate('subscription.goose.publisherGoose.title')}</h1>
<filtered-list>
<h1>${translate('subscription.goose.publisher.title')}</h1>
<filtered-list activatable>
${getOrderedIeds(this.doc).map(
ied =>
html`
Expand Down
8 changes: 6 additions & 2 deletions src/editors/subscription/goose/subscriber-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -397,21 +397,25 @@ export class SubscriberList extends SubscriberListContainer {

return view == View.PUBLISHER
? html`<h1>
${translate('subscription.goose.publisherGoose.subscriberTitle', {
${translate('subscription.goose.publisher.subscriberTitle', {
selected: gseControlName
? this.currentGooseIedName + ' > ' + gseControlName
: 'GOOSE',
})}
</h1>`
: html`<h1>
${translate('subscription.goose.subscriberGoose.publisherTitle', {
${translate('subscription.goose.subscriber.publisherTitle', {
selected: this.currentSelectedIed
? this.currentSelectedIed.getAttribute('name')!
: 'IED',
})}
</h1>`;
}

protected firstUpdated(): void {
this.currentSelectedIed = undefined
}

render(): TemplateResult {
return html`
<section tabindex="0">
Expand Down
11 changes: 9 additions & 2 deletions src/editors/subscription/ied-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export class IedList extends LitElement {
@property()
doc!: XMLDocument;

@property({ type: String })
serviceType?: 'goose' | 'smv';

private onIedSelect(element: Element): void {
selectedIed = element;

Expand All @@ -37,10 +40,14 @@ export class IedList extends LitElement {
this.dispatchEvent(newIEDSelectEvent(selectedIed));
}

protected firstUpdated(): void {
selectedIed = undefined;
}

render(): TemplateResult {
return html` <section tabindex="0">
<h1>${translate('subscription.iedList.title')}</h1>
<filtered-list>
<h1>${translate(`subscription.${this.serviceType}.subscriber.iedListTitle`)}</h1>
<filtered-list activatable>
${getOrderedIeds(this.doc).map(
ied =>
html`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ import {
cloneElement,
compareNames,
getDescriptionAttribute,
getNameAttribute,
identity,
newActionEvent,
Replace,
getSclSchemaVersion,
} from '../../../foundation.js';

import { styles, updateExtRefElement, serviceTypes } from '../foundation.js';
import { FcdaSelectEvent, getFcdaTitleValue } from './foundation.js';
import { FcdaSelectEvent } from './foundation.js';

/**
* A sub element for showing all Ext Refs from a FCDA Element.
Expand Down Expand Up @@ -236,19 +235,8 @@ export class ExtRefLaterBindingList extends LitElement {
}

private renderTitle(): TemplateResult {
const controlElementName = this.currentSelectedControlElement
? getNameAttribute(this.currentSelectedControlElement)
: undefined;
const fcdaName = this.currentSelectedFcdaElement
? getFcdaTitleValue(this.currentSelectedFcdaElement)
: undefined;

return html`<h1>
${translate('subscription.laterBinding.extRefList.title', {
controlTag: this.controlTag,
controlElementName: controlElementName ?? '-',
fcdaName: fcdaName ?? '-',
})}
${translate(`subscription.laterBinding.extRefList.title`)}
</h1>`;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class FCDALaterBindingList extends LitElement {
`subscription.laterBinding.${this.controlTag}.controlBlockList.title`
)}
</h1>
<filtered-list>
<filtered-list activatable>
${controlElements.map(controlElement => {
const fcdaElements = this.getFcdaElements(controlElement);
return html`
Expand Down
9 changes: 7 additions & 2 deletions src/editors/subscription/sampledvalues/smv-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export class SmvPublisherList extends LitElement {
);
}

protected firstUpdated(): void {
selectedSmvMsg = undefined;
selectedDataSet = undefined;
}

renderSmv(smvControl: Element): TemplateResult {
return html`<mwc-list-item
@click=${() => this.onSelect(smvControl)}
Expand All @@ -85,8 +90,8 @@ export class SmvPublisherList extends LitElement {

render(): TemplateResult {
return html` <section tabindex="0">
<h1>${translate('subscription.smv.publisherSmv.title')}</h1>
<filtered-list>
<h1>${translate('subscription.smv.publisher.title')}</h1>
<filtered-list activatable>
${getOrderedIeds(this.doc).map(
ied =>
html`
Expand Down
8 changes: 6 additions & 2 deletions src/editors/subscription/sampledvalues/subscriber-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,21 +399,25 @@ export class SubscriberList extends SubscriberListContainer {

return view == View.PUBLISHER
? html`<h1>
${translate('subscription.smv.publisherSmv.subscriberTitle', {
${translate('subscription.smv.publisher.subscriberTitle', {
selected: gseControlName
? this.currentSmvIedName + ' > ' + gseControlName
: 'Sampled Value',
})}
</h1>`
: html`<h1>
${translate('subscription.smv.subscriberSmv.publisherTitle', {
${translate('subscription.smv.subscriber.publisherTitle', {
selected: this.currentSelectedIed
? this.currentSelectedIed.getAttribute('name')!
: 'IED',
})}
</h1>`;
}

protected firstUpdated(): void {
this.currentSelectedIed = undefined
}

render(): TemplateResult {
return html`
<section tabindex="0">
Expand Down
49 changes: 24 additions & 25 deletions src/translations/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,56 +345,55 @@ export const de: Translations = {
noIedSelected: 'Keine IED ausgewählt',
},
goose: {
publisherGoose: {
publisher: {
title: 'GOOSE-Publizierer',
subscriberTitle: 'Verbunden mit {{ selected }}',
},
subscriberGoose: {
publisherTitle: 'GOOSE(s) verbunden mit {{selected}}',
subscriber: {
iedListTitle: 'Verbunden mit GOOSE Meldungen',
publisherTitle: 'GOOSE Nachricht verbunden mit {{ selected }}',
},
view: {
publisherView: 'Zeigt verbundene IED(s) der ausgewählten GOOSE',
subscriberView: 'Zeigt verbundene GOOSE(s) des ausgewählten IED',
publisherView: 'Publisher | Subscriber',
subscriberView: 'Subscriber | Publisher',
},
},
smv: {
publisherSmv: {
publisher: {
title: 'SampledValue-Publizierer',
subscriberTitle: 'Verbunden mit {{ selected }}',
},
subscriberSmv: {
publisherTitle: 'Verbunden mit {{selected}}',
subscriber: {
iedListTitle: 'Verbunden mit Sampled Values',
publisherTitle: 'Sampled Value verbunden mit {{ selected }}',
},
view: {
publisherView: 'Zeigt verbundene IED(s) der ausgewählten Sampled Value',
subscriberView:
'Zeigt verbundene Sampled Value(s) des ausgewählten IED',
publisherView: 'Publisher | Subscriber',
subscriberView: 'Subscriber | Publisher',
},
},
laterBinding: {
SampledValueControl: {
controlBlockList: {
title: 'Sampled Values and verknüpfte Datensätze im Projekt',
noControlBlockFound: 'Kein Sampled-Value-Kontrolblock im Projekt',
title: 'Sample Value Meldungen',
noControlBlockFound: 'Keine Sampled Values gefunden',
},
},
GSEControl: {
controlBlockList: {
title: '???',
noControlBlockFound: '???',
title: 'GOOSE-Meldungen',
noControlBlockFound: 'Keine GOOSEs gefunden',
},
},
extRefList: {
title:
'Ausgewählter {{ controlTag }} Datenpunkt "{{ svcName }}" / "{{ fcdaName }}"',
title: 'Für Ausgewählte Daten-Attribut Verfügbare Verbindung',
noSelection: 'Kein Daten-Attribut ausgewählt',
noSubscribedExtRefs: 'Keine verknüpften externen Referenzen',
noAvailableExtRefs:
'Keine externen externen Referenzen vom Type "Later Binding"',
noSubscribedExtRefs: 'Keine bestehenden Verbindungen',
noAvailableExtRefs: 'Keine verfügbaren Eingänge vorhanden',
},
iedList: {
title: 'IEDs',
},
},
iedList: {
title: 'IEDs',
},
},
protocol104: {
Expand Down Expand Up @@ -745,8 +744,8 @@ export const de: Translations = {
deleteButton: 'Ausgewählte Datentypen entfernen',
tooltip:
'Datentypen, die nicht in einem logischen Knoten oder einem anderen verwendeten Datentyp referenziert werden',
alsoRemoveSubTypes: 'Entfernen Sie auch Untertypen'
}
alsoRemoveSubTypes: 'Entfernen Sie auch Untertypen',
},
},
controlblock: {
action: {
Expand Down
56 changes: 28 additions & 28 deletions src/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,55 +342,55 @@ export const en = {
noIedSelected: 'No IED selected',
},
goose: {
publisherGoose: {
title: 'GOOSE Publisher',
subscriberTitle: 'Subscriber of {{ selected }}',
publisher: {
title: 'GOOSE Publishers',
subscriberTitle: 'IEDs subscribed to {{ selected }}',
},
subscriberGoose: {
publisherTitle: 'GOOSE(s) subscribed by {{selected}}',
subscriber: {
iedListTitle: 'GOOSE Subscribers',
publisherTitle: 'GOOSE Messages subscribed to {{selected}}',
},
view: {
publisherView: 'Show subscriber IED(s) per selected GOOSE',
subscriberView: 'Show subscribed GOOSE publisher for selected IED',
publisherView: 'Publisher | Subscriber',
subscriberView: 'Subscriber | Publisher',
},
},
smv: {
publisherSmv: {
title: 'Sampled Values Publisher',
subscriberTitle: 'Subscriber of {{ selected }}',
publisher: {
title: 'Sampled Value Messages',
subscriberTitle: 'IEDs subscribed to {{ selected }}',
},
subscriberSmv: {
publisherTitle: 'Sampled Value(s) subscribed by {{selected}}',
subscriber: {
iedListTitle: 'Sampled Value Subscribers',
publisherTitle: 'Sampled Value Messages subscribed to {{ selected }}',
},
view: {
publisherView: 'Show subscriber IED(s) per selected Sampled Value',
subscriberView:
'Show subscribed Sampled Value(s) publisher for selected IED',
publisherView: 'Publisher | Subscriber',
subscriberView: 'Subscriber | Publisher',
},
},
laterBinding: {
SampledValueControl: {
controlBlockList: {
title: 'List of Sampled Values Controls with linked FCDAs',
noControlBlockFound: 'No Sampled Value Controls found',
title: 'Sampled Value Messages',
noControlBlockFound: 'No Sampled Value Messages found',
},
},
GSEControl: {
controlBlockList: {
title: 'List of Goose Controls with linked FCDAs',
noControlBlockFound: 'No Goose Controls found',
title: 'GOOSE Messages',
noControlBlockFound: 'No GOOSE Messages found',
},
},
extRefList: {
title:
'Selected {{ controlTag }} data "{{ controlElementName }}" / FCDA "{{ fcdaName }}"',
title: 'Inputs Available For Selected Data Attribute',
noSelection: 'No data attribute selected',
noSubscribedExtRefs: 'No subscribed ExtRefs',
noAvailableExtRefs: 'No available ExtRefs to subscribe',
noSubscribedExtRefs: 'No subscribed inputs',
noAvailableExtRefs: 'No available inputs to subscribe',
},
iedList: {
title: 'IEDs',
},
},
iedList: {
title: 'IEDs',
},
},
protocol104: {
Expand Down Expand Up @@ -742,8 +742,8 @@ export const en = {
deleteButton: 'Remove Selected Data Types',
tooltip:
'Data Types which are not referenced in a Logical Node or other used Data Type',
alsoRemoveSubTypes: 'Also remove subtypes'
}
alsoRemoveSubTypes: 'Also remove subtypes',
},
},
controlblock: {
action: {
Expand Down
Loading

0 comments on commit 21e2954

Please sign in to comment.