@@ -304,6 +304,21 @@ function getCBRefs(
304
304
) ;
305
305
}
306
306
307
+ function getSupervisionLnDescription ( supLn : Element ) : string {
308
+ const descriptionLn = getDescriptionAttribute ( supLn ) ;
309
+ const doi = supLn . querySelector ( `:scope > DOI[name="St"]` ) ;
310
+
311
+ let doiDesc = doi ? getDescriptionAttribute ( doi ) : undefined ;
312
+
313
+ if ( ! doiDesc ) {
314
+ doiDesc =
315
+ doi ?. querySelector ( ':scope > DAI[name="d"] > Val' ) ?. textContent ??
316
+ undefined ;
317
+ }
318
+
319
+ return [ descriptionLn , doiDesc ] . filter ( d => d !== undefined ) . join ( ' > ' ) ;
320
+ }
321
+
307
322
/**
308
323
* Editor to allow allocation of GOOSE and SMV supervision LNs
309
324
* to control blocks
@@ -489,7 +504,7 @@ export default class OscdSupervision extends LitElement {
489
504
490
505
// eslint-disable-next-line class-methods-use-this
491
506
renderUnusedSupervisionNode ( lN : Element ) : TemplateResult {
492
- const description = getDescriptionAttribute ( lN ) ;
507
+ const description = getSupervisionLnDescription ( lN ) ;
493
508
494
509
const controlBlockRef = getSupervisionCBRef ( lN ) ;
495
510
const invalidControlBlock =
@@ -544,7 +559,7 @@ export default class OscdSupervision extends LitElement {
544
559
545
560
// eslint-disable-next-line class-methods-use-this
546
561
renderSupervisionListItem ( lN : Element , interactive : boolean ) : TemplateResult {
547
- const description = getDescriptionAttribute ( lN ) ;
562
+ const description = getSupervisionLnDescription ( lN ) ;
548
563
549
564
return html `
550
565
<mwc- lis t- item
@@ -610,14 +625,7 @@ export default class OscdSupervision extends LitElement {
610
625
}
611
626
612
627
searchUnusedSupervisionLN ( supLn : Element ) : boolean {
613
- const descriptionLn = getDescriptionAttribute ( supLn ) ;
614
- const cbRef = this . controlType === 'GOOSE' ? 'GoCBRef' : 'SvCBRef' ;
615
- const doi = supLn . querySelector ( `DOI[name="${ cbRef } "` ) ;
616
- const descriptionDoi = doi ? getDescriptionAttribute ( doi ) : undefined ;
617
- const description = [ descriptionLn , descriptionDoi ]
618
- . filter ( d => d !== undefined )
619
- . join ( ' > ' ) ;
620
-
628
+ const description = getSupervisionLnDescription ( supLn ) ;
621
629
const supervisionSearchText = `${ identity ( supLn ) } ${ description } ` ;
622
630
623
631
return (
0 commit comments