From f6850bdce75c27cd6622d401e2b8865ae9404c54 Mon Sep 17 00:00:00 2001
From: "francois.grand" <francois.grand@irstea.fr>
Date: Thu, 12 Apr 2018 15:27:20 +0200
Subject: [PATCH] =?UTF-8?q?=20#46=20remplacement=20de=20l'utilisation=20di?=
 =?UTF-8?q?recte=20de=20la=20propri=C3=A9t=C3=A9=20ParamsEquation.map=20pa?=
 =?UTF-8?q?r=20la=20m=C3=A9thode=20appropri=C3=A9e?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/nub.ts                          | 5 ++---
 src/structure/parallel_structure.ts | 4 ++--
 src/structure/structure.ts          | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/nub.ts b/src/nub.ts
index 9d77e19a..4decb596 100644
--- a/src/nub.ts
+++ b/src/nub.ts
@@ -74,8 +74,7 @@ export abstract class Nub extends ComputeNode {
 
         let variatedParam: ParamDefinition;
         let computedParam: ParamDefinition;
-        for (const k in this._prms.map) {
-            const p: ParamDefinition = this._prms.map[k];
+        for (const p of this.parameterIterator) {
 
             switch (p.valueMode) {
                 case ParamValueMode.LISTE:
@@ -106,7 +105,7 @@ export abstract class Nub extends ComputeNode {
         }
 
         if (rInit === undefined)
-            rInit = this._prms.map[computedSymbol].v;
+            rInit = computedParam.v;
 
         if (variatedParam == undefined)
             this.Calc(computedSymbol, rInit, rPrec); // résultat dans this._result
diff --git a/src/structure/parallel_structure.ts b/src/structure/parallel_structure.ts
index 40259b82..b9117695 100644
--- a/src/structure/parallel_structure.ts
+++ b/src/structure/parallel_structure.ts
@@ -126,7 +126,7 @@ export class ParallelStructure extends Nub {
             case "Q":
                 res = super.Calc(sVarCalc, rInit, rPrec);
                 if (res.ok) {
-                    this.prms.map[sVarCalc].v = res.vCalc;
+                    this.getParameter(sVarCalc).setValue(res.vCalc, false);
                 }
                 break;
             default:
@@ -134,7 +134,7 @@ export class ParallelStructure extends Nub {
                 const sVC = this.getStructureVarCalc(sVarCalc);
                 res = this.CalcStructPrm(sVC, rInit, rPrec);
                 if (res.ok) {
-                    this.structures[sVC.index].prms.map[sVC.prm].v = res.vCalc;
+                    this.structures[sVC.index].getParameter(sVC.prm).setValue(res.vCalc, false);
                 }
         }
         if (res.ok) {
diff --git a/src/structure/structure.ts b/src/structure/structure.ts
index 5e73d099..69ce4fea 100644
--- a/src/structure/structure.ts
+++ b/src/structure/structure.ts
@@ -77,7 +77,7 @@ export abstract class Structure extends Nub {
     public Calc(sVarCalc: string, rInit?: number, rPrec: number = 0.001): Result {
         // Gestion de l'exception de calcul de W sur les seuils
         if (rInit === undefined) {
-            rInit = this._prms.map[sVarCalc].v;
+            rInit = this.getParameter(sVarCalc).v;
         }
         if (sVarCalc === "W" && rInit === Infinity) {
             throw new Error("Structure:Calc : Calcul de W impossible sur un seuil");
-- 
GitLab