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

#48 modifs suite à l'ajout de hasMultipleValues dans IterableValues (jalHyd)

parent 8a2ec551
No related branches found
No related tags found
1 merge request!22Resolve "Lier des paramètres ou des résultats entre les calculettes"
......@@ -21,12 +21,8 @@ export class FormComputeFixedVar extends FormCompute {
const pms = this._formBase.getDisplayedParamListFromState(ParamRadioConfig.LINK);
for (const p of pms)
if (p.valueMode === ParamValueMode.LINK)
switch (p.paramDefinition.referencedParamValues.valueMode) {
case ParamValueMode.LISTE:
case ParamValueMode.MINMAX:
return p;
}
if (p.paramDefinition.hasMultipleValues)
return p;
return undefined;
}
......
......@@ -80,21 +80,13 @@ export class FormDefFixedVar {
break;
case ParamValueMode.LINK: // nouvel état
// mode du paramètre référencé
const refParamValues = sourceParam.paramDefinition.referencedParamValues;
switch (refParamValues.valueMode) {
case ParamValueMode.MINMAX:
case ParamValueMode.LISTE:
this.resetOtherRadio(sourceParam, ParamRadioConfig.CAL);
break;
case ParamValueMode.CALCUL:
if (refParamValues.hasMultipleValues)
this.resetOtherRadio(sourceParam, ParamRadioConfig.CAL);
break;
case ParamValueMode.LINK:
throw new Error(`références de paramètre en chaîne non pris en charge`); // cas à traiter
if (sourceParam.paramDefinition.hasMultipleValues)
this.resetOtherRadio(sourceParam, ParamRadioConfig.CAL);
else {
const refParamValues = sourceParam.paramDefinition.referencedParamValues;
if (refParamValues !== undefined) // cad si on référence un paramètre et non un Result par ex
if (refParamValues.valueMode == ParamValueMode.LINK)
throw new Error(`références de paramètre en chaîne non pris en charge`); // cas à traiter
}
break;
}
......
......@@ -42,7 +42,7 @@ export class FormResultFixedVar extends FormResult {
this._fixedResults.addFixedParameter(p);
for (const p of this._formBase.getDisplayedParamListFromState(ParamRadioConfig.LINK))
if (p.paramDefinition.referencedParamValues.valueMode == ParamValueMode.SINGLE)
if (!p.paramDefinition.hasMultipleValues)
this._fixedResults.addFixedParameter(p);
}
......
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