Commit cf59453e authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

Work on #108

Showing with 15 additions and 0 deletions
+15 -0
import { CalculatorType } from "../compute-node";
import { ParamValueMode } from "../index";
import { Nub } from "../nub";
import { ParamCalculability, ParamDefinition } from "../param/param-definition";
import { IParamDefinitionIterator, ParamsEquation, ParamsEquationArrayIterator } from "../param/params-equation";
......@@ -253,6 +254,20 @@ export class Pab extends Nub {
this.downWall.reinitResult();
}
/**
* Only Q and Z1 are calculable (see #108)
*/
public findFirstCalculableParameter(otherThan?: ParamDefinition) {
for (const p of [ this.prms.Q, this.prms.Z1 ]) {
if (p !== otherThan
&& p.valueMode !== ParamValueMode.CALCUL // event LINK might be reset here
) {
return p;
}
}
throw new Error(`PAB : no calculable parameter found other than ${otherThan ? otherThan.symbol : "undefined"}`);
}
/**
* paramétrage de la calculabilité des paramètres
*/
......
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