From 0d576f508e38b7725107c1e176f0b4854ebc793e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grand?= <francois.grand@inrae.fr> Date: Wed, 8 Feb 2023 09:25:08 +0100 Subject: [PATCH] fix: pressure loss: Strickler coefficient not empty when empty fields flag is true refs #596 --- src/app/formulaire/definition/form-pressureloss.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/formulaire/definition/form-pressureloss.ts b/src/app/formulaire/definition/form-pressureloss.ts index f574114b1..26c862355 100644 --- a/src/app/formulaire/definition/form-pressureloss.ts +++ b/src/app/formulaire/definition/form-pressureloss.ts @@ -1,6 +1,7 @@ import { PressureLoss, Props, PressureLossType, Session, PressureLossLaw, CalculatorType, IObservable } from "jalhyd"; import { FormulaireFixedVar } from "./form-fixedvar"; import { FieldSet } from "../elements/fieldset"; +import { Prop_NullParameters } from "jalhyd"; /** * Formulaire pour la perte de charge @@ -27,6 +28,7 @@ export class FormulairePressureLoss extends FormulaireFixedVar { // create pressure loss law child nub const propsLaw: Props = new Props(); + propsLaw.setPropValue(Prop_NullParameters, props.getPropValue(Prop_NullParameters)); propsLaw.setPropValue("calcType", CalculatorType.PressureLossLaw); const law = Session.getInstance().createNub(propsLaw) as PressureLossLaw; const pl: PressureLoss = this.currentNub as PressureLoss; @@ -37,7 +39,7 @@ export class FormulairePressureLoss extends FormulaireFixedVar { // changement de propriété du FieldSet contenant le select de choix du type de perte de charge if (sender instanceof FieldSet && sender.id === "fs_pressureloss_law" && data.action === "propertyChange") { // replace underlying pressure loss law without replacing whole Nub - const newPLL = Session.getInstance().createPressureLossLaw(data.value); + const newPLL = Session.getInstance().createPressureLossLaw(data.value, undefined, this.currentNub.getPropValue(Prop_NullParameters)); (this._currentNub as PressureLoss).setLaw(newPLL); // show / hide dependent fields this.refreshFieldsets(); -- GitLab