@@ -22,32 +22,34 @@ import { wizards } from '../../wizards/wizard-library.js';
22
22
/** [[`Communication`]] subeditor for a `SubNetwork` element. */
23
23
@customElement ( 'subnetwork-editor' )
24
24
export class SubNetworkEditor extends LitElement {
25
+ @property ( { attribute : false } )
26
+ doc ! : XMLDocument ;
25
27
/** SCL element SubNetwork */
26
28
@property ( { attribute : false } )
27
29
element ! : Element ;
28
30
/** SubNetwork attribute name */
29
- @property ( )
31
+ @property ( { type : String } )
30
32
get name ( ) : string {
31
33
return this . element . getAttribute ( 'name' ) ?? 'UNDEFINED' ;
32
34
}
33
35
/** SubNetwork attribute desc */
34
- @property ( )
36
+ @property ( { type : String } )
35
37
get desc ( ) : string | null {
36
38
return this . element . getAttribute ( 'desc' ) ?? null ;
37
39
}
38
40
/** SubNetwork attribute type */
39
- @property ( )
41
+ @property ( { type : String } )
40
42
get type ( ) : string | null {
41
43
return this . element . getAttribute ( 'type' ) ?? null ;
42
44
}
43
45
/** SubNetwork child elements BitRate label */
44
- @property ( )
46
+ @property ( { type : String } )
45
47
get bitrate ( ) : string | null {
46
48
const bitRate = this . element . querySelector ( 'BitRate' ) ;
47
49
if ( bitRate === null ) return null ;
48
50
const bitRateValue = bitRate . textContent ?? '' ;
49
51
const m = bitRate . getAttribute ( 'multiplier' ) ;
50
- const unit = m === null ? 'b/s' : ' ' + m + ' b/s' ;
52
+ const unit = ` ${ m ?? '' } b/s` ;
51
53
return bitRateValue ? bitRateValue + unit : null ;
52
54
}
53
55
@@ -73,7 +75,7 @@ export class SubNetworkEditor extends LitElement {
73
75
) ;
74
76
}
75
77
76
- private renderIedContainer ( ) : TemplateResult [ ] {
78
+ private renderIEDs ( ) : TemplateResult [ ] {
77
79
return Array . from ( this . element . querySelectorAll ( ':scope > ConnectedAP' ) )
78
80
. map ( connAP => connAP . getAttribute ( 'iedName' ) ! )
79
81
. filter ( ( v , i , a ) => a . indexOf ( v ) === i )
@@ -106,7 +108,7 @@ export class SubNetworkEditor extends LitElement {
106
108
}
107
109
108
110
private header ( ) : string {
109
- return ` ${ this . name } ${ this . desc === null ? '' : `— ${ this . desc } ` }
111
+ return `${ this . name } ${ this . desc === null ? '' : `— ${ this . desc } ` }
110
112
${ this . subNetworkSpecs ( ) } ` ;
111
113
}
112
114
@@ -122,14 +124,15 @@ export class SubNetworkEditor extends LitElement {
122
124
<mwc- icon- butto n
123
125
icon= "delete"
124
126
@click = ${ ( ) => this . remove ( ) }
125
- > </ mwc- icon- butto n> </ abbr
126
- > <abbr slot= "action" title = "${ translate ( 'add' ) } ">
127
+ > </ mwc- icon- butto n>
128
+ </ abbr>
129
+ <abbr slot= "action" title = "${ translate ( 'add' ) } ">
127
130
<mwc- icon- butto n
128
131
icon= "playlist_add"
129
132
@click = "${ ( ) => this . openConnectedAPwizard ( ) } "
130
133
> </ mwc- icon- butto n>
131
134
</ abbr>
132
- <div id= "iedContainer" > ${ this . renderIedContainer ( ) } </ div>
135
+ <div id= "iedContainer" > ${ this . renderIEDs ( ) } </ div>
133
136
</ action- pane> ` ;
134
137
}
135
138
0 commit comments