Commit f6850bdc authored by Grand Francois's avatar Grand Francois
Browse files

#46 remplacement de l'utilisation directe de la propriété ParamsEquation.map...

 #46 remplacement de l'utilisation directe de la propriété ParamsEquation.map par la méthode appropriée
Showing with 5 additions and 6 deletions
+5 -6
......@@ -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
......
......@@ -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) {
......
......@@ -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");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment