Skip to content

Commit 512215e

Browse files
author
Dennis Labordus
committed
Added version check to only update version 1 blocks.
Signed-off-by: Dennis Labordus <[email protected]>
1 parent 7631312 commit 512215e

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

src/locamation/LocamationLNList.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {Nsdoc} from "../foundation/nsdoc.js";
1111
import '../wizard-textfield.js';
1212

1313
import {locamationLNEditWizard} from "./LocamationLNEdit.js";
14-
import {iedHeader, lDeviceHeader, lnHeader, LOCAMATION_PRIVATE} from "./foundation.js";
14+
import {getPrivate, getPrivateTextValue, iedHeader, lDeviceHeader, lnHeader, LOCAMATION_PRIVATE} from "./foundation.js";
1515

1616
@customElement('locamation-ln-list')
1717
export class LocamationLNodeListElement extends LitElement {
@@ -48,16 +48,20 @@ export class LocamationLNodeListElement extends LitElement {
4848
</wizard-textfield>
4949
<mwc-list>
5050
${logicalNodes.map(ln => {
51-
return html`
52-
<mwc-list-item
53-
@click="${(e: Event) => {
54-
e.target?.dispatchEvent(
55-
newSubWizardEvent(() => locamationLNEditWizard(ln, this.nsdoc))
56-
);
57-
}}"
58-
>
59-
<span>${lnHeader(ln, this.nsdoc)}</span>
60-
</mwc-list-item>`
51+
const locamationPrivate = getPrivate(ln);
52+
const locamationVersion = getPrivateTextValue(locamationPrivate, 'VERSION');
53+
54+
return html`
55+
<mwc-list-item
56+
.disabled="${locamationVersion !== '1'}"
57+
@click="${(e: Event) => {
58+
e.target?.dispatchEvent(
59+
newSubWizardEvent(() => locamationLNEditWizard(ln, this.nsdoc))
60+
);
61+
}}"
62+
>
63+
<span>${lnHeader(ln, this.nsdoc)}</span>
64+
</mwc-list-item>`
6165
})}
6266
</mwc-list>
6367
`

src/translations/en.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,9 @@ export const en = {
585585
sumHelper: 'The collection of three channel numbers for which the sum of currents or voltages will be calculated. The numbers are separated by commas. Values for the current sensor range from 0 - 5, for the voltage sensor 0-2.',
586586
channel: 'Channel',
587587
channelHelper: 'The channel number on the sensor. Values for the current sensor range from 0 - 5, for the voltage sensor 0-2.',
588-
transformPrimary: 'Transform Primary',
588+
transformPrimary: 'TransformPrimary',
589589
transformPrimaryHelper: 'The nominator of the ratio of the measement transformer.',
590-
transformSecondary: 'Transform Secondary',
590+
transformSecondary: 'TransformSecondary',
591591
transformSecondaryHelper: 'The denominator of the ratio of the measement transformer.',
592592
updateAction: 'Locamation private fields updated for Logica Node {{lnName}}',
593593
},

0 commit comments

Comments
 (0)