From e8da0e2a45e2718d57036f18dc344761823c1b8c Mon Sep 17 00:00:00 2001
From: "francois.grand" <francois.grand@irstea.fr>
Date: Thu, 22 Mar 2018 13:45:02 +0100
Subject: [PATCH] =?UTF-8?q?classe=20ParamValues=20:=20arguments=20du=20con?=
 =?UTF-8?q?structeur=20d=C3=A9plac=C3=A9=20vers=20une=20nouvelle=20m=C3=A9?=
 =?UTF-8?q?thode=20setValues()?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/param/param-values.ts | 4 ++--
 src/remous.ts             | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/param/param-values.ts b/src/param/param-values.ts
index cb27d317..bd7eb3ef 100644
--- a/src/param/param-values.ts
+++ b/src/param/param-values.ts
@@ -176,7 +176,7 @@ export class ParamValues {
      */
     private _valueList: number[];
 
-    constructor(o: number | any, max?: number, step?: number) {
+    public setValues(o: number | any, max?: number, step?: number) {
         if (typeof (o) === "number") {
             if (max == undefined) {
                 this._valueMode = ParamValueMode.SINGLE;
@@ -191,7 +191,7 @@ export class ParamValues {
         else if (Array.isArray(o))
             this._valueList = o;
         else
-            throw new Error(`appel du constructeur ParamValues invalide`);
+            throw new Error(`ParamValues.setValues() :  appel invalide`);
     }
 
     public get valueMode() {
diff --git a/src/remous.ts b/src/remous.ts
index 3231797b..d5ce39b9 100644
--- a/src/remous.ts
+++ b/src/remous.ts
@@ -251,7 +251,8 @@ export class CourbeRemous extends Nub {
 
         // Calcul des courbes de remous
 
-        const xValues = new ParamValues(0, this.prms.Long.v, this.Dx)
+        const xValues = new ParamValues();
+        xValues.setValues(0, this.prms.Long.v, this.Dx)
 
         // let crbFlu: { [key: number]: number; } = this.calculFluvial();
         const rCourbeFlu: ResultElement = this.calculFluvial(xValues);
-- 
GitLab