Skip to content
Snippets Groups Projects
Commit 5950449c authored by francois.grand's avatar francois.grand
Browse files

#77 FormCompute.runNubCalc() : amélioration du choix de la valeur initiale...

 #77 FormCompute.runNubCalc() : amélioration du choix de la valeur initiale (cas où le paramètre à calculer a une valeur indéfinie)
parent 3d0a5d42
No related branches found
No related tags found
1 merge request!15Resolve "faire les modifications nécessaires prendre en compte le ticket cassiopee/jalhyd#46 (Gestion de la session dans la lib)"
......@@ -31,11 +31,17 @@ export abstract class FormCompute {
let init: number;
switch (computedParam.domain.domain) {
case ParamDomainValue.ANY:
init = computedParam.getValue();
if (computedParam && computedParam.isDefined)
init = computedParam.getValue();
if (init === undefined)
init = 0;
break;
case ParamDomainValue.POS_NULL:
init = Math.max(computedParam.getValue(), 0);
if (computedParam && computedParam.isDefined)
init = Math.max(computedParam.getValue(), 0);
if (init === undefined)
init = 0;
break;
case ParamDomainValue.INTERVAL:
......@@ -43,13 +49,17 @@ export abstract class FormCompute {
break;
case ParamDomainValue.NOT_NULL:
init = computedParam.getValue();
if (init === 0)
if (computedParam && computedParam.isDefined)
init = computedParam.getValue();
if (init === undefined || init === 0)
init = 1e-8;
break;
case ParamDomainValue.POS:
init = Math.max(computedParam.getValue(), 1e-8);
if (computedParam && computedParam.isDefined)
init = Math.max(computedParam.getValue(), 1e-8);
if (init === undefined)
init = 1e-8;
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment