Skip to content
Snippets Groups Projects
Commit 6e6a2bf5 authored by François's avatar François
Browse files

Correction d'un bug d'initialisation du min/max pour les paramètres à varier

par ex : conduite distributrice, calculer Perte de charge, varier Longueur du tuyau, "calculer" -> pas de graphe
parent a486f542
No related branches found
No related tags found
1 merge request!7Resolve "Paramètres à varier : liste libre de paramètres"
......@@ -158,28 +158,7 @@ export class ParamValuesComponent implements DoCheck {
this._valueModes.push({ "value": ParamValueMode.MINMAX, "label": "Min/max" });
this._valueModes.push({ "value": ParamValueMode.LISTE, "label": "Liste" });
}
private getDefaultMin(): number {
switch (this._param.domain.domain) {
case ParamDomainValue.ANY:
case ParamDomainValue.NOT_NULL:
return -10;
default:
return this._param.domain.minValue;
}
}
private getDefaultMax(): number {
switch (this._param.domain.domain) {
case ParamDomainValue.INTERVAL:
return this._param.domain.maxValue;
default:
return 10;
}
}
private initMinMaxStep() {
// valeur pour min (celle déjà définie ou celle déduite du domaine de définition)
let min: number = this._param.minValue;
......@@ -195,7 +174,7 @@ export class ParamValuesComponent implements DoCheck {
}
}
if (!ok)
min = this.getDefaultMin();
min = this._param.getValue() / 2;
// valeur pour max (celle déjà définie ou celle déduite du domaine de définition)
let max: number = this._param.maxValue;
......@@ -211,13 +190,13 @@ export class ParamValuesComponent implements DoCheck {
}
}
if (!ok)
max = this.getDefaultMax();
max = this._param.getValue() * 2;
this._minComponent.refValue = new Pair(this._param.domain.minValue, max);
this._minComponent.model = this._param.getValue() / 2;
this._minComponent.model = min;
this._maxComponent.refValue = new Pair(min, this._param.domain.maxValue);
this._maxComponent.model = this._param.getValue() * 2;
this._maxComponent.model = max;
this.updateStepComponentRef();
......
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