Skip to content
Snippets Groups Projects
Commit e988eea8 authored by Mathias Chouet's avatar Mathias Chouet Committed by mathias.chouet
Browse files

Add new example: PreBarrage

parent 31b70944
No related branches found
No related tags found
1 merge request!93Resolve "Ajout du module Prébarrage"
......@@ -268,6 +268,10 @@ export class CalculatorListComponent implements OnInit {
{
label: this.intlService.localizeText("INFO_EXAMPLE_LABEL_PERR"),
path: "perr.json"
},
{
label: this.intlService.localizeText("INFO_EXAMPLE_LABEL_PB"),
path: "prebarrage.json"
}
];
}
......
......@@ -131,19 +131,6 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni
});
}
// debug
private createStructure(l: LoiDebit, v: number[]): Structure {
const s: Structure = CreateStructure(l);
s.prms.Q.singleValue = v[0];
s.prms.ZDV.singleValue = v[1];
s.prms.Z1.singleValue = v[2];
s.prms.Z2.singleValue = v[3];
s.getParameter("L").singleValue = v[4];
s.getParameter("CdGR").singleValue = v[5];
s.prms.W.singleValue = v[6];
return s;
}
/**
* Builds a Mermaid graph text definition, using Nodes
* to represent basins as well as walls; sorts connexions
......@@ -163,111 +150,6 @@ export class PbSchemaComponent implements AfterViewInit, AfterContentInit, OnIni
def.push("classDef basin fill:#e0f3fb,stroke:#003A80;"); // irstea-ocean 50 / 500
def.push("classDef node-highlighted fill:#4DBBE9;"); // irstea-ocean (material "accent"), 300
// debug
if (this.model.children.length === 0) {
// EXEMPLE 1 (petit)
/* const b1 = new PbBassin(new PbBassinParams(0.1, 42));
this.model.addChild(b1);
const b2 = new PbBassin(new PbBassinParams(0.15, 38));
this.model.addChild(b2);
this.model.addChild(new PbCloison(undefined, b1));
this.model.addChild(new PbCloison(b1, b2));
this.model.addChild(new PbCloison(b2, undefined));
this.model.addChild(new PbCloison(b1, undefined)); */
// EXEMPLE 2 (grand)
this.model.addChild(new PbBassin(new PbBassinParams(13.80, 95)));
this.model.addChild(new PbBassin(new PbBassinParams(15.40, 94.70)));
this.model.addChild(new PbBassin(new PbBassinParams(16.20, 94.70)));
this.model.addChild(new PbBassin(new PbBassinParams(17.50, 94.40)));
this.model.addChild(new PbBassin(new PbBassinParams(32.10, 94.25)));
this.model.addChild(new PbBassin(new PbBassinParams(35.00, 94.10)));
this.model.addChild(new PbCloison(undefined, this.model.children[0] as PbBassin));
// Session.getInstance().createNub(p, this.currentNub as ParallelStructure) as Structure
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 95.30, 0, 0, 0.4, 1.04 ])
);
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 96.25, 0, 0, 4.40, 1.04 ])
);
// Wall between upstream and basin 2
this.model.addChild(new PbCloison(undefined, this.model.children[1] as PbBassin));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 96.00, 0, 0, 1.00, 1.04 ])
);
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 96.25, 0, 0, 5.00, 0.91 ])
);
// Wall between upstream and basin 5
this.model.addChild(new PbCloison(undefined, this.model.children[4] as PbBassin));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 96.25, 0, 0, 3.50, 0.99 ])
);
// Wall between upstream and basin 6
this.model.addChild(new PbCloison(undefined, this.model.children[5] as PbBassin));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 96.25, 0, 0, 3.60, 0.99 ])
);
// Wall between basin 1 & 3
this.model.addChild(new PbCloison(this.model.children[0] as PbBassin, this.model.children[2] as PbBassin));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 95.00, 0, 0, 0.40, 1.04 ])
);
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 96.25, 0, 0, 5.20, 0.99 ])
);
// Wall between basin 2 & 3
this.model.addChild(new PbCloison(this.model.children[1] as PbBassin, this.model.children[2] as PbBassin));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 95.85, 0, 0, 4.38, 0.91 ])
);
// Wall between basin 2 & 4
this.model.addChild(new PbCloison(this.model.children[1] as PbBassin, this.model.children[3] as PbBassin));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 95.85, 0, 0, 3.00, 0.99 ])
);
// Wall between basin 2 & 5
this.model.addChild(new PbCloison(this.model.children[1] as PbBassin, this.model.children[4] as PbBassin));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 95.50, 0, 0, 1.00, 1.04 ])
);
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 95.75, 0, 0, 3.00, 0.99 ])
);
// Wall between basin 3 & 4
this.model.addChild(new PbCloison(this.model.children[2] as PbBassin, this.model.children[3] as PbBassin));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 94.70, 0, 0, 0.40, 1.04 ])
);
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 95.65, 0, 0, 5.74, 0.99 ])
);
// Wall between basin 4 & 5
this.model.addChild(new PbCloison(this.model.children[3] as PbBassin, this.model.children[4] as PbBassin));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 94.40, 0, 0, 0.40, 1.04 ])
);
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 95.35, 0, 0, 6.00, 0.99 ])
);
// Wall between basin 5 & 6
this.model.addChild(new PbCloison(this.model.children[4] as PbBassin, this.model.children[5] as PbBassin));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 94.25, 0, 0, 0.70, 1.04 ])
);
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 95.05, 0, 0, 9.50, 0.99 ])
);
// Wall between basin 6 & downstream
this.model.addChild(new PbCloison(this.model.children[5] as PbBassin, undefined));
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 94.10, 0, 0, 0.95, 1.04 ])
);
this.model.children[this.model.children.length - 1].addChild(
this.createStructure(LoiDebit.WeirCunge80, [ 0, 94.75, 0, 0, 10.20, 0.99 ])
);
}
const sortedWalls: PbCloison[] = [];
for (const c of this.model.children) {
if (c instanceof PbBassin) {
......
This diff is collapsed.
......@@ -610,6 +610,7 @@
"INFO_EXAMPLE_LABEL_PAB_COMPLETE": "Standard fish ladder",
"INFO_EXAMPLE_LABEL_PAB_ECH_TRIANG": "Triangular weirs fish ladder",
"INFO_EXAMPLE_LABEL_PENTE_CRITIQUE_CANAL": "Canal critical slope",
"INFO_EXAMPLE_LABEL_PB": "Pre-dam",
"INFO_EXAMPLE_LABEL_PERR": "Rock-ramp fish pass",
"INFO_EXAMPLE_LABEL_WEIR_JET_LENGTH": "Weir jet length",
"INFO_EXAMPLES_TITLE": "Examples",
......
......@@ -611,6 +611,7 @@
"INFO_EXAMPLE_LABEL_PAB_COMPLETE": "Passe à bassins type",
"INFO_EXAMPLE_LABEL_PAB_ECH_TRIANG": "Passe à bassins à échancrures triangulaires",
"INFO_EXAMPLE_LABEL_PENTE_CRITIQUE_CANAL": "Pente critique d'un canal",
"INFO_EXAMPLE_LABEL_PB": "Pré-barrage",
"INFO_EXAMPLE_LABEL_PERR": "Passe à enrochements régulièrement répartis",
"INFO_EXAMPLE_LABEL_WEIR_JET_LENGTH": "Longueur de jet d'un déversoir",
"INFO_EXAMPLES_TITLE": "Exemples",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment