Commit 7e30dcb8 authored by Grand Francois's avatar Grand Francois
Browse files

refactor: CloisonAval: do not check submergence error for vanne levante structures

refs #302
Showing with 52 additions and 10 deletions
+52 -10
......@@ -74,7 +74,9 @@ export class CloisonAval extends ParallelStructure {
}
if (!this.hasVanneLevante() || this.result.ok) {
// Calculation of Z1 with the new ZDV in case of existing vanne levante
this._doVanLevSubmergenceCheck = false;
this.currentResultElement = super.Calc("Z1", rInit);
this._doVanLevSubmergenceCheck = true;
if (this.result.ok) {
this.getParameter(sVarCalc).v = this.result.vCalc;
// Recalcul du débit total pour récupérer les résultats des ouvrages dans les résultats complémentaires
......
......@@ -16,9 +16,17 @@ import { MessageCode, Message } from "../internal_modules";
*/
export class ParallelStructure extends Nub {
/**
* false pour inihiber le test d'erreur d'ennoiement dans les vannes levantes
* @see checkSubmergence
* @see checkSubmergenceMin
*/
protected _doVanLevSubmergenceCheck: boolean;
constructor(prms: ParamsEquation, dbg: boolean = false) {
super(prms, dbg);
this.setCalculatorType(CalculatorType.ParallelStructure);
this._doVanLevSubmergenceCheck = true;
}
/** children casting */
......@@ -40,6 +48,10 @@ export class ParallelStructure extends Nub {
return this._prms as ParallelStructureParams;
}
public get doVanLevSubmergenceCheck(): boolean {
return this._doVanLevSubmergenceCheck;
}
/** Returns admissible LoiDebit grouped by StructureType */
public getLoisAdmissibles(): { [key: string]: LoiDebit[]; } {
return loiAdmissiblesOuvrages;
......
......@@ -81,16 +81,22 @@ export abstract class Structure extends ChildNub {
* méthode générique de vérification que l'ennoiement est supérieur à une valeur donnée
* @param min valeur minimum de l'ennoiement
*/
protected checkSubmergenceMin(min: number) {
const h2h1ratio = this.prms.h2.v / this.prms.h1.v;
if (h2h1ratio < min) {
this._result.resultElement.addMessage(new Message(
MessageCode.ERROR_STRUCTURE_SUBMERGENCE_LOWER_THAN,
{
submergencePerc: this.computeSubmergencePercentage().toString(),
min: min * 100
}
));
protected checkSubmergenceMin(res: Result, min: number) {
// on fait le test soit :
// - si cette structure n'est pas une vanne levante
// - si cette structure est une vanne levante et le flag d'autorisation du test est vrai
if (!this.isVanneLevante || this.doVanLevSubmergenceCheck) {
const h2h1ratio = this.prms.h2.v / this.prms.h1.v;
if (h2h1ratio < min) {
res.resultElement.addMessage(new Message(
// this._result.globalLog.add(new Message(
MessageCode.ERROR_STRUCTURE_SUBMERGENCE_LOWER_THAN,
{
submergencePerc: this.computeSubmergencePercentage().toString(),
min: min * 100
}
));
}
}
}
......@@ -119,6 +125,20 @@ export abstract class Structure extends ChildNub {
this._intlType = "Ouvrage";
}
public get doVanLevSubmergenceCheck(): boolean {
const ps = this.parent as ParallelStructure;
return ps.doVanLevSubmergenceCheck;
}
/**
* true si la structure est une vanne levante
* @see StructureVanLevLarinier
* @see StructureVanLevVillemonte
*/
protected get isVanneLevante(): boolean {
return false;
}
public get isZDVcalculable(): boolean {
return this._isZDVcalculable;
}
......
......@@ -15,4 +15,8 @@ export class StructureVanLevLarinier extends StructureWeirSubmergedLarinier {
get prms(): StructureVanLevParams {
return this._prms as StructureVanLevParams;
}
protected get isVanneLevante(): boolean {
return true;
}
}
......@@ -15,4 +15,8 @@ export class StructureVanLevVillemonte extends StructureWeirVillemonte {
get prms(): StructureVanLevParams {
return this._prms as StructureVanLevParams;
}
protected get isVanneLevante(): boolean {
return true;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment