diff --git a/src/app/calculators/remous/remous.config.json b/src/app/calculators/remous/remous.config.json index 2e0c26fc12efa3f382c2b77e0b16c9cc1bee0752..5abc2662d643c4e80977e7bb0856c11c3d25993c 100644 --- a/src/app/calculators/remous/remous.config.json +++ b/src/app/calculators/remous/remous.config.json @@ -27,8 +27,9 @@ "fields": [ "Ks", "Long", - "If", - "YB" + "YB", + "ZF1", + "ZF2" ] }, { @@ -36,8 +37,8 @@ "type": "fieldset", "fields": [ "Q", - "Yaval", - "Yamont" + "Z1", + "Z2" ] }, { diff --git a/src/app/calculators/remous/remous.en.json b/src/app/calculators/remous/remous.en.json index fadadf72f0ebf7c16258cb8e2725e3394c9abd4e..39ad2d88e3ff517beb05011e0e83d945a02042fe 100644 --- a/src/app/calculators/remous/remous.en.json +++ b/src/app/calculators/remous/remous.en.json @@ -14,17 +14,19 @@ "LargeurBerge": "Width at embankment level", "fs_bief": "Features reach", "Ks": "Strickler coefficient", + "Hs": "Head", "Long": "Length of reach", - "If": "Bottom slope", "YB": "Embankment elevation", "fs_condlim": "Boundary conditions", "Q": "Upstream flow", "S": "Wet surface", - "Yaval": "Water level imposed at downstream", - "Yamont": "Water level imposed at upstream", "fs_param_calc": "Calculation parameters", "Dx": "Discretisation step", "select_resolution": "Resolution method", + "Z1": "Upstream water elevation", + "Z2": "Downstream water elevation", + "ZF1": "Upstream bottom elevation", + "ZF2": "Downstream bottom elevation", "UNIT_FLU": "m", "UNIT_HS": "m", @@ -48,7 +50,7 @@ "fs_target_data": "Data to compute", "select_target": "Choice of the data to compute", "select_target_none": "None", - "select_target_Hs": "Specific head (m)", + "select_target_Hs": "Head (m)", "select_target_Hsc": "Critical head (m)", "select_target_B": "Surface width (m)", "select_target_P": "Wetted perimeter (m)", diff --git a/src/app/calculators/remous/remous.fr.json b/src/app/calculators/remous/remous.fr.json index ed9116978b353c4e710cc629faaa181fda1e5593..6c6d61121e0bf756d89b8dc2f5530fa3747d3e1e 100644 --- a/src/app/calculators/remous/remous.fr.json +++ b/src/app/calculators/remous/remous.fr.json @@ -14,16 +14,18 @@ "LargeurBerge": "Largeur de berge", "fs_bief": "Caractéristiques du bief", "Ks": "Coefficient de Strickler", + "Hs": "Charge", "Long": "Longueur du bief", - "If": "Pente du fond", "YB": "Hauteur de berge", "fs_condlim": "Conditions aux limites", "Q": "Débit amont", "S": "Surface mouillée", - "Yaval": "Tirant d'eau imposé à l'aval", - "Yamont": "Tirant d'eau imposé à l'amont", "Dx": "Pas de discrétisation", "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_HS": "m", @@ -47,7 +49,7 @@ "fs_target_data": "Donnée à calculer", "select_target": "Choix de la donnée à calculer", "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_B": "La largeur au miroir (m)", "select_target_P": "Le périmètre mouillé (m)", diff --git a/src/app/calculators/section-param/section-param.en.json b/src/app/calculators/section-param/section-param.en.json index 09723fabfc1197facf051bcd018377a3f9fc6b49..915cdb5055cb5218113354b196c051f533179875 100644 --- a/src/app/calculators/section-param/section-param.en.json +++ b/src/app/calculators/section-param/section-param.en.json @@ -20,8 +20,8 @@ "Q": "Flow", "Y": "Draft", "fs_param_calc": "Calculation parameters", - "Hs": "Specific cahrge", - "Hsc": "Critical charge", + "Hs": "Specific head", + "Hsc": "Critical head", "B": "Width at mirror", "P": "Wet perimeter", "S": "Wet surface", diff --git a/src/app/components/remous-results/remous-results.component.ts b/src/app/components/remous-results/remous-results.component.ts index bed67125d94dd8488c4e38f4d71075618a553633..b3d4a751e9381f3193d755638cb3fb0336294d4e 100644 --- a/src/app/components/remous-results/remous-results.component.ts +++ b/src/app/components/remous-results/remous-results.component.ts @@ -1,6 +1,6 @@ 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 { LogComponent } from "../../components/log/log.component"; @@ -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() { const ds = []; this._lines.sort((a, b) => { @@ -452,6 +466,11 @@ export class RemousResultsComponent extends ResultsComponent implements DoCheck 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; // abscisses @@ -480,23 +499,25 @@ export class RemousResultsComponent extends ResultsComponent implements DoCheck } // ligne de fond - gr1.drawLine(0, 0, 3, "#753F00", this.uitextFond, "#753F00"); + gr1.drawSimpleLine(ZF1, ZF2, 3, "#753F00", this.uitextFond, "#753F00"); // ligne de berge - if (this._remousResults.hautBerge) { - gr1.drawLine(this._remousResults.hautBerge, this._remousResults.hautBerge, 4, "#C58F50", this.uitextBerge); + if (hauteurBerge) { + gr1.drawSimpleLine(ZF1 + hauteurBerge, ZF2 + hauteurBerge, 4, "#C58F50", this.uitextBerge); } // hauteur normale 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 ); } // hauteur critique 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 ); }