Skip to content
Snippets Groups Projects
Commit 2964b339 authored by mathias.chouet's avatar mathias.chouet
Browse files

[WIP] properly separating singleValue and currntValue concepts

parent d4ebd59f
No related branches found
No related tags found
No related merge requests found
......@@ -47,9 +47,7 @@ export class NgParamInputComponent extends GenericInputComponent implements Obse
*/
protected afterSetModel() {
if (this._paramDef) {
if (this._paramDef.isDefined) {
this._tmp = this._paramDef.getValue();
}
this._tmp = this._paramDef.getValue();
this._paramDef.addObserver(this);
}
}
......
......@@ -208,9 +208,6 @@ export class ParamFieldLineComponent implements OnChanges {
switch (option) {
case "fix":
this.param.valueMode = ParamValueMode.SINGLE;
// reset the value to avoid "undefined" after exiting CALC or LINK mode
// @TODO not always necessary; find out why
this.param.setValue(this, this.param.paramDefinition.singleValue);
break;
case "var":
......
......@@ -43,9 +43,8 @@ export abstract class FormCompute implements Observer {
computedParam = nub.calculatedParam;
}
// require chain computation; redundant with Nub.CalcSerie but required
// to get initial value here...
const computedParamValue = computedParam.getValue();
// const computedParamValue = computedParam.getValue();
const computedParamValue = computedParam.singleValue;
switch (computedParam.domain.domain) {
case ParamDomainValue.ANY:
......
......@@ -266,8 +266,8 @@ export class NgParameter extends InputField implements Observer {
}
/**
* Asks the ParamDefinition for its current value
* @TODO replace with singleValue to avoid displaying computation results ?
* Asks the ParamDefinition for its singleValue - not currentValue,
* to avoid displaying computation results
*/
public getValue() {
return this._paramDef.getValue();
......
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