UNPKG

jalhyd

Version:

JaLHyd, a Javascript Library for Hydraulics

41 lines 1.79 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getNubResultUnit = void 0; const compute_node_1 = require("./compute-node"); const index_1 = require("./index"); const internal_modules_1 = require("./internal_modules"); /** * correspondance type de calculette - classe de Nub */ const nubClasses = new Map([ [compute_node_1.CalculatorType.Grille, index_1.Grille], [compute_node_1.CalculatorType.ConcentrationBlocs, index_1.ConcentrationBlocs], [compute_node_1.CalculatorType.Jet, index_1.Jet], [compute_node_1.CalculatorType.MacroRugo, index_1.MacroRugo], [compute_node_1.CalculatorType.RegimeUniforme, index_1.RegimeUniforme], [compute_node_1.CalculatorType.Cloisons, index_1.Cloisons], [compute_node_1.CalculatorType.PabNombre, index_1.PabNombre], [compute_node_1.CalculatorType.Par, index_1.Par], [compute_node_1.CalculatorType.ParSimulation, index_1.ParSimulation], [compute_node_1.CalculatorType.Dever, index_1.Dever], [compute_node_1.CalculatorType.PressureLoss, internal_modules_1.PressureLoss], [compute_node_1.CalculatorType.RugoFondMultiple, internal_modules_1.RugoFondMultiple], [compute_node_1.CalculatorType.MacroRugoCompound, index_1.MacrorugoCompound], ]); /** * détermine l'unité d'un paramètre de résultat * @param nubType Nub contenant le paramètre de résultat * @param symbol symbole du paramètre * @returns unité du paramètre */ function getNubResultUnit(nubType, symbol) { const cl = nubClasses.get(nubType); if (cl !== undefined && "resultsUnits" in cl) { const f = cl.resultsUnits; const units = f(); return units[symbol]; } return undefined; } exports.getNubResultUnit = getNubResultUnit; //# sourceMappingURL=units.js.map