From ed1cb2f0d6434118563afa1fe0332c5ff3e337c5 Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Tue, 15 Jan 2019 15:21:12 +0100
Subject: [PATCH] =?UTF-8?q?M=C3=A0j=20jalhyd:=20utilisation=20de=20ParamDe?=
 =?UTF-8?q?finition=20au=20lieu=20de=20BaseParam?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md                                             |  2 +-
 .../base-param-input/base-param-input.component.ts    | 11 +++++------
 .../generic-input/generic-input.component.ts          |  4 ++--
 src/app/formulaire/ngparam.ts                         |  2 +-
 4 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md
index 2af2e1c50..1ee1be580 100644
--- a/README.md
+++ b/README.md
@@ -152,7 +152,7 @@ and then :
 	- dans _src/app/calculators/ma-calculette_ :
 
 		Créer _ma-calculette.config.json_ sur le modèle des autres.
-		Les ids utilisés doivent correspondre au symbole fourni à classe _BaseParam_ (1er paramètre du constructeur)
+		Les ids utilisés doivent correspondre au symbole fourni à classe _ParamDefinition_ (1er paramètre du constructeur)
 
 		Ne pas oublier de spécifier :
 		- éventuellement le type de noeud par défaut de la calculette dans les options avec le champ "_defaultNodeType_". Si ce champ est absent, sa valeur est "_ComputeNodeType.None_". Ce champ sert par ex pour les sections paramétrées à déterminer le type de section à afficher lors de la création de la calculette.
diff --git a/src/app/components/base-param-input/base-param-input.component.ts b/src/app/components/base-param-input/base-param-input.component.ts
index f879a787b..8144f03d7 100644
--- a/src/app/components/base-param-input/base-param-input.component.ts
+++ b/src/app/components/base-param-input/base-param-input.component.ts
@@ -1,19 +1,18 @@
 // cf. https://blog.thoughtram.io/angular/2016/07/27/custom-form-controls-in-angular-2.html
 
-import { Component, Input, forwardRef, OnInit, DoCheck, ChangeDetectorRef } from "@angular/core";
-import { ControlValueAccessor, NG_VALUE_ACCESSOR, NG_VALIDATORS, FormControl } from "@angular/forms";
+import { Component, ChangeDetectorRef } from "@angular/core";
 
-import { BaseParam, NumericalString, Message, ParamDomain, ParamDomainValue, Observable } from "jalhyd";
+import { NumericalString, Message, ParamDefinition, ParamDomain, ParamDomainValue, Observable } from "jalhyd";
 
-import { InternationalisationService, LanguageCode } from "../../services/internationalisation/internationalisation.service";
+import { InternationalisationService } from "../../services/internationalisation/internationalisation.service";
 import { GenericInputComponent } from "../generic-input/generic-input.component";
 
 export class NgBaseParam extends Observable {
-    private _param: BaseParam;
+    private _param: ParamDefinition;
 
     constructor(symb: string, d: ParamDomain | ParamDomainValue, val: number) {
         super();
-        this._param = new BaseParam(symb, d, val);
+        this._param = new ParamDefinition(symb, d, val);
     }
 
     public get symbol() {
diff --git a/src/app/components/generic-input/generic-input.component.ts b/src/app/components/generic-input/generic-input.component.ts
index f392282fb..e5513138b 100644
--- a/src/app/components/generic-input/generic-input.component.ts
+++ b/src/app/components/generic-input/generic-input.component.ts
@@ -360,7 +360,7 @@ export class TestInputComponent extends GenericInputComponent {
 
 // exemple où le modèle est une classe dont on ne gère qu'un membre
 
-import { BaseParam } from "jalhyd";
+import { ParamDefinition } from "jalhyd";
 
 @Component({
     selector: "test2-input",
@@ -376,7 +376,7 @@ export class Test2InputComponent extends GenericInputComponent {
     }
 
     // paramètre géré
-    private get _param(): BaseParam {
+    private get _param(): ParamDefinition {
         return this._model;
     }
 
diff --git a/src/app/formulaire/ngparam.ts b/src/app/formulaire/ngparam.ts
index 3eb725cc7..50125790a 100644
--- a/src/app/formulaire/ngparam.ts
+++ b/src/app/formulaire/ngparam.ts
@@ -387,7 +387,7 @@ export class NgParameter extends InputField implements Observer {
 
     public update(sender: any, data: any) {
         switch (data["action"]) {
-            case "baseparamAfterValue": // changement de valeur envoyé par l'objet référencé
+            case "paramdefinitionAfterValue": // changement de valeur envoyé par l'objet référencé
                 this.notifyValueModified(sender);
                 break;
         }
-- 
GitLab