diff --git a/src/app/components/pb-results/pb-results.component.html b/src/app/components/pb-results/pb-results.component.html index 8aacd4e2044030857949a5632144565eb4b92c9b..2ea3fea992169f5391bf77ac06a184516c9efe82 100644 --- a/src/app/components/pb-results/pb-results.component.html +++ b/src/app/components/pb-results/pb-results.component.html @@ -8,7 +8,7 @@ <log [log]=iterationLog></log> <!-- tableau de résultats des bassins --> - <pb-results-table *ngIf="hasBasinResults" [results]=pbResults [variableIndex]=pbResults?.variableIndex></pb-results-table> + <pb-results-table *ngIf="basinResultsHaveData" [results]=pbResults [variableIndex]=pbResults?.variableIndex></pb-results-table> <!-- table des résultats fixés --> <pb-cloison-results *ngIf="hasWallResults" [results]=pbResults.cloisonResults></pb-cloison-results> diff --git a/src/app/components/pb-results/pb-results.component.ts b/src/app/components/pb-results/pb-results.component.ts index e4eb8b3642a19fcd2e7d05410b6b355f6280713a..c63887407e34a7d4f47d38c81070ae606ac7eb28 100644 --- a/src/app/components/pb-results/pb-results.component.ts +++ b/src/app/components/pb-results/pb-results.component.ts @@ -46,6 +46,11 @@ export class PbResultsComponent { return this._pbResults && this._pbResults.hasBasinResults; } + // true if basin results at current iteration have data + public get basinResultsHaveData(): boolean { + return this._pbResults && this._pbResults.basinResultsHaveData; + } + // true if wall results are present public get hasWallResults(): boolean { return this._pbResults && this._pbResults.hasWallResults; diff --git a/src/app/results/prebarrage-results.ts b/src/app/results/prebarrage-results.ts index 794d0c6b7721dd15797e2d4802c8ff865acc5732..c57f92501500004dd37b89ad4dd54ea5abc26613 100644 --- a/src/app/results/prebarrage-results.ts +++ b/src/app/results/prebarrage-results.ts @@ -101,9 +101,18 @@ export class PrebarrageResults extends MultiDimensionResults { } public get hasBasinResults(): boolean { + // test du bassin 0 @TODO faire mieux return this.bassinsResults.length > 0 && this.bassinsResults[0] && ! this.bassinsResults[0].hasOnlyErrors; } + public get basinResultsHaveData(): boolean { + return ( + this.bassinsResults.length > 0 + && this.bassinsResults[0].resultElements[this.variableIndex] !== undefined + && this.bassinsResults[0].resultElements[this.variableIndex].ok + ); + } + public get hasWallResults(): boolean { return this.cloisonResults && this.cloisonResults.result && ! this.cloisonResults.result.hasOnlyErrors; }