@@ -73,6 +73,9 @@ export class EtmChartGroupComponent implements OnInit, AfterViewInit, AfterViewC
7373 startDate : Date ;
7474 endDate : Date ;
7575
76+ qoeVmafAvgChartName : string = 'QoE VMAF Average' ;
77+ qoeVmafMetrics : MetricsFieldModel [ ] = [ ] ;
78+
7679 constructor ( private monitoringService : MonitoringService , private elastestRabbitmqService : ElastestRabbitmqService ) { }
7780
7881 ngOnInit ( ) : void { }
@@ -186,6 +189,8 @@ export class EtmChartGroupComponent implements OnInit, AfterViewInit, AfterViewC
186189 this . initAIO ( ) ;
187190 }
188191
192+ this . qoeVmafMetrics = [ ] ;
193+
189194 for ( let metric of this . tJob . execDashboardConfigModel . allMetricsFields . fieldsList ) {
190195 if ( metric . activated ) {
191196 let individualMetrics : ESRabComplexMetricsModel = this . initializeBasicAttrByMetric ( metric ) ;
@@ -238,14 +243,20 @@ export class EtmChartGroupComponent implements OnInit, AfterViewInit, AfterViewC
238243 ) ;
239244 }
240245 }
246+
247+ this . storeMetricIfIsQoEVmafActivated ( metric ) ;
241248 }
242249 }
250+
243251 this . createGroupedMetricList ( ) ;
244252 this . firstTimeInitialized = true ;
245253
246254 if ( this . tJob . execDashboardConfigModel . combineMetricsInPairs ) {
247255 this . initMetricsPairs ( ) ;
248256 }
257+
258+ // QoE Vmaf average chart
259+ this . initQoEVmafAverage ( ) ;
249260 }
250261
251262 addChartToList ( individualMetrics : ESRabComplexMetricsModel , isCombinedPair : boolean = false ) : number {
@@ -257,6 +268,7 @@ export class EtmChartGroupComponent implements OnInit, AfterViewInit, AfterViewC
257268 if ( this . tJob . execDashboardConfigModel . combineMetricsInPairs ) {
258269 this . initMetricsPairs ( ) ;
259270 }
271+
260272 return pos ;
261273 }
262274 }
@@ -348,6 +360,62 @@ export class EtmChartGroupComponent implements OnInit, AfterViewInit, AfterViewC
348360 return individualMetrics ;
349361 }
350362
363+ // If is qoe vmaf and is activated, add to list (for create average chart)
364+ storeMetricIfIsQoEVmafActivated ( metric : MetricsFieldModel ) : void {
365+ if ( metric . etType === 'vmaf' && metric . activated ) {
366+ this . qoeVmafMetrics . push ( metric ) ;
367+ }
368+ }
369+
370+ initQoEVmafAverage ( ) : void {
371+ if ( ! this . live ) {
372+ let posIfExist : number = this . returnPositionIfExist ( this . qoeVmafAvgChartName ) ;
373+ if ( posIfExist > - 1 ) {
374+ this . removeAndUnsubscribeByListAndPos ( posIfExist ) ;
375+ }
376+
377+ if ( this . qoeVmafMetrics && this . qoeVmafMetrics . length > 1 ) {
378+ let ignoreComponent : string = this . getIgnoreComponent ( ) ;
379+ let chart : ESRabComplexMetricsModel = new ESRabComplexMetricsModel ( this . monitoringService , ignoreComponent ) ;
380+ chart . startDate = this . startDate ;
381+ chart . endDate = this . endDate ;
382+ chart . name = this . qoeVmafAvgChartName ;
383+ chart . hidePrevBtn = ! this . live ;
384+
385+ let monitoringIndex : string = this . tJobExec . monitoringIndex ;
386+
387+ // If Multi Parent
388+ if ( this . tJobExec instanceof TJobExecModel && this . tJobExec . isParent ( ) ) {
389+ monitoringIndex = this . tJobExec . getChildsMonitoringIndices ( ) ;
390+ }
391+
392+ chart . monitoringIndex = monitoringIndex ;
393+
394+ for ( let chartLine of this . qoeVmafMetrics ) {
395+ chartLine . unit = chartLine . unit ? chartLine . unit : '%' ;
396+ chart . setUnits ( chartLine . unit ) ;
397+
398+ chart . allMetricsFields . addMetricsFieldToList (
399+ chartLine ,
400+ chartLine . component ,
401+ chart . stream ,
402+ chartLine . streamType ,
403+ chartLine . activated ,
404+ ) ;
405+ }
406+ chart . getAllMetrics ( ) . subscribe (
407+ ( loaded : boolean ) => {
408+ chart . convertChartToUniqueAxisAverage ( this . qoeVmafAvgChartName ) ;
409+
410+ this . addChartToList ( chart ) ;
411+ this . createGroupedMetricList ( ) ;
412+ } ,
413+ ( error : Error ) => console . log ( error ) ,
414+ ) ;
415+ }
416+ }
417+ }
418+
351419 initMetricsPairs ( ) : void {
352420 this . combinedPairChartsList = [ ] ;
353421 let metricsPairsList : MetricsFieldModel [ ] [ ] = allArrayPairCombinations ( this . getChartsListMetricFieldModels ( ) ) ;
@@ -541,13 +609,20 @@ export class EtmChartGroupComponent implements OnInit, AfterViewInit, AfterViewC
541609 return component + ' ' + stream + ' ' + etType ;
542610 }
543611
544- alreadyExist ( name : string ) : boolean {
612+ returnPositionIfExist ( name : string ) : number {
613+ let currentPos : number = 0 ;
545614 for ( let metric of this . chartsList ) {
546- if ( metric . name === name ) {
547- return true ;
615+ if ( metric . name . trim ( ) === name . trim ( ) ) {
616+ return currentPos ;
548617 }
618+ currentPos ++ ;
549619 }
550- return false ;
620+
621+ return - 1 ;
622+ }
623+
624+ alreadyExist ( name : string ) : boolean {
625+ return this . returnPositionIfExist ( name ) > - 1 ;
551626 }
552627
553628 createGroupedMetricList ( ) : void {
0 commit comments