Skip to content
Snippets Groups Projects
Commit 6ca4b079 authored by mathias.chouet's avatar mathias.chouet
Browse files

Fix bug in PbCloison parameters display in results table

parent 4902d338
No related branches found
No related tags found
1 merge request!93Resolve "Ajout du module Prébarrage"
import { CalculatorType, PbBassin, PbCloison, IObservable, PreBarrage, VariatedDetails } from "jalhyd";
import { CalculatorType, PbBassin, PbCloison, IObservable, PreBarrage, VariatedDetails, ParamDefinition } from "jalhyd";
import { FormulaireFixedVar } from "./form-fixedvar";
import { PbSchema } from "../elements/pb-schema";
......@@ -235,15 +235,6 @@ export class FormulairePrebarrage extends FormulaireFixedVar {
if (computedParam !== undefined) {
this.pbResults.cloisonResults.calculatedParameter = computedParam;
}
// if some parameter is variating, add id too (trick with PbResultsComponent
for (const s of this._selectedItem.structures) {
for (const p of s.parameterIterator) {
if (p.hasMultipleValues) {
const ngp = this.getParamFromSymbol(p.symbol);
this._pbResults.cloisonResults.addFixedParameter(ngp);
}
}
}
// transmission des suffixes de cloisons calculés par l'algo de tri de PbSchemaComponent,
// pour le sélecteur de conditions limites
const pbs = this.kids[0] as PbSchema;
......@@ -260,10 +251,34 @@ export class FormulairePrebarrage extends FormulaireFixedVar {
}
}
/**
* Trouve le Ngparameter correspondant au paramètre "p", parmi tous les
* éléments du formulaire de PbCloison, qui peut contenir plusieurs
* structures ayant des paramètres de même nom
* @param param ParamDefinition
*/
public getCloisonParam(param: ParamDefinition): NgParameter {
for (const p of this.allFormElements) {
if (p instanceof NgParameter) {
if (p.paramDefinition === param) {
return p;
}
}
}
}
public addFixedParameters() {
if (this.wallForm !== undefined) {
for (const p of this.wallForm.getFixedParameters()) {
this._pbResults.cloisonResults.addFixedParameter(p);
if (this._selectedItem !== undefined && this._selectedItem instanceof PbCloison) {
for (const s of this._selectedItem.structures) {
for (const p of s.parameterIterator) {
// if some parameter is variating, add id too (trick with PbResultsComponent)
if (p.visible) {
const ngp = this.getCloisonParam(p);
if (ngp) {
this._pbResults.cloisonResults.addFixedParameter(ngp);
}
}
}
}
}
}
......
......@@ -344,6 +344,7 @@
"INFO_LIB_STRUCTURE_SEUILTRIANGULAIRE": "Triangular weir",
"INFO_LIB_STRUCTURE_SEUILTRIANGULAIRETRUNC": "Truncated triangular weir",
"INFO_LIB_STRUCTURE_VANNERECTANGULAIRE": "Rectangular gate",
"INFO_LIB_STRUCTURE_N_COURT": "D",
"INFO_LIB_TAU0": "Tractive force",
"INFO_LIB_TOR": "Supercritical water line",
"INFO_LIB_TOTAL": "Total",
......
......@@ -345,6 +345,7 @@
"INFO_LIB_STRUCTURE_SEUILTRIANGULAIRE": "Seuil triangulaire",
"INFO_LIB_STRUCTURE_SEUILTRIANGULAIRETRUNC": "Seuil triangulaire tronqué",
"INFO_LIB_STRUCTURE_VANNERECTANGULAIRE": "Vanne rectangulaire",
"INFO_LIB_STRUCTURE_N_COURT": "O",
"INFO_LIB_TAU0": "Force tractrice",
"INFO_LIB_TOR": "Ligne d'eau torrentielle",
"INFO_LIB_TOTAL": "Total",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment