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

refactor: rename LechaptCalmon nub to PL_LechaptCalmon

refs #334
parent c7873f8c
No related branches found
No related tags found
No related merge requests found
import { ParamCalculability } from "../../src/param/param-definition"; import { ParamCalculability } from "../../src/param/param-definition";
import { LechaptCalmon } from "../../src/pipe_flow/lechaptcalmon"; import { PL_LechaptCalmon } from "../../src/pipe_flow/pl_lechaptcalmon";
import { LechaptCalmonParams } from "../../src/pipe_flow/lechaptcalmon_params"; import { PL_LechaptCalmonParams } from "../../src/pipe_flow/pl_lechaptcalmon_params";
import { SessionSettings } from "../../src/session_settings"; import { SessionSettings } from "../../src/session_settings";
import { MessageCode } from "../../src/util/message"; import { MessageCode } from "../../src/util/message";
function getLechapt(): LechaptCalmon { function getLechapt(): PL_LechaptCalmon {
const l = new LechaptCalmon( const l = new PL_LechaptCalmon(
new LechaptCalmonParams( new PL_LechaptCalmonParams(
0.3, // débit 0.3, // débit
0.5, // diamètre 0.5, // diamètre
0.1, /// perte de charge 0.1, /// perte de charge
...@@ -22,7 +22,7 @@ function getLechapt(): LechaptCalmon { ...@@ -22,7 +22,7 @@ function getLechapt(): LechaptCalmon {
return l; return l;
} }
let lechapt: LechaptCalmon = getLechapt(); let lechapt: PL_LechaptCalmon = getLechapt();
describe("Class LechaptCalmon : ", () => { describe("Class LechaptCalmon : ", () => {
beforeAll(() => { beforeAll(() => {
......
...@@ -60,7 +60,7 @@ export * from "./pab/pab_nombre_params"; ...@@ -60,7 +60,7 @@ export * from "./pab/pab_nombre_params";
export * from "./pab/pab_puissance"; export * from "./pab/pab_puissance";
export * from "./pab/pab_puissance_params"; export * from "./pab/pab_puissance_params";
export * from "./pab/cloison_aval"; export * from "./pab/cloison_aval";
export * from "./pipe_flow/lechaptcalmon"; export * from "./pipe_flow/pl_lechaptcalmon";
export * from "./lc-material"; export * from "./lc-material";
export * from "./structure/dever"; export * from "./structure/dever";
export * from "./macrorugo/macrorugo"; export * from "./macrorugo/macrorugo";
......
...@@ -5,12 +5,12 @@ import { ParamCalculability } from "../param/param-definition"; ...@@ -5,12 +5,12 @@ import { ParamCalculability } from "../param/param-definition";
import { Message, MessageCode } from "../util/message"; import { Message, MessageCode } from "../util/message";
import { Observer } from "../util/observer"; import { Observer } from "../util/observer";
import { Result } from "../util/result"; import { Result } from "../util/result";
import { LechaptCalmonParams } from "./lechaptcalmon_params"; import { PL_LechaptCalmonParams } from "./pl_lechaptcalmon_params";
/** /**
* Calcul des pertes de charge dans un tube à partir des tables de Lechapt et Calmon * Calcul des pertes de charge dans un tube à partir des tables de Lechapt et Calmon
*/ */
export class LechaptCalmon extends Nub implements Observer { export class PL_LechaptCalmon extends Nub implements Observer {
private static _materials: { L: number, M: number, N: number, title: string }[] = [ private static _materials: { L: number, M: number, N: number, title: string }[] = [
{ {
...@@ -69,7 +69,7 @@ export class LechaptCalmon extends Nub implements Observer { ...@@ -69,7 +69,7 @@ export class LechaptCalmon extends Nub implements Observer {
} }
]; ];
constructor(prms: LechaptCalmonParams, dbg: boolean = false) { constructor(prms: PL_LechaptCalmonParams, dbg: boolean = false) {
super(prms, dbg); super(prms, dbg);
this.setCalculatorType(CalculatorType.LechaptCalmon); this.setCalculatorType(CalculatorType.LechaptCalmon);
this._props.addObserver(this); this._props.addObserver(this);
...@@ -77,7 +77,7 @@ export class LechaptCalmon extends Nub implements Observer { ...@@ -77,7 +77,7 @@ export class LechaptCalmon extends Nub implements Observer {
} }
public static get materials() { public static get materials() {
return LechaptCalmon._materials; return PL_LechaptCalmon._materials;
} }
public get material(): LCMaterial { public get material(): LCMaterial {
...@@ -91,8 +91,8 @@ export class LechaptCalmon extends Nub implements Observer { ...@@ -91,8 +91,8 @@ export class LechaptCalmon extends Nub implements Observer {
/** /**
* paramètres castés au bon type * paramètres castés au bon type
*/ */
get prms(): LechaptCalmonParams { get prms(): PL_LechaptCalmonParams {
return this._prms as LechaptCalmonParams; return this._prms as PL_LechaptCalmonParams;
} }
public Calc(sVarCalc: string, rInit?: number): Result { public Calc(sVarCalc: string, rInit?: number): Result {
...@@ -161,7 +161,7 @@ export class LechaptCalmon extends Nub implements Observer { ...@@ -161,7 +161,7 @@ export class LechaptCalmon extends Nub implements Observer {
private applyMaterialPreset() { private applyMaterialPreset() {
const m = this.properties.getPropValue("material"); const m = this.properties.getPropValue("material");
if (m > 0) { if (m > 0) {
const values = LechaptCalmon._materials[m - 1]; // "0" means no preset const values = PL_LechaptCalmon._materials[m - 1]; // "0" means no preset
this.prms.L.singleValue = values.L; this.prms.L.singleValue = values.L;
this.prms.M.singleValue = values.M; this.prms.M.singleValue = values.M;
this.prms.N.singleValue = values.N; this.prms.N.singleValue = values.N;
......
...@@ -5,7 +5,7 @@ import { ParamsEquation } from "../param/params-equation"; ...@@ -5,7 +5,7 @@ import { ParamsEquation } from "../param/params-equation";
/** /**
* paramètres pour le calcul Lechapt et Calmon * paramètres pour le calcul Lechapt et Calmon
*/ */
export class LechaptCalmonParams extends ParamsEquation { export class PL_LechaptCalmonParams extends ParamsEquation {
/** Débit */ /** Débit */
private _Q: ParamDefinition; private _Q: ParamDefinition;
......
import { Nub } from "../nub";
import { Observer } from "../util/observer";
import { Result } from "../util/result";
export class PressureLoss extends Nub implements Observer {
/**
* paramétrage de la calculabilité des paramètres
*/
protected setParametersCalculability() {
}
public Equation(sVarCalc: string): Result {
return undefined;
}
// interface Observer
public update(sender: any, data: any) {
}
}
...@@ -62,8 +62,8 @@ import { PabPuissance } from "./pab/pab_puissance"; ...@@ -62,8 +62,8 @@ import { PabPuissance } from "./pab/pab_puissance";
import { PabPuissanceParams } from "./pab/pab_puissance_params"; import { PabPuissanceParams } from "./pab/pab_puissance_params";
import { ConduiteDistrib } from "./pipe_flow/cond_distri"; import { ConduiteDistrib } from "./pipe_flow/cond_distri";
import { ConduiteDistribParams } from "./pipe_flow/cond_distri_params"; import { ConduiteDistribParams } from "./pipe_flow/cond_distri_params";
import { LechaptCalmon } from "./pipe_flow/lechaptcalmon"; import { PL_LechaptCalmon } from "./pipe_flow/pl_lechaptcalmon";
import { LechaptCalmonParams } from "./pipe_flow/lechaptcalmon_params"; import { PL_LechaptCalmonParams } from "./pipe_flow/pl_lechaptcalmon_params";
import { Solveur } from "./solveur/solveur"; import { Solveur } from "./solveur/solveur";
import { SolveurParams } from "./solveur/solveur_params"; import { SolveurParams } from "./solveur/solveur_params";
import { Dever } from "./structure/dever"; import { Dever } from "./structure/dever";
...@@ -394,7 +394,7 @@ export class Session { ...@@ -394,7 +394,7 @@ export class Session {
break; break;
case CalculatorType.LechaptCalmon: case CalculatorType.LechaptCalmon:
prms = new LechaptCalmonParams( prms = new PL_LechaptCalmonParams(
3, // débit 3, // débit
1.2, // diamètre 1.2, // diamètre
0.6, /// perte de charge 0.6, /// perte de charge
...@@ -405,7 +405,7 @@ export class Session { ...@@ -405,7 +405,7 @@ export class Session {
0, // Ks Perte de charge singulière 0, // Ks Perte de charge singulière
nullParams nullParams
); );
nub = new LechaptCalmon(prms, dbg); nub = new PL_LechaptCalmon(prms, dbg);
break; break;
case CalculatorType.SectionParametree: case CalculatorType.SectionParametree:
......
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