Commit 66a1df6e authored by Mathias Chouet's avatar Mathias Chouet :spaghetti:
Browse files

Fix #298 - update CourbeRemous for jalhyd#146

Showing with 46 additions and 20 deletions
+46 -20
...@@ -27,8 +27,9 @@ ...@@ -27,8 +27,9 @@
"fields": [ "fields": [
"Ks", "Ks",
"Long", "Long",
"If", "YB",
"YB" "ZF1",
"ZF2"
] ]
}, },
{ {
...@@ -36,8 +37,8 @@ ...@@ -36,8 +37,8 @@
"type": "fieldset", "type": "fieldset",
"fields": [ "fields": [
"Q", "Q",
"Yaval", "Z1",
"Yamont" "Z2"
] ]
}, },
{ {
......
...@@ -14,17 +14,19 @@ ...@@ -14,17 +14,19 @@
"LargeurBerge": "Width at embankment level", "LargeurBerge": "Width at embankment level",
"fs_bief": "Features reach", "fs_bief": "Features reach",
"Ks": "Strickler coefficient", "Ks": "Strickler coefficient",
"Hs": "Head",
"Long": "Length of reach", "Long": "Length of reach",
"If": "Bottom slope",
"YB": "Embankment elevation", "YB": "Embankment elevation",
"fs_condlim": "Boundary conditions", "fs_condlim": "Boundary conditions",
"Q": "Upstream flow", "Q": "Upstream flow",
"S": "Wet surface", "S": "Wet surface",
"Yaval": "Water level imposed at downstream",
"Yamont": "Water level imposed at upstream",
"fs_param_calc": "Calculation parameters", "fs_param_calc": "Calculation parameters",
"Dx": "Discretisation step", "Dx": "Discretisation step",
"select_resolution": "Resolution method", "select_resolution": "Resolution method",
"Z1": "Upstream water elevation",
"Z2": "Downstream water elevation",
"ZF1": "Upstream bottom elevation",
"ZF2": "Downstream bottom elevation",
"UNIT_FLU": "m", "UNIT_FLU": "m",
"UNIT_HS": "m", "UNIT_HS": "m",
...@@ -48,7 +50,7 @@ ...@@ -48,7 +50,7 @@
"fs_target_data": "Data to compute", "fs_target_data": "Data to compute",
"select_target": "Choice of the data to compute", "select_target": "Choice of the data to compute",
"select_target_none": "None", "select_target_none": "None",
"select_target_Hs": "Specific head (m)", "select_target_Hs": "Head (m)",
"select_target_Hsc": "Critical head (m)", "select_target_Hsc": "Critical head (m)",
"select_target_B": "Surface width (m)", "select_target_B": "Surface width (m)",
"select_target_P": "Wetted perimeter (m)", "select_target_P": "Wetted perimeter (m)",
......
...@@ -14,16 +14,18 @@ ...@@ -14,16 +14,18 @@
"LargeurBerge": "Largeur de berge", "LargeurBerge": "Largeur de berge",
"fs_bief": "Caractéristiques du bief", "fs_bief": "Caractéristiques du bief",
"Ks": "Coefficient de Strickler", "Ks": "Coefficient de Strickler",
"Hs": "Charge",
"Long": "Longueur du bief", "Long": "Longueur du bief",
"If": "Pente du fond",
"YB": "Hauteur de berge", "YB": "Hauteur de berge",
"fs_condlim": "Conditions aux limites", "fs_condlim": "Conditions aux limites",
"Q": "Débit amont", "Q": "Débit amont",
"S": "Surface mouillée", "S": "Surface mouillée",
"Yaval": "Tirant d'eau imposé à l'aval",
"Yamont": "Tirant d'eau imposé à l'amont",
"Dx": "Pas de discrétisation", "Dx": "Pas de discrétisation",
"select_resolution": "Méthode de résolution", "select_resolution": "Méthode de résolution",
"Z1": "Cote de l'eau à l'amont",
"Z2": "Cote de l'eau à l'aval",
"ZF1": "Cote du fond à l'amont",
"ZF2": "Cote du fond à l'aval",
"UNIT_FLU": "m", "UNIT_FLU": "m",
"UNIT_HS": "m", "UNIT_HS": "m",
...@@ -47,7 +49,7 @@ ...@@ -47,7 +49,7 @@
"fs_target_data": "Donnée à calculer", "fs_target_data": "Donnée à calculer",
"select_target": "Choix de la donnée à calculer", "select_target": "Choix de la donnée à calculer",
"select_target_none": "Aucune", "select_target_none": "Aucune",
"select_target_Hs": "La charge spécifique (m)", "select_target_Hs": "La charge (m)",
"select_target_Hsc": "La charge critique (m)", "select_target_Hsc": "La charge critique (m)",
"select_target_B": "La largeur au miroir (m)", "select_target_B": "La largeur au miroir (m)",
"select_target_P": "Le périmètre mouillé (m)", "select_target_P": "Le périmètre mouillé (m)",
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
"Q": "Flow", "Q": "Flow",
"Y": "Draft", "Y": "Draft",
"fs_param_calc": "Calculation parameters", "fs_param_calc": "Calculation parameters",
"Hs": "Specific cahrge", "Hs": "Specific head",
"Hsc": "Critical charge", "Hsc": "Critical head",
"B": "Width at mirror", "B": "Width at mirror",
"P": "Wet perimeter", "P": "Wet perimeter",
"S": "Wet surface", "S": "Wet surface",
......
import { Component, ViewChild, DoCheck } from "@angular/core"; import { Component, ViewChild, DoCheck } from "@angular/core";
import { ArrayReverseIterator, ResultElement, INumberIterator } from "jalhyd"; import { ArrayReverseIterator, ResultElement, INumberIterator, CourbeRemousParams, CourbeRemous } from "jalhyd";
import { I18nService } from "../../services/internationalisation.service"; import { I18nService } from "../../services/internationalisation.service";
import { LogComponent } from "../../components/log/log.component"; import { LogComponent } from "../../components/log/log.component";
...@@ -165,6 +165,20 @@ class ChartData { ...@@ -165,6 +165,20 @@ class ChartData {
}; };
} }
/**
* Dessigne une ligne droite entre y0 (abscisse 0) et ymax (abscisse max),
* sans passer par les méthodes mapPoint() et mapY() utilisées dans drawLine
*/
public drawSimpleLine(y0: number, ymax: number, prof: number, color: string, lbl: string, fillColor?: string) {
const l = this.newLine(prof);
l.setPoint(0, y0);
l.setPoint(this._longBief, ymax);
l.data = {
label: lbl, fill: fillColor !== undefined, tension: 0, spanGaps: true,
borderColor: color, backgroundColor: fillColor, pointRadius: 0
};
}
public get data() { public get data() {
const ds = []; const ds = [];
this._lines.sort((a, b) => { this._lines.sort((a, b) => {
...@@ -452,6 +466,11 @@ export class RemousResultsComponent extends ResultsComponent implements DoCheck ...@@ -452,6 +466,11 @@ export class RemousResultsComponent extends ResultsComponent implements DoCheck
this.varResultsComponent.results = this._remousResults.varResults; this.varResultsComponent.results = this._remousResults.varResults;
} }
const nub = this._remousResults.result.sourceNub as CourbeRemous;
const params = nub.prms as CourbeRemousParams;
const ZF1 = params.ZF1.singleValue;
const ZF2 = params.ZF2.singleValue;
const hauteurBerge = nub.section.prms.YB.singleValue;
const penteFond: number = this._remousResults.penteFond; const penteFond: number = this._remousResults.penteFond;
// abscisses // abscisses
...@@ -480,23 +499,25 @@ export class RemousResultsComponent extends ResultsComponent implements DoCheck ...@@ -480,23 +499,25 @@ export class RemousResultsComponent extends ResultsComponent implements DoCheck
} }
// ligne de fond // ligne de fond
gr1.drawLine(0, 0, 3, "#753F00", this.uitextFond, "#753F00"); gr1.drawSimpleLine(ZF1, ZF2, 3, "#753F00", this.uitextFond, "#753F00");
// ligne de berge // ligne de berge
if (this._remousResults.hautBerge) { if (hauteurBerge) {
gr1.drawLine(this._remousResults.hautBerge, this._remousResults.hautBerge, 4, "#C58F50", this.uitextBerge); gr1.drawSimpleLine(ZF1 + hauteurBerge, ZF2 + hauteurBerge, 4, "#C58F50", this.uitextBerge);
} }
// hauteur normale // hauteur normale
if (this._remousResults.hautNormale !== undefined && this._remousResults.hautNormale.ok) { if (this._remousResults.hautNormale !== undefined && this._remousResults.hautNormale.ok) {
gr1.drawLine(this._remousResults.hautNormale.vCalc, this._remousResults.hautNormale.vCalc, const Yn = this._remousResults.hautNormale.vCalc;
gr1.drawSimpleLine(Yn + ZF1, Yn + ZF2,
5, "#A4C537", this.uitextTirantNormal 5, "#A4C537", this.uitextTirantNormal
); );
} }
// hauteur critique // hauteur critique
if (this._remousResults.hautCritique !== undefined && this._remousResults.hautCritique.ok) { if (this._remousResults.hautCritique !== undefined && this._remousResults.hautCritique.ok) {
gr1.drawLine(this._remousResults.hautCritique.vCalc, this._remousResults.hautCritique.vCalc, const Yc = this._remousResults.hautCritique.vCalc;
gr1.drawLine(Yc + ZF1, Yc + ZF2,
6, "#FF0000", this.uitextTirantCritique 6, "#FF0000", this.uitextTirantCritique
); );
} }
......
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