diff --git a/src/pab/pab.ts b/src/pab/pab.ts index 70dd95cb6b888b91ef9da6d0a69d422d3a048b2b..eae9dcc07609754e0daae671c178b893c0841a8b 100644 --- a/src/pab/pab.ts +++ b/src/pab/pab.ts @@ -28,30 +28,6 @@ export class Pab extends Nub { return this._children as Cloisons[]; } - private static consoleDbgWall(cl: CloisonAval | Cloisons) { - let s: string = ""; - for (const p of cl.prms) { - // tslint:disable-next-line:no-console - s += p.symbol + " = " + p.v + "; "; - } - // tslint:disable-next-line:no-console - console.log(s); - - for (const c of cl.getChildren()) { - // tslint:disable-next-line:no-console - console.log("Ouvrage"); - s = ""; - for (const p of c.prms) { - if (p.visible) { - s += "*"; - } - s += p.symbol + " = " + p.v + "; "; - } - // tslint:disable-next-line:no-console - console.log(s); - } - } - /** * Last wall at downstream */ @@ -148,10 +124,8 @@ export class Pab extends Nub { - this.children[this.children.length - 1].prms.DH.v / 2; this.downWall.result.extraResults.Q = this.downWall.prms.Q.v; this.downWall.result.extraResults.x = l; - if (this.debug) { - console.log("Downstream wall"); - Pab.consoleDbgWall(this.downWall); - } + this.debug("Downstream wall"); + this.dbgWall(this.downWall); for (let i = this.children.length - 1; i >= 0; i--) { @@ -168,10 +142,8 @@ export class Pab extends Nub { l -= cl.prms.LB.v; cl.result.extraResults.x = l; - if (this.debug) { - console.log("Bassin n°" + i); - Pab.consoleDbgWall(cl); - } + this.debug("Bassin n°" + i); + this.dbgWall(cl); } r.vCalc = Z; @@ -302,4 +274,23 @@ export class Pab extends Nub { return cl.result.vCalc; } + private dbgWall(cl: ParallelStructure) { + let s: string = ""; + for (const p of cl.prms) { + s += p.symbol + " = " + p.v + "; "; + } + this.debug(s); + + for (const c of cl.getChildren()) { + this.debug("Ouvrage"); + s = ""; + for (const p of c.prms) { + if (p.visible) { + s += "*"; + } + s += p.symbol + " = " + p.v + "; "; + } + this.debug(s); + } + } }