From 9d37d055c41498e094c7980d883b89aa727b472b Mon Sep 17 00:00:00 2001 From: Jean-Pascal <jean-pascal.aubry@inrae.fr> Date: Tue, 30 Jan 2024 15:54:46 +0000 Subject: [PATCH] feat: refactor config.json module and translation error message Refs #657 --- src/app/calculators/rugofond/config.json | 41 ++++++++++-------------- src/app/calculators/rugofond/en.json | 19 +++-------- src/app/calculators/rugofond/fr.json | 25 +++------------ src/locale/messages.en.json | 1 + src/locale/messages.fr.json | 1 + 5 files changed, 27 insertions(+), 60 deletions(-) diff --git a/src/app/calculators/rugofond/config.json b/src/app/calculators/rugofond/config.json index 3acfae33b..66eace589 100644 --- a/src/app/calculators/rugofond/config.json +++ b/src/app/calculators/rugofond/config.json @@ -3,8 +3,8 @@ "id": "fs_hydraulique", "type": "fieldset", "fields": [ - "Z1", - "Q" + "Q", + "Z1" ] }, { @@ -12,32 +12,12 @@ "type": "fieldset", "fields": [ "L", - "Cd", - "d65", { "id": "If", "help": "hsl/pente.html" }, - { - "id": "P", - "allowEmpty": true - }, - { - "id": "ZD1", - "allowEmpty": true - }, - { - "id": "ZR1", - "allowEmpty": true - }, - { - "id": "ZD2", - "allowEmpty": true - }, - { - "id": "ZR2", - "allowEmpty": true - }, + "Cdt", + "d65", { "id": "Ks", "help": "pam/macrorugo.html#rugosite-de-fond" @@ -48,7 +28,20 @@ "id": "fs_type", "type": "fieldset", "fields": [ + { + "id": "select_passtype", + "type": "select", + "property": "inclinedApron" + }, "ZF1", + { + "id": "ZD1", + "allowEmpty": true + }, + { + "id": "ZR1", + "allowEmpty": true + }, { "id": "Nb", "allowEmpty": true diff --git a/src/app/calculators/rugofond/en.json b/src/app/calculators/rugofond/en.json index 1048d75f9..b0f5ca0ff 100644 --- a/src/app/calculators/rugofond/en.json +++ b/src/app/calculators/rugofond/en.json @@ -17,23 +17,12 @@ "Cd0": "Shape (1 for round, 2 for square)", "ZRL": "Upper upstream ramp bottom elevation", "ZRR": "Lower upstream ramp bottom elevation", - "BR": "Total width", "ZF1": "Upstream ramp bottom elevation", - "B": "Width", - "Y": "Water depth", - "xCenter": "Mid-apron abscissa", - "ZD1": "Upstream spilling elevation", - "ZR1": "Upstream apron elevation", - "ZD2": "Downstream spilling elevation", - "ZR2": "Downstream apron elevation", - "S": "Slope", - "P": "Space between baffles", + "ZD1": "Lower upstream ramp bottom elevation", + "ZR1": "Upper upstream ramp bottom elevation", "Nb": "Number of baffles", - "L": "Total width of baffle / pattern (superactive)", - "a": "Height of the pattern / height and thickness of the chevron (chevrons)", - "N": "Number of patterns", - "M": "Number of longitudinal strips", - "Cd": "Discharge coefficient", + "L": "Total width of ramp", + "Cdt": "Discharge coefficient", "d65": "d65", diff --git a/src/app/calculators/rugofond/fr.json b/src/app/calculators/rugofond/fr.json index 9ff740907..afefbc1a9 100644 --- a/src/app/calculators/rugofond/fr.json +++ b/src/app/calculators/rugofond/fr.json @@ -12,29 +12,12 @@ "Q": "Débit", "If": "Pente", "Ks": "Rugosité de fond", - "C": "Concentration de blocs", - "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", - "BR": "Largeur totale", "ZF1": "Cote de fond amont rampe", - "B": "Largeur", - "Y": "Profondeur", - "xCenter": "Abscisse du milieu du radier", - "ZD1": "Cote de déversement à l'amont", - "ZR1": "Cote de radier à l'amont", - "ZD2": "Cote de déversement à l'aval", - "ZR2": "Cote de radier à l'aval", - "S": "Pente", - "P": "Espacement entre les ralentisseurs", + "ZD1": "Cote de fond bas amont rampe", + "ZR1": "Cote de fond haut amont rampe", "Nb": "Nombre de ralentisseurs", - "L": "Largeur totale du ralentisseur / du motif (suractifs)", - "a": "Hauteur du motif / hauteur et épaisseur du chevron (chevrons)", - "N": "Nombre de motifs", - "M": "Nombre de bandes longitudinales", - "Cd": "Coefficient de débit", + "L": "Largeur totale de la rampe", + "Cdt": "Coefficient de débit", "d65": "d65", "PASSTYPE_0": "Radiers multiples", diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index fac0b022e..1c95af5ac 100755 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -82,6 +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": "than the upstream bottom elevation of the ramp", "INFO_CALCULATOR_CALC_NAME": "Calculator name", "INFO_CALCULATOR_CALCULER": "Compute", "INFO_CALCULATOR_CLONE": "Duplicate", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 1290374dd..f98183ab4 100755 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -82,6 +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", "INFO_CALCULATOR_CALC_NAME": "Nom du module de calcul", "INFO_CALCULATOR_CALCULER": "Calculer", "INFO_CALCULATOR_CLONE": "Dupliquer", -- GitLab