An error occurred while loading the file. Please try again.
-
Grand Francois authored
refactor: add checks to Props.setPropValue(), Structure.updateStructureType() and Structure.setLoiDebit() (undefined parameters) refs #328
96169f54
import { ChildNub } from "../child_nub";
import { CalculatorType } from "../compute-node";
import { ParamCalculability, ParamDefinition, ParamFamily } from "../param/param-definition";
import { Props } from "../props";
import { Message, MessageCode } from "../util/message";
import { Result } from "../util/result";
import { StructureParams } from "./structure_params";
import { LoiDebit, StructureProperties } from "./structure_props";
import { ParallelStructure } from "./parallel_structure";
import { round } from "../base";
import { Nub } from "../nub";
/**
* Flow mode: weir or orifice flow
*/
export enum StructureFlowMode {
/** Weir flow */
WEIR,
/** Orifice flow */
ORIFICE,
/** Zéro flow */
NULL
}
/**
* Flow regime: free flow, partially submerged or submerged
*/
export enum StructureFlowRegime {
/** Free flow (unsubmerged) */
FREE,
/** Partially submerged flow */
PARTIAL,
/** Submerged flow */
SUBMERGED,
/** Zéro flow */
NULL
}
/** Type de jet : Sans objet (orifice), plongeant, de surface */
export enum StructureJetType {
/** Plongeant */
PLONGEANT,
/** De surface */
SURFACE,
/** Sans objet (orifice) */
SO
}
/**
* classe de calcul sur la conduite distributrice
*/
export abstract class Structure extends ChildNub {
/**
* Test générique si VarCalc="Q" pour l'utilisation de Equation
*/
public static CheckEquation(sVarCalc: string) {
if (sVarCalc !== "Q") { throw new Error("Structure.Equation() : invalid parameter name " + sVarCalc); }
}
/**
* calcul du pourcentage d'ennoiement arrondi à l'unité
*/
public computeSubmergencePercentage(H2?: number): number {
const h1 = this._prms.get("h1").v;
const h2 = H2 === undefined ? this._prms.get("h2").v : H2;
return Structure.computeSubmergencePercentage(h1, h2);
}
/**