UNPKG

jalhyd

Version:

JaLHyd, a Javascript Library for Hydraulics

128 lines 5.41 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ComputeNode = exports.SectionType = exports.CalculatorType = void 0; const base_1 = require("./base"); const internal_modules_1 = require("./internal_modules"); /** * type de calculette */ var CalculatorType; (function (CalculatorType) { CalculatorType[CalculatorType["ConduiteDistributrice"] = 0] = "ConduiteDistributrice"; CalculatorType[CalculatorType["LechaptCalmon"] = 1] = "LechaptCalmon"; CalculatorType[CalculatorType["SectionParametree"] = 2] = "SectionParametree"; CalculatorType[CalculatorType["RegimeUniforme"] = 3] = "RegimeUniforme"; CalculatorType[CalculatorType["CourbeRemous"] = 4] = "CourbeRemous"; CalculatorType[CalculatorType["PabDimensions"] = 5] = "PabDimensions"; CalculatorType[CalculatorType["PabPuissance"] = 6] = "PabPuissance"; CalculatorType[CalculatorType["Structure"] = 7] = "Structure"; CalculatorType[CalculatorType["ParallelStructure"] = 8] = "ParallelStructure"; CalculatorType[CalculatorType["Dever"] = 9] = "Dever"; CalculatorType[CalculatorType["Cloisons"] = 10] = "Cloisons"; CalculatorType[CalculatorType["MacroRugo"] = 11] = "MacroRugo"; CalculatorType[CalculatorType["PabChute"] = 12] = "PabChute"; CalculatorType[CalculatorType["PabNombre"] = 13] = "PabNombre"; CalculatorType[CalculatorType["Section"] = 14] = "Section"; CalculatorType[CalculatorType["Pab"] = 15] = "Pab"; CalculatorType[CalculatorType["CloisonAval"] = 16] = "CloisonAval"; CalculatorType[CalculatorType["MacroRugoCompound"] = 17] = "MacroRugoCompound"; CalculatorType[CalculatorType["Jet"] = 18] = "Jet"; CalculatorType[CalculatorType["Grille"] = 19] = "Grille"; CalculatorType[CalculatorType["Pente"] = 20] = "Pente"; CalculatorType[CalculatorType["Bief"] = 21] = "Bief"; CalculatorType[CalculatorType["Solveur"] = 22] = "Solveur"; CalculatorType[CalculatorType["YAXB"] = 23] = "YAXB"; CalculatorType[CalculatorType["Trigo"] = 24] = "Trigo"; CalculatorType[CalculatorType["SPP"] = 25] = "SPP"; CalculatorType[CalculatorType["YAXN"] = 26] = "YAXN"; CalculatorType[CalculatorType["ConcentrationBlocs"] = 27] = "ConcentrationBlocs"; CalculatorType[CalculatorType["Par"] = 28] = "Par"; CalculatorType[CalculatorType["ParSimulation"] = 29] = "ParSimulation"; CalculatorType[CalculatorType["PreBarrage"] = 30] = "PreBarrage"; CalculatorType[CalculatorType["PbCloison"] = 31] = "PbCloison"; CalculatorType[CalculatorType["PbBassin"] = 32] = "PbBassin"; CalculatorType[CalculatorType["Espece"] = 33] = "Espece"; CalculatorType[CalculatorType["Verificateur"] = 34] = "Verificateur"; CalculatorType[CalculatorType["PressureLoss"] = 35] = "PressureLoss"; CalculatorType[CalculatorType["PressureLossLaw"] = 36] = "PressureLossLaw"; CalculatorType[CalculatorType["MacrorugoRemous"] = 37] = "MacrorugoRemous"; CalculatorType[CalculatorType["RugoFondMultiple"] = 38] = "RugoFondMultiple"; // Passe à rugosité de fond multiple })(CalculatorType = exports.CalculatorType || (exports.CalculatorType = {})); /** types de sections */ var SectionType; (function (SectionType) { SectionType[SectionType["SectionCercle"] = 0] = "SectionCercle"; SectionType[SectionType["SectionRectangle"] = 1] = "SectionRectangle"; SectionType[SectionType["SectionTrapeze"] = 2] = "SectionTrapeze"; SectionType[SectionType["SectionPuissance"] = 3] = "SectionPuissance"; })(SectionType = exports.SectionType || (exports.SectionType = {})); /** * noeud de calcul */ class ComputeNode extends internal_modules_1.JalhydObject { constructor(prms, dbg = false) { super(); this._debug = new base_1.Debug(dbg); this._prms = prms; this.debug("PARAMS", prms); // important for Param uid this._prms.parent = this; this.setParametersCalculability(); this.exposeResults(); } get prms() { return this._prms; } /** * Retrieves a parameter from its symbol (unique in a given Nub) * @WARNING also retrieves **extra results** and returns them as ParamDefinition ! */ getParameter(name) { for (const p of this.parameterIterator) { if (p.symbol === name) { return p; } } return undefined; } getFirstAnalyticalParameter() { for (const p of this.parameterIterator) { if (p.isAnalytical()) { return p; } } return undefined; } /** * Returns an iterator over own parameters (this._prms) */ get parameterIterator() { return this._prms.iterator; } // interface IDebug debug(...args) { this._debug.debug(...args); } get DBG() { return this._debug.DBG; } set DBG(d) { this._debug.DBG = d; } /** * Define ParamFamily (@see ParamDefinition) for extra results; also * used to declare extra results that are not linkable but may be * used by Solveur : set family to undefined */ exposeResults() { this._resultsFamilies = {}; } get resultsFamilies() { return this._resultsFamilies; } static resultsUnits() { return {}; } } exports.ComputeNode = ComputeNode; //# sourceMappingURL=compute-node.js.map