diff --git a/src/param.ts b/src/param.ts index f1897697cca6cafb62ab9d06809c5180aa50fb4b..694c68040aff9ef509e7571a7fcc76281628a609 100644 --- a/src/param.ts +++ b/src/param.ts @@ -295,32 +295,12 @@ export class ParamDefinition extends BaseParam { */ private _calculatorType: CalculatorType; - /** - * noeud de calcul parent - */ - private _computeNodeType: ComputeNodeType; - - // private static _idGen: number = 0; // A VIRER - // private _id: number; // A VIRER - - constructor(ct: CalculatorType, s: string, d: ParamDomain | ParamDomainValue, val?: number, nt: ComputeNodeType = ComputeNodeType.None) { + constructor(ct: CalculatorType, s: string, d: ParamDomain | ParamDomainValue, val?: number) { super(s, d, val); this._calculatorType = ct; - this._computeNodeType = nt; this._calc = undefined; this.checkValue(val); - - // this._id = ParamDefinition._idGen++; // A VIRER - // console.log("constructor param " + this._symbol + " id=" + this._id); // A VIRER - } - - // get id(): number { - // return this._id; - // } - - get computeNodeType(): ComputeNodeType { - return this._computeNodeType; } get v(): number { @@ -363,7 +343,7 @@ export class ParamDefinition extends BaseParam { } public clone(): ParamDefinition { - const res = new ParamDefinition(this._calculatorType, this.symbol, this.getDomain().clone(), this.uncheckedValue, this._computeNodeType); + const res = new ParamDefinition(this._calculatorType, this.symbol, this.getDomain().clone(), this.uncheckedValue); res._calc = this._calc; return res; } diff --git a/src/remous.ts b/src/remous.ts index 53704c8f136cf381d23b0feab2521dc8e6d9a15b..90e2601e564d9835f4f673e8e69384dfc8555050 100644 --- a/src/remous.ts +++ b/src/remous.ts @@ -1,7 +1,7 @@ import { round, XOR } from "./base"; import { Dichotomie } from "./dichotomie"; import { Nub } from "./nub"; -import { ComputeNodeType, ParamCalculability, ParamDefinition, ParamDomainValue, ParamsEquation, CalculatorType } from "./param"; +import { ParamCalculability, ParamDefinition, ParamDomainValue, ParamsEquation, CalculatorType } from "./param"; import { acSection, ParamsSection } from "./section/section_type"; import { cLog } from "./util/log"; import { Message, MessageCode } from "./util/message"; diff --git a/src/section/section_circulaire.ts b/src/section/section_circulaire.ts index f3666a18dde2c4dd25a9e6adaae28bc634a3c0ec..223c8155a99cc905d2a59947fb40dd492ed5b727 100644 --- a/src/section/section_circulaire.ts +++ b/src/section/section_circulaire.ts @@ -1,4 +1,4 @@ -import { ComputeNodeType, ParamDefinition, ParamDomainValue, ParamCalculability, CalculatorType } from "../param"; +import { ParamDefinition, ParamDomainValue, ParamCalculability, CalculatorType } from "../param"; import { acSection, ParamsSection } from "./section_type"; import { Message, MessageCode } from "../util/message"; import { Result } from "../util/result"; @@ -8,8 +8,8 @@ export class ParamsSectionCirc extends ParamsSection { private _D: ParamDefinition; // Diamètre du cercle constructor(rD: number, rY: number, rKs: number, rQ: number, rIf: number, rPrec: number, rYB: number) { - super(rY, undefined, rKs, rQ, rIf, rPrec, rYB, ComputeNodeType.None); - this._D = new ParamDefinition(CalculatorType.SectionParametree, 'D', ParamDomainValue.POS, rD, ComputeNodeType.SectionCercle); + super(rY, undefined, rKs, rQ, rIf, rPrec, rYB); + this._D = new ParamDefinition(CalculatorType.SectionParametree, 'D', ParamDomainValue.POS, rD); this.addParamDefinition(this._D); } diff --git a/src/section/section_puissance.ts b/src/section/section_puissance.ts index c762de1676b40f378493e8b23eb9fe81882efe76..0efc0d8b496d7db7a1bd12dc1349d028ad823d96 100644 --- a/src/section/section_puissance.ts +++ b/src/section/section_puissance.ts @@ -1,4 +1,4 @@ -import { ComputeNodeType, ParamDefinition, ParamDomain, ParamDomainValue, ParamCalculability, CalculatorType } from "../param"; +import { ParamDefinition, ParamDomain, ParamDomainValue, ParamCalculability, CalculatorType } from "../param"; import { acSection, ParamsSection } from "./section_type"; import { Result } from "../util/result"; @@ -9,8 +9,8 @@ export class ParamsSectionPuiss extends ParamsSection { private _k: ParamDefinition; // Coefficient de forme compris entre 0 et 1 constructor(rk: number, rY: number, rLargeurBerge: number, rKs: number, rQ: number, rIf: number, rPrec: number, rYB: number) { - super(rY, rLargeurBerge, rKs, rQ, rIf, rPrec, rYB, ComputeNodeType.None); - this._k = new ParamDefinition(CalculatorType.SectionParametree, 'k', new ParamDomain(ParamDomainValue.INTERVAL, 0, 1), rk, ComputeNodeType.SectionPuissance); + super(rY, rLargeurBerge, rKs, rQ, rIf, rPrec, rYB); + this._k = new ParamDefinition(CalculatorType.SectionParametree, 'k', new ParamDomain(ParamDomainValue.INTERVAL, 0, 1), rk); this.addParamDefinition(this._k); } diff --git a/src/section/section_rectang.ts b/src/section/section_rectang.ts index fab309e95583395d5aa7288101215dc286942501..a1bfe2cc17b9ff2a9a8c1dab38e23fa680de0fd3 100644 --- a/src/section/section_rectang.ts +++ b/src/section/section_rectang.ts @@ -1,12 +1,11 @@ import { acSection, ParamsSection } from "./section_type"; -import { ComputeNodeType } from "../param"; import { Result } from "../util/result"; export class ParamsSectionRectang extends ParamsSection { constructor(rY: number, rLargeurFond: number, rKs: number, rQ: number, rIf: number, rPrec: number, rYB: number) { super(rY, rLargeurFond, // LargeurBerge=LargeurFond - rKs, rQ, rIf, rPrec, rYB, ComputeNodeType.SectionRectangle); + rKs, rQ, rIf, rPrec, rYB); } } diff --git a/src/section/section_trapez.ts b/src/section/section_trapez.ts index eb11032649035b779ea86d10f41cf56428cfb6af..1c725ba9d35c153ae4bd852f1c3b2adad493b771 100644 --- a/src/section/section_trapez.ts +++ b/src/section/section_trapez.ts @@ -1,4 +1,4 @@ -import { ComputeNodeType, ParamDefinition, ParamDomainValue, ParamCalculability, CalculatorType } from "../param"; +import { ParamDefinition, ParamDomainValue, ParamCalculability, CalculatorType } from "../param"; import { acSection, ParamsSection } from "./section_type"; import { Result } from "../util/result"; @@ -7,9 +7,9 @@ export class ParamsSectionTrapez extends ParamsSection { private _Fruit: ParamDefinition; // Fruit des berges constructor(rLargeurFond: number, rFruit: number, rY: number, rKs: number, rQ: number, rIf: number, rPrec: number, rYB: number) { - super(rY, undefined, rKs, rQ, rIf, rPrec, rYB, ComputeNodeType.None); - this._LargeurFond = new ParamDefinition(CalculatorType.SectionParametree, 'LargeurFond', ParamDomainValue.POS_NULL, rLargeurFond, ComputeNodeType.SectionTrapeze); - this._Fruit = new ParamDefinition(CalculatorType.SectionParametree, 'Fruit', ParamDomainValue.POS_NULL, rFruit, ComputeNodeType.SectionTrapeze); + super(rY, undefined, rKs, rQ, rIf, rPrec, rYB); + this._LargeurFond = new ParamDefinition(CalculatorType.SectionParametree, 'LargeurFond', ParamDomainValue.POS_NULL, rLargeurFond); + this._Fruit = new ParamDefinition(CalculatorType.SectionParametree, 'Fruit', ParamDomainValue.POS_NULL, rFruit); this.addParamDefinition(this._LargeurFond); this.addParamDefinition(this._Fruit); diff --git a/src/section/section_type.ts b/src/section/section_type.ts index 8bf9b170449992b2f5bcbe024b7c6f6c327f7d0b..35c0a174518439642acdf2aa71657a80314ab43b 100644 --- a/src/section/section_type.ts +++ b/src/section/section_type.ts @@ -1,5 +1,5 @@ import { MessageCode, Message } from "../util/message"; -import { ComputeNodeType, ComputeNode, ParamDefinition, ParamDomainValue, ParamCalculability, ParamsEquation, CalculatorType } from "../param"; +import { ComputeNode, ParamDefinition, ParamDomainValue, ParamCalculability, ParamsEquation, CalculatorType } from "../param"; import { cHautCritique, cHautNormale, cHautCorrespondante, cHautConjuguee } from "./hauteur"; import { Result } from "../util/result"; @@ -87,11 +87,10 @@ export abstract class ParamsSection extends cParamsCanal { rQ: number, rIf: number, rPrec: number, - rYB: number, - nodeType: ComputeNodeType) { + rYB: number) { super(CalculatorType.SectionParametree, rKs, rQ, rIf, rPrec, rYB); - this._Y = new ParamDefinition(CalculatorType.SectionParametree, 'Y', ParamDomainValue.POS_NULL, rY, nodeType); - this._LargeurBerge = new ParamDefinition(CalculatorType.SectionParametree, 'LargeurBerge', ParamDomainValue.POS_NULL, rLargeurBerge, nodeType); + this._Y = new ParamDefinition(CalculatorType.SectionParametree, 'Y', ParamDomainValue.POS_NULL, rY); + this._LargeurBerge = new ParamDefinition(CalculatorType.SectionParametree, 'LargeurBerge', ParamDomainValue.POS_NULL, rLargeurBerge); this.addParamDefinition(this._Y); this.addParamDefinition(this._LargeurBerge); diff --git a/src/structure/parallel_structure_params.ts b/src/structure/parallel_structure_params.ts index 8c03ecf5530537cb2934da0957e07ce6aeae609a..798d75850b98aa07e1b805be864ff9a15ceb8a25 100644 --- a/src/structure/parallel_structure_params.ts +++ b/src/structure/parallel_structure_params.ts @@ -1,5 +1,5 @@ import { Nub } from "../nub"; -import { ComputeNodeType, ParamDefinition, ParamDomainValue, ParamsEquation, CalculatorType } from "../param"; +import { ParamDefinition, ParamDomainValue, ParamsEquation, CalculatorType } from "../param"; /** * Common parameters of hydraulic structure equations diff --git a/src/structure/rectangular_structure_params.ts b/src/structure/rectangular_structure_params.ts index 8eb455bfb7eac65774784670860fbb1642dbbaa3..929e42d0663f8cee3d0ba2cc7b8fa758ddcbdecc 100644 --- a/src/structure/rectangular_structure_params.ts +++ b/src/structure/rectangular_structure_params.ts @@ -1,4 +1,4 @@ -import { ComputeNodeType, ParamCalculability, ParamDefinition, ParamDomainValue, ParamsEquation, CalculatorType } from "../param"; +import { ParamCalculability, ParamDefinition, ParamDomainValue, ParamsEquation, CalculatorType } from "../param"; import { Structure } from "./structure"; import { StructureParams } from "./structure_params"; @@ -25,9 +25,9 @@ export class RectangularStructureParams extends StructureParams { */ constructor(rQ: number, rZDV: number, rZ1: number, rZ2: number, rL: number, rCd: number, rW: number = Infinity) { super(rQ, rZDV, rZ1, rZ2, rW); - this.L = new ParamDefinition(CalculatorType.Structure, "L", ParamDomainValue.POS, rL, ComputeNodeType.StructureRectangle); + this.L = new ParamDefinition(CalculatorType.Structure, "L", ParamDomainValue.POS, rL); this.addParamDefinition(this.L); - this.Cd = new ParamDefinition(CalculatorType.Structure, "Cd", ParamDomainValue.POS, rCd, ComputeNodeType.StructureRectangle); + this.Cd = new ParamDefinition(CalculatorType.Structure, "Cd", ParamDomainValue.POS, rCd); this.addParamDefinition(this.Cd); } } diff --git a/src/structure/structure_params.ts b/src/structure/structure_params.ts index 1e90cb2523f1bf53b2411ba2168f120c6d525acd..f782e0ed447ceec40a282362a54730c83ba2fb14 100644 --- a/src/structure/structure_params.ts +++ b/src/structure/structure_params.ts @@ -1,5 +1,5 @@ import { Nub } from "../nub"; -import { ComputeNodeType, ParamDefinition, ParamDomainValue, ParamsEquation, CalculatorType } from "../param"; +import { ParamDefinition, ParamDomainValue, ParamsEquation, CalculatorType } from "../param"; /** * Common parameters of hydraulic structure equations