diff --git a/src/compute-node.ts b/src/compute-node.ts index 93b34ea7160a4055098335d253f5680507276a32..915b9cf25081b3cd710d86212cd0190970042574 100644 --- a/src/compute-node.ts +++ b/src/compute-node.ts @@ -17,11 +17,12 @@ export enum CalculatorType { Structure, // ouvrages hydrauliques simples ParallelStructure, // ouvrages hydrauliques en parallèle Dever, // Outil Cassiopée Dever - Cloisons, // Outil Cassiopée PAB Cloisons - MacroRugo, // Passe à enrochement simple (Cassan et al., 2016) + Cloisons, // Outil Cassiopée PAB Cloisons + MacroRugo, // Passe à enrochement simple (Cassan et al., 2016) PabChute, PabNombre, - Section + Section, + Pab // Passe à bassins } /** diff --git a/src/pab/pab.ts b/src/pab/pab.ts index 1bef4aeb00315368ebaf5931c963817e92ea8e5c..2d9997c4d0ad4e0318e6cd0608bd4db1828b99be 100644 --- a/src/pab/pab.ts +++ b/src/pab/pab.ts @@ -1,3 +1,4 @@ +import { CalculatorType } from "../compute-node"; import { Nub } from "../nub"; import { ParamCalculability } from "../param/param-definition"; import { Result } from "../util/result"; @@ -8,6 +9,11 @@ export { PabParams }; export class Pab extends Nub { + constructor(prms: PabParams, dbg: boolean = false) { + super(prms, dbg); + this._calcType = CalculatorType.Pab; + } + /** * paramètres castés au bon type */ diff --git a/src/pab/pab_params.ts b/src/pab/pab_params.ts index 00949271de9a430a9096ecd4a3801ee51a48ea4c..15d858dbf113403e7dfcf4a45bce2fc1f6f11354 100644 --- a/src/pab/pab_params.ts +++ b/src/pab/pab_params.ts @@ -23,7 +23,7 @@ export class PabParams extends ParamsEquation { */ constructor(rQ: number, rZ1: number, rZ2: number) { super(); - this.Q = new ParamDefinition(this, "Q", ParamDomainValue.ANY, rZ1, ParamFamily.FLOWS); + this.Q = new ParamDefinition(this, "Q", ParamDomainValue.ANY, rQ, ParamFamily.FLOWS); this.addParamDefinition(this.Q); this.Z1 = new ParamDefinition(this, "Z1", ParamDomainValue.ANY, rZ1, ParamFamily.ELEVATIONS); this.addParamDefinition(this.Z1); diff --git a/src/session.ts b/src/session.ts index c70f3d5b03dfb63c94ecaf2abc95ef98e973f0f9..ca6894b89e6f0ab7eb145760aac891f61f8bce0e 100644 --- a/src/session.ts +++ b/src/session.ts @@ -23,13 +23,13 @@ import { acSection } from "./section/section_type"; // Classes relatives aux structures import { LinkedValue } from "./linked-value"; +import { Pab, PabParams } from "./pab/pab"; import { ParamDefinition } from "./param/param-definition"; import { Cloisons } from "./structure/cloisons"; import { CloisonsParams } from "./structure/cloisons_params"; import { Dever, DeverParams } from "./structure/dever"; import { CreateStructure } from "./structure/factory_structure"; import { ParallelStructure, ParallelStructureParams } from "./structure/parallel_structure"; -import { Structure } from "./structure/structure"; import { LoiDebit } from "./structure/structure_props"; export class Session { @@ -332,7 +332,7 @@ export class Session { 0.5, // D 0.8, // k 1.5 // Cd0 - ) + ), dbg ); break; } @@ -344,7 +344,7 @@ export class Session { 2, // Z1 0.5, // Z2 1.5 // DH - ) + ), dbg ); break; } @@ -356,7 +356,7 @@ export class Session { 6, // DHT 10, // N 0.6 // DH - ) + ), dbg ); break; } @@ -367,6 +367,16 @@ export class Session { break; } + case CalculatorType.Pab: + nub = new Pab( + new PabParams( + 1.5, // Q + 102, // Z1 + 99 // Z2 + ), dbg + ); + break; + default: { throw new Error(