diff --git a/src/nub.ts b/src/nub.ts index 9d77e19a293bda111f993c48c7d442bae7b70b00..4decb596884a330eb4a8668529542120615db2e9 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 40259b8252baf215506984f69de4d9998a81bdb2..b911769522e12824c0f7a537270ebe0978e0fc0d 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 5e73d099bbd97798118b5e4f05855a926f4732d4..69ce4fea56d0962496d4b83b722be91fc48254d4 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");