From f89533f09bf4f3bd857bbf1d880a22c88f0520ce Mon Sep 17 00:00:00 2001 From: "francois.grand" <francois.grand@irstea.fr> Date: Fri, 15 Sep 2017 11:01:57 +0200 Subject: [PATCH] =?UTF-8?q?classe=20ComputeNodeParameters=20:=20ajout=20du?= =?UTF-8?q?=20cas=20des=20sections=20param=C3=A9tr=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 4 +++ src/parameters.ts | 62 ++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 54 insertions(+), 12 deletions(-) diff --git a/src/index.ts b/src/index.ts index bde5cd73..7cc7e353 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,10 @@ export * from './cond_distri'; export * from './dichotomie'; export * from './lechaptcalmon'; export * from './regime_uniforme'; +export * from './section/section_trapez'; +export * from './section/section_rectang'; +export * from './section/section_circulaire'; +export * from './section/section_puissance'; export * from './util/definedvalue'; export * from './util/numericalstring'; export * from './util/error'; diff --git a/src/parameters.ts b/src/parameters.ts index 895526e9..17c23d05 100644 --- a/src/parameters.ts +++ b/src/parameters.ts @@ -1,6 +1,10 @@ import { IParamsEquation } from "./param"; import { ConduiteDistribParams, ConduiteDistrib } from "./cond_distri"; import { LechaptCalmonParams, LechaptCalmon } from "./lechaptcalmon"; +import { ParamsSectionTrapez, cSnTrapez } from "./section/section_trapez"; +import { ParamsSectionRectang, cSnRectang } from "./section/section_rectang"; +import { ParamsSectionCirc, cSnCirc } from "./section/section_circulaire"; +import { ParamsSectionPuiss, cSnPuiss } from "./section/section_puissance"; export class ComputeNodeParameters { private static _instance: ComputeNodeParameters; @@ -14,17 +18,51 @@ export class ComputeNodeParameters { } public getComputeNodeParameters(name: string): IParamsEquation { - if (name == "cond_distri") { - let cn = new ConduiteDistribParams(undefined, undefined, undefined, undefined, undefined); - let n = new ConduiteDistrib(cn); // pour initialiser la calculabilité des paramètres - return cn; - } else - if (name == "lechapt_calmon") { - let cn = new LechaptCalmonParams(undefined, undefined, undefined, undefined, undefined, undefined, undefined); - let n = new LechaptCalmon(cn); // pour initialiser la calculabilité des paramètres - return cn; - } - - return undefined; + switch (name) { + case "cond_distri": + { + let cn = new ConduiteDistribParams(undefined, undefined, undefined, undefined, undefined); + let n = new ConduiteDistrib(cn); // pour initialiser la calculabilité des paramètres + return cn; + } + + case "lechapt_calmon": + { + let cn = new LechaptCalmonParams(undefined, undefined, undefined, undefined, undefined, undefined, undefined); + let n = new LechaptCalmon(cn); // pour initialiser la calculabilité des paramètres + return cn; + } + + case "section_param_trapez": + { + let cn = new ParamsSectionTrapez(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined); + let n = new cSnTrapez(undefined, cn); // pour initialiser la calculabilité des paramètres + return cn; + } + + case "section_param_rect": + { + let cn = new ParamsSectionRectang(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined); + let n = new cSnRectang(undefined, cn); // pour initialiser la calculabilité des paramètres + return cn; + } + + case "section_param_circ": + { + let cn = new ParamsSectionCirc(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined); + let n = new cSnCirc(undefined, cn); // pour initialiser la calculabilité des paramètres + return cn; + } + + case "section_param_para": + { + let cn = new ParamsSectionPuiss(undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined); + let n = new cSnPuiss(undefined, cn); // pour initialiser la calculabilité des paramètres + return cn; + } + + default: + throw "ComputeNodeParameters.getComputeNodeParameters() : nub '" + name + "' non pris en charge"; + } } } -- GitLab