Commit 6e6a2bf5 authored by Grand Francois's avatar Grand Francois
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
Showing with 5 additions and 26 deletions
+5 -26
...@@ -158,28 +158,7 @@ export class ParamValuesComponent implements DoCheck { ...@@ -158,28 +158,7 @@ export class ParamValuesComponent implements DoCheck {
this._valueModes.push({ "value": ParamValueMode.MINMAX, "label": "Min/max" }); this._valueModes.push({ "value": ParamValueMode.MINMAX, "label": "Min/max" });
this._valueModes.push({ "value": ParamValueMode.LISTE, "label": "Liste" }); 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() { private initMinMaxStep() {
// valeur pour min (celle déjà définie ou celle déduite du domaine de définition) // valeur pour min (celle déjà définie ou celle déduite du domaine de définition)
let min: number = this._param.minValue; let min: number = this._param.minValue;
...@@ -195,7 +174,7 @@ export class ParamValuesComponent implements DoCheck { ...@@ -195,7 +174,7 @@ export class ParamValuesComponent implements DoCheck {
} }
} }
if (!ok) 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) // valeur pour max (celle déjà définie ou celle déduite du domaine de définition)
let max: number = this._param.maxValue; let max: number = this._param.maxValue;
...@@ -211,13 +190,13 @@ export class ParamValuesComponent implements DoCheck { ...@@ -211,13 +190,13 @@ export class ParamValuesComponent implements DoCheck {
} }
} }
if (!ok) if (!ok)
max = this.getDefaultMax(); max = this._param.getValue() * 2;
this._minComponent.refValue = new Pair(this._param.domain.minValue, max); 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.refValue = new Pair(min, this._param.domain.maxValue);
this._maxComponent.model = this._param.getValue() * 2; this._maxComponent.model = max;
this.updateStepComponentRef(); this.updateStepComponentRef();
......
Supports Markdown
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