Commit 05990896 authored by Mathias Chouet's avatar Mathias Chouet 🍝
Browse files

ParamDefinition: save initial value for dicho calculated params

parent c8a13b42
......@@ -772,6 +772,13 @@ export class ParamDefinition implements INamedIterableValues, IObservable {
paramRep.value = this.singleValue;
break;
case ParamValueMode.CALCUL:
// save initial value if param is calculated using dichotomy
if (this.calculability === ParamCalculability.DICHO) {
paramRep.value = this.singleValue;
}
break;
case ParamValueMode.MINMAX:
paramRep.min = this.min;
paramRep.max = this.max;
......@@ -874,6 +881,9 @@ export class ParamDefinition implements INamedIterableValues, IObservable {
case ParamValueMode.CALCUL:
// although calculated param is set at Nub level (see below),
// it is detected as "the only parameter in CALC mode"
if (obj.value !== undefined) { // dichotomy params have an initial value, others don't
this.singleValue = obj.value;
}
ret.calculated = true;
break;
......
Markdown is supported
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