diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index af628beb20ce721ffc5427dc169bd9201ad789d0..8868651a1eb5ed9a3e3c4ca0de8f4d91f7a7e5e1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ stages: - releases-version default: - tags: [docker] + tags: [test] image: $CI_REGISTRY/cassiopee/nghyd:latest variables: diff --git a/jalhyd_branch b/jalhyd_branch index aa60e2b3f3308f3fdeb4e42b5b0db8b42cf17299..80cbb4eb0efe0208767fb879bb254f008c246b69 100644 --- a/jalhyd_branch +++ b/jalhyd_branch @@ -1 +1 @@ -340-ajout-de-la-passe-a-rugosite-de-fond +370-ajout-de-la-passe-a-rugosite-de-fond-cas-d-un-radier-incline diff --git a/src/app/calculators/macrorugocompound/config.json b/src/app/calculators/macrorugocompound/config.json index 79290dc661b94b9a3a9ed20ba698c467b6f8b728..cea0b83b54e3a0d7af8faf18acbcebdfbaff4780 100644 --- a/src/app/calculators/macrorugocompound/config.json +++ b/src/app/calculators/macrorugocompound/config.json @@ -47,11 +47,11 @@ "property": "inclinedApron" }, { - "id": "ZRR", + "id": "ZRT", "help": "pam/macrorugo.html#rugosite-de-fond" }, { - "id": "ZRL", + "id": "ZRB", "help": "pam/macrorugo.html#rugosite-de-fond" }, "BR" diff --git a/src/app/calculators/macrorugocompound/en.json b/src/app/calculators/macrorugocompound/en.json index 502bbb5804a80eef573a781b5d0388ad76c21bbe..74a0abf8977009c3f67e409db6174682f5d1b431 100644 --- a/src/app/calculators/macrorugocompound/en.json +++ b/src/app/calculators/macrorugocompound/en.json @@ -13,8 +13,8 @@ "PBD": "Diameter", "PBH": "Height", "Cd0": "Shape (1 for round, 2 for square)", - "ZRL": "Upper upstream ramp bottom elevation", - "ZRR": "Lower upstream ramp bottom elevation", + "ZRB": "Lower upstream ramp bottom elevation", + "ZRT": "Upper upstream ramp bottom elevation", "BR": "Total width", "ZF1": "Upstream ramp bottom elevation", "B": "Width", diff --git a/src/app/calculators/macrorugocompound/fr.json b/src/app/calculators/macrorugocompound/fr.json index 08b69103fd6a17fcb54c0ac34cb3cd45823468e7..642bdf907ef8e31a78b6fd0fee098dba84ffd1fa 100644 --- a/src/app/calculators/macrorugocompound/fr.json +++ b/src/app/calculators/macrorugocompound/fr.json @@ -13,8 +13,8 @@ "PBD": "Diamètre", "PBH": "Hauteur", "Cd0": "Forme (1 pour rond, 2 pour carré)", - "ZRL": "Cote de fond haut amont rampe", - "ZRR": "Cote de fond bas amont rampe", + "ZRB": "Cote de fond bas amont", + "ZRT": "Cote de fond haut amont", "BR": "Largeur totale", "ZF1": "Cote de fond amont rampe", "B": "Largeur", diff --git a/src/app/calculators/rugofond/config.json b/src/app/calculators/rugofondmultiple/config.json similarity index 56% rename from src/app/calculators/rugofond/config.json rename to src/app/calculators/rugofondmultiple/config.json index e9b92f7f74d047f3022e9ee1b3cdf7f488fe1fc1..9758d8939e4d8644cf06263c92daa42573e874a1 100644 --- a/src/app/calculators/rugofond/config.json +++ b/src/app/calculators/rugofondmultiple/config.json @@ -31,18 +31,37 @@ "id": "fs_type", "type": "fieldset", "fields": [ - "ZF1", { - "id": "ZD1", + "id": "select_passtype", + "type": "select", + "property": "rugofondType" + }, + { + "id": "ZRT", "allowEmpty": true }, { - "id": "ZR1", + "id": "ZRB", "allowEmpty": true }, { - "id": "Nb", + "id": "NbT", "allowEmpty": true + }, + { + "id": "ZF1", + "help": "pam/macrorugo.html#rugosite-de-fond" + } + ] + }, + { + "id": "fs_rugofond", + "type": "fieldset_template", + "calcType": "RugoFond", + "fields": [ + { + "id": "ZF1", + "help": "pam/macrorugo.html#rugosite-de-fond" } ] } diff --git a/src/app/calculators/rugofond/en.json b/src/app/calculators/rugofondmultiple/en.json similarity index 74% rename from src/app/calculators/rugofond/en.json rename to src/app/calculators/rugofondmultiple/en.json index 4d57cf8c62f737244a301ca4b355e6bae87e2fed..e16c1d7d3a704a4ba4db94c39eeb48bb04be427b 100644 --- a/src/app/calculators/rugofond/en.json +++ b/src/app/calculators/rugofondmultiple/en.json @@ -6,17 +6,17 @@ "fs_pass": "Fish pass parameters", "fs_bloc": "Blocks parameters", "fs_pass_type": "Pass type", - "macrorugo_container": "Aprons", - "fs_macrorugo": "Apron", + "rugofond_container": "Aprons", + "fs_rugofond": "Apron", "select_passtype": "Pass type", "Q": "Flow", "If": "Slope", "a": "Strickler correction factor", "ZF1": "Upstream ramp bottom elevation", - "ZD1": "Lower upstream ramp bottom elevation", - "ZR1": "Upper upstream ramp bottom elevation", - "Nb": "Number of baffles", + "ZRT": "Upper upstream ramp bottom elevation", + "ZRB": "Lower upstream ramp bottom elevation", + "NbT": "Number of flow sections", "L": "Total width of ramp", "Cd": "Discharge coefficient", "d65": "d65", diff --git a/src/app/calculators/rugofond/fr.json b/src/app/calculators/rugofondmultiple/fr.json similarity index 77% rename from src/app/calculators/rugofond/fr.json rename to src/app/calculators/rugofondmultiple/fr.json index 37157230867b0fb1a1898a9dece3ed195ca8ed59..6a2ab4707c815d11713958a3552d9315abb0d653 100644 --- a/src/app/calculators/rugofond/fr.json +++ b/src/app/calculators/rugofondmultiple/fr.json @@ -6,17 +6,17 @@ "fs_pass": "Paramètres de la passe", "fs_bloc": "Paramètres des blocs", "fs_pass_type": "Type de passe", - "macrorugo_container": "Radiers", - "fs_macrorugo": "Radier", + "rugofond_container": "Radiers", + "fs_rugofond": "Radier", "select_passtype": "Type de passe", "Q": "Débit", "If": "Pente", "a": "Coefficient correcteur du Strickler", "ZF1": "Cote de fond amont rampe", - "ZD1": "Cote de fond bas amont rampe", - "ZR1": "Cote de fond haut amont rampe", - "Nb": "Nombre de ralentisseurs", + "ZRT": "Cote de fond haut amont", + "ZRB": "Cote de fond bas amont", + "NbT": "Nombre de tranche d'écoulement", "L": "Largeur totale de la rampe", "Cd": "Coefficient de débit", "d65": "d65", diff --git a/src/app/components/fixedvar-results/var-results.component.ts b/src/app/components/fixedvar-results/var-results.component.ts index f48623acc22a3df02f2a972a5ba0a7b227c93683..cce83891fae29ef2db0ea1d36cfb27d2dac29222 100644 --- a/src/app/components/fixedvar-results/var-results.component.ts +++ b/src/app/components/fixedvar-results/var-results.component.ts @@ -19,6 +19,9 @@ import { longestVarParam } from "../../../app/util/util"; }) export class VarResultsComponent extends ResultsComponentDirective implements Observer, OnInit { + @ViewChild("tableContainer") + table: ElementRef; + /** size of the longest variated parameter */ public size: number; @@ -34,9 +37,6 @@ export class VarResultsComponent extends ResultsComponentDirective implements Ob /** messages de log issus des résultats variés */ protected _messages: Message[]; - @ViewChild("tableContainer") - table: ElementRef; - constructor( protected intlService: I18nService, protected logEntriesDetailsDialog: MatDialog @@ -125,12 +125,13 @@ export class VarResultsComponent extends ResultsComponentDirective implements Ob for (const c of sn.getChildren()) { if (c.result) { for (const k of c.result.resultElements[i].keys) { + // console.log("k", k); const er: number = c.result.resultElements[i].getValue(k); + // console.log("er", er); list.push(this.intlService.formatResult(k, er)); } } } - this._results.push(list); } } diff --git a/src/app/results/var-results.ts b/src/app/results/var-results.ts index c8c814d89776af9760d03c5e524297446330f92a..e63eeaa38a75d64a86481605a3e29a2d8c203819 100644 --- a/src/app/results/var-results.ts +++ b/src/app/results/var-results.ts @@ -7,7 +7,9 @@ import { FormulaireDefinition } from "../formulaire/definition/form-definition"; import { sprintf } from "sprintf-js"; -import { ResultElement, ParamFamily, capitalize, Nub, VariatedDetails, ParamDefinition, ParamDomain, ParamDomainValue } from "jalhyd"; +import { ResultElement, ParamFamily, capitalize, Nub, VariatedDetails, ParamDefinition, ParamDomain, ParamDomainValue, acSection } from "jalhyd"; +import { CourbeRemous } from "jalhyd"; +import { SectionNub } from "jalhyd"; export class VarResults extends CalculatedParamResults implements PlottableData { /** @@ -340,12 +342,21 @@ export class VarResults extends CalculatedParamResults implements PlottableData } public update() { - // refresh param headers - this._variableParamHeaders = this._variatedParams.map((v) => { - let h = this.expandLabelFromSymbol(v.param); - h += this.getHelpLink(v.param.symbol); - return h; - }); + // refresh param headers and build source nub headers + if (this.result.sourceNub instanceof SectionNub) { + this._variableParamHeaders = this._variatedParams.map((v) => { + let h = this.expandLabelFromSymbol(v.param); + h += this.getHelpLink(v.param.symbol); + return h; + }); + } else { + const parentVariatedParameters = this._variatedParams.filter(v => v.param.nubCalcType === this.result.sourceNub.calcType); + this._variableParamHeaders = parentVariatedParameters.map((v) => { + let h = this.expandLabelFromSymbol(v.param); + h += this.getHelpLink(v.param.symbol); + return h; + }); + } // liste la plus longue const lvp = longestVarParam(this._variatedParams); @@ -410,9 +421,17 @@ export class VarResults extends CalculatedParamResults implements PlottableData rh += this.getHelpLink(k); this._resultHeaders.push(rh); } + // build header for children variated parameters + for (const v of c.findVariatedParams()) { + let h = sprintf(ServiceFactory.i18nService.localizeText("INFO_STUFF_N"), cn) + + (c.findPositionInParent() + 1) + " : " + + ServiceFactory.formulaireService.expandVariableNameAndUnit(ct, v.param.symbol); + h += this.getHelpLink(v.param.symbol); + this.variableParamHeaders.push(h); + } + // this.variableParamHeaders.push() } } - this.resetDefaultAxisIfNeeded(); } diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index 137f6c6f2783e50072bf53e07949726cb4b9b214..350cfc16ef0bb20fd3dd1df7349d83238d03bf97 100755 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -82,9 +82,7 @@ "ERROR_STRUCTURE_Q_TROP_ELEVE": "The flow passing through the other devices is too high: the requested parameter is not calculable.", "ERROR_STRUCTURE_ZDV_PAS_CALCULABLE": "Parameter \"Crest elevation\" cannot be calculated with this discharge law", "ERROR_STRUCTURE_Z_EGAUX_Q_NON_NUL": "Upstream and downstream elevations are equal but flow is not null", - "ERROR_ELEVATION_Z1_LOWER_THAN_ZF1": "Upstream elevation is lower than the upstream bottom elevation of the ramp", - "ERROR_ELEVATION_Z1_EQUAL_TO_ZF1": "Upstream elevation is equal to the upstream bottom elevation of the ramp", - "ERROR_COEF_DEBIT_NULL": "Calculation is impossible when discharge coefficient is null", + "WARNING_COEF_DEBIT_NULL": "Apron n°%number%: Value of calculated parameter is null when discharge coefficient is null", "ERROR_D65_NULL": "Calculation is impossible when d65 is null", "INFO_CALCULATOR_CALC_NAME": "Calculator name", "INFO_CALCULATOR_CALCULER": "Compute", @@ -229,6 +227,7 @@ "INFO_CHILD_TYPE_OUVRAGE_PLUR": "devices", "INFO_CHILD_TYPE_OUVRAGE_SHORT": "D", "INFO_CHILD_TYPE_MACRORUGO": "apron", + "INFO_CHILD_TYPE_RUGOFOND": "apron", "INFO_CHILD_TYPE_MACRORUGO_PLUR": "aprons", "INFO_CHILD_TYPE_MACRORUGO_SHORT": "A", "INFO_CHILD_TYPE_PUISSANCE": "power", @@ -409,6 +408,7 @@ "INFO_LIB_BMIN": "Minimal slot or weir width", "INFO_LIB_PMINS": "Minimal basin width", "INFO_LIB_PMINP": "Minimal basin width", + "INFO_LIB_LINCL": "Lateral inclination", "INFO_LIB_LMINS": "Minimal basin length", "INFO_LIB_LMINP": "Minimal basin length", "INFO_LIB_HMIN": "Minimal head on weir", @@ -518,6 +518,8 @@ "INFO_PAR_TITRE": "Baffle fishway: setup", "INFO_RUGOFOND_TITRE": "Bed roughness fishpasses", "INFO_RUGOFOND_TITRE_COURT": "Bed roughness", + "INFO_RUGOFONDMULTIPLE_TITRE": "Bed roughness fishpasses", + "INFO_RUGOFONDMULTIPLE_TITRE_COURT": "Bed roughness", "INFO_PAR_DESCRIPTION": "planes Denil Fatou superactive mixte chevrons canoe", "INFO_PAR_TITRE_COURT": "HF: setup", "INFO_PARSIMULATION_TITRE": "Baffle fishway: simulation", @@ -720,6 +722,8 @@ "WARNING_SESSION_LOAD_NOTES_MERGED": "Notes have been merged", "WARNING_VALUE_ROUNDED_TO_INTEGER": "Value of %symbol% was rounded to %rounded%", "WARNING_VARIATED_LENGTH_LIMITED_BY_LINKED_RESULT": "Number of results is limited by linked result %symbol%", + "WARNING_ELEVATION_Z1_LOWER_THAN_ZF1": "Apron n°%number%: calculated flow is null because upstream elevation is lower than the upstream bottom elevation of the ramp", + "WARNING_ELEVATION_Z1_EQUAL_TO_ZF1": "Apron n°%number%: calculated flow is null because upstream elevation is equal to the upstream bottom elevation of the ramp", "ERROR_PAR_P_DEVIATES_MORE_THAN_10_5_PCT": "Given spacing value is more than 10% lower or more than 5% greater than standard value %stdP%", "ERROR_PAR_QSTAR_OUT_OF_RANGE": "Flow value %val% is outside of validity interval [ %min%, %max% ] given by abacuses", "ERROR_PAR_HA_OUT_OF_RANGE": "Upstream head value %val% is outside of validity interval [ %min%, %max% ] given by abacuses", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 62d4e610be18727c1bd22fb392f588c72fd7b4d9..e8b2752fc87d59f753362c8dfab236e4ee36c7d3 100755 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -82,9 +82,7 @@ "ERROR_STRUCTURE_Q_TROP_ELEVE": "Le débit passant par les autres ouvrages est trop élevé : le paramètre demandé n'est pas calculable.", "ERROR_STRUCTURE_ZDV_PAS_CALCULABLE": "Le paramètre \"Cote de radier\" ne peut pas être calculé avec cette loi de débit", "ERROR_STRUCTURE_Z_EGAUX_Q_NON_NUL": "Les cotes amont aval sont égales et le débit n'est pas nul", - "ERROR_ELEVATION_Z1_LOWER_THAN_ZF1": "La cote amont est plus basse que la cote de fond amont de la rampe", - "ERROR_ELEVATION_Z1_EQUAL_TO_ZF1": "La cote de l'eau amont est égale à la cote de fond amont de la rampe", - "ERROR_COEF_DEBIT_NULL": "Le calcul impossible à cause d'un coefficient de débit nul", + "WARNING_COEF_DEBIT_NULL": "Radier n°%number%: valeur du parametre calculé nul car le coefficient de débit est nul", "ERROR_D65_NULL": "Le calcul impossible à cause d'un d65 nul", "INFO_CALCULATOR_CALC_NAME": "Nom du module de calcul", "INFO_CALCULATOR_CALCULER": "Calculer", @@ -229,6 +227,7 @@ "INFO_CHILD_TYPE_OUVRAGE_PLUR": "ouvrages", "INFO_CHILD_TYPE_OUVRAGE_SHORT": "O", "INFO_CHILD_TYPE_MACRORUGO": "radier", + "INFO_CHILD_TYPE_RUGOFOND": "radier", "INFO_CHILD_TYPE_MACRORUGO_PLUR": "radiers", "INFO_CHILD_TYPE_MACRORUGO_SHORT": "R", "INFO_CHILD_TYPE_PUISSANCE": "puissance", @@ -410,6 +409,7 @@ "INFO_LIB_BMIN": "Largeur minimale de fente ou échancrure latérale", "INFO_LIB_PMINS": "Profondeur minimale de bassin", "INFO_LIB_PMINP": "Profondeur minimale de bassin", + "INFO_LIB_LINCL": "Dévers latéral", "INFO_LIB_LMINS": "Longueur minimale de bassin", "INFO_LIB_LMINP": "Longueur minimale de bassin", "INFO_LIB_HMIN": "Charge minimale sur l'échancrure", @@ -519,6 +519,8 @@ "INFO_PAR_TITRE": "Passe à ralentisseurs : calage", "INFO_RUGOFOND_TITRE": "Passe à rugosité de fond", "INFO_RUGOFOND_TITRE_COURT": "Rugofond", + "INFO_RUGOFONDMULTIPLE_TITRE": "Passe à rugosité de fond", + "INFO_RUGOFONDMULTIPLE_TITRE_COURT": "Rugofond", "INFO_PAR_DESCRIPTION": "plans Denil Fatou fonds suractifs mixte chevrons canoë", "INFO_PAR_TITRE_COURT": "PAR : calage", "INFO_PARSIMULATION_TITRE": "Passe à ralentisseurs : simulation", @@ -721,6 +723,8 @@ "WARNING_SESSION_LOAD_NOTES_MERGED": "Les notes ont été fusionnées", "WARNING_VALUE_ROUNDED_TO_INTEGER": "La valeur de %symbol% a été arrondie à %rounded%", "WARNING_VARIATED_LENGTH_LIMITED_BY_LINKED_RESULT": "Le nombre de résultats est limité par le résultat lié %symbol%", + "WARNING_ELEVATION_Z1_LOWER_THAN_ZF1": "Radier n°%number%: le débit calculé est nul car la cote amont est plus basse que la cote de fond amont de la rampe", + "WARNING_ELEVATION_Z1_EQUAL_TO_ZF1": "Radier n°%number%: le débit calculé est nul car la cote de l'eau amont est égale à la cote de fond amont de la rampe", "ERROR_PAR_P_DEVIATES_MORE_THAN_10_5_PCT": "La valeur d'espacement fournie est plus de 10% plus petite ou plus de 5% plus grande que la valeur standard %stdP%", "ERROR_PAR_QSTAR_OUT_OF_RANGE": "La valeur %val% du débit sort de l'intervalle de validité [ %min%, %max% ] donné par les abaques", "ERROR_PAR_HA_OUT_OF_RANGE": "La valeur %val% de la charge amont sort de l'intervalle de validité [ %min%, %max% ] donné par les abaques",