Commit 2758bec5 authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

Update admissible laws for PbCloisons

Showing with 12 additions and 3 deletions
+12 -3
......@@ -4,6 +4,7 @@ import { PreBarrage } from "./pre_barrage";
import { ParallelStructureParams } from "../structure/parallel_structure_params";
import { CalculatorType } from "../compute-node";
import { Result } from "../util/result";
import { LoiDebit, loiAdmissiblesOuvrages } from "../structure/structure_props";
export class PbCloison extends ParallelStructure {
......@@ -94,4 +95,8 @@ export class PbCloison extends ParallelStructure {
}
return minZDV;
}
public getLoisAdmissibles(): { [key: string]: LoiDebit[]; } {
return loiAdmissiblesOuvrages; // @TODO loiAdmissiblesCloisons plutôt, mais penser à y intégrer Cunge80
}
}
......@@ -5,7 +5,8 @@ import { Props } from "../props";
import { Message, MessageCode } from "../util/message";
import { Result } from "../util/result";
import { StructureParams } from "./structure_params";
import { LoiDebit } from "./structure_props";
import { LoiDebit, StructureProperties } from "./structure_props";
import { ParallelStructure } from "./parallel_structure";
/**
* Flow mode: weir or orifice flow
......@@ -75,11 +76,14 @@ export abstract class Structure extends ChildNub {
/** Returns Props object (observable set of key-values) associated to this Nub */
public get properties(): Props {
// completes props with calcType and loiDebit if not already set
// completes props with calcType, structureType and loiDebit if not already set
this._props.setPropValue("calcType", this.calcType);
if (this._props.getPropValue("loiDebit") === undefined) {
this._props.setPropValue("loiDebit", this._loiDebit);
}
if (this._props.getPropValue("structureType") === undefined) {
this._props.setPropValue("structureType", StructureProperties.findCompatibleStructure(this._props.getPropValue("loiDebit"), this.parent as ParallelStructure));
}
return this._props;
}
......
......@@ -134,7 +134,7 @@ export class StructureProperties {
/**
* @return la 1ère valeur de StructureType compatible avec la loi de débit, dans le contexte
* du module de calcul parentNub
* du module de calcul parentNub @TODO la 1ère ? normalement il n'y en a qu'une !
*/
public static findCompatibleStructure(loi: LoiDebit, parentNub: ParallelStructure): StructureType {
const loisAdmissibles = parentNub.getLoisAdmissibles();
......
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