Commit bea206c0 authored by Grand Francois's avatar Grand Francois
Browse files

feat: PAB calculator: add error,warning,info count in boundary conditions select

refs #517
parent f0cd5234
Pipeline #36038 passed with stages
in 16 minutes and 20 seconds
......@@ -3,9 +3,9 @@ import { Component, Input, OnChanges } from "@angular/core";
import { I18nService } from "../../services/internationalisation.service";
import { fv, longestVarParam } from "../../util";
import { MultiDimensionResults } from "../../results/multidimension-results";
import { PrebarrageResults } from "../../results/prebarrage-results";
import { CalculatorType, PbBassin, PbCloison, Structure, VariatedDetails } from "jalhyd";
import { VariatedDetails } from "jalhyd";
import { CalculatorResults } from "../../results/calculator-results";
import { LogHelper } from "app/results/log-helper";
@Component({
selector: "variable-results-selector",
......@@ -24,6 +24,9 @@ export class VariableResultsSelectorComponent implements OnChanges {
@Input()
private variatedParameters: VariatedDetails[];
/** stats du log synthétique */
private _logHelper: LogHelper;
/** valeur en cours */
private _selectedValue = 0;
......@@ -61,6 +64,7 @@ export class VariableResultsSelectorComponent implements OnChanges {
// get current variatedIndex even if component was rebuilt
if (this.results) {
this._selectedValue = this.results.variableIndex;
this._logHelper = new LogHelper(this.results);
}
}
......@@ -80,8 +84,17 @@ export class VariableResultsSelectorComponent implements OnChanges {
return ret;
}
/**
* generate entry text for boundary conditions select
* @param index select option index
*/
protected entryLabel(index: number): string {
return CalculatorResults.variatingModalityLabel(this.varValues, this.results, index);
let res = CalculatorResults.variatingModalityLabel(this.varValues, this.results, index);
const restat = this._logHelper.resultElementsStats(index);
if (restat.length > 0) {
res += " - " + restat;
}
return res;
}
public get selectedValue(): number {
......
......@@ -7,6 +7,9 @@
"WARNING_NOTCH_SUBMERSION_GREATER_THAN_07": "Notch formula is discouraged when submersion is greater than 0.7",
"WARNING_SLOT_SUBMERSION_NOT_BETWEEN_07_AND_09": "Slot formula is discouraged when submersion is lower than 0.7 or greater than 0.9",
"WARNING_WEIR_SUBMERSION_LOWER_THAN_08": "Submerged weir formula is discouraged when submersion is lower than 08",
"WARNING_INFO_COUNT_SHORT": "%d info(s)",
"WARNING_WARNING_COUNT_SHORT": "%d warning(s)",
"WARNING_ERROR_COUNT_SHORT": "%d error(s)",
"WARNING_WARNINGS_ABSTRACT": "%nb% warnings occurred during calculation",
"WARNING_ERRORS_ABSTRACT": "%nb% error occurred during calculation",
"WARNING_ERRORS_ABSTRACT_PLUR": "%nb% errors occurred during calculation",
......
......@@ -7,6 +7,9 @@
"WARNING_NOTCH_SUBMERSION_GREATER_THAN_07": "La formule de l'échancrure n'est pas conseillée pour un ennoiement supérieur à 0.7",
"WARNING_SLOT_SUBMERSION_NOT_BETWEEN_07_AND_09": "La formule de la fente n'est pas conseillée pour un ennoiement inférieur à 0.7 et supérieur à 0.9",
"WARNING_WEIR_SUBMERSION_LOWER_THAN_08": "La formule du seuil noyé n'est pas conseillé pour un ennoiement inférieur à 0.8",
"WARNING_INFO_COUNT_SHORT": "%d info(s)",
"WARNING_WARNING_COUNT_SHORT": "%d avertissement(s)",
"WARNING_ERROR_COUNT_SHORT": "%d erreur(s)",
"WARNING_WARNINGS_ABSTRACT": "%nb% avertissements rencontrés lors du calcul",
"WARNING_ERRORS_ABSTRACT": "%nb% erreur rencontrée lors du calcul",
"WARNING_ERRORS_ABSTRACT_PLUR": "%nb% erreurs rencontrées lors du calcul",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment