Skip to content
Snippets Groups Projects
Commit 02af2612 authored by francois.grand's avatar francois.grand
Browse files

#77 FieldSet.setPropValue() : utilisation de la classe de la lib StructureProperties

parent 1fc61472
No related branches found
No related tags found
1 merge request!15Resolve "faire les modifications nécessaires prendre en compte le ticket cassiopee/jalhyd#46 (Gestion de la session dans la lib)"
import { CalculatorType, ComputeNodeType, ParamDefinition, LoiDebit, StructureType, Props, loiAdmissibles, SessionNub } from "jalhyd";
import { CalculatorType, ComputeNodeType, ParamDefinition, LoiDebit, StructureType, Props, SessionNub, StructureProperties } from "jalhyd";
import { FormulaireElement } from "./formulaire-element";
import { Dependency } from "./dependency/dependency";
......@@ -122,12 +122,13 @@ export class FieldSet extends FormulaireElement implements Observer {
// si prop=type d'ouvrage, on prend une loi de débit compatible avec (spécifique aux ouvrages //) comme valeur par défaut
if (key === "structureType") {
{
const sst: string = StructureType[val];
const ld: LoiDebit = loiAdmissibles[sst][0];
this.setPropValue("loiDebit", ld);
}
if (!StructureProperties.isCompatibleValues(val, this.getPropValue("loiDebit")))
this.setPropValue("loiDebit", StructureProperties.findCompatibleLoiDebit(val));
}
// si prop=loi débit, on prend un type d'ouvrage compatible
else if (key === "loiDebit")
if (!StructureProperties.isCompatibleValues(this.getPropValue("structureType"), val))
this.setPropValue("structureType", StructureProperties.findCompatibleStructure(val));
}
return changed;
}
......
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