From fb6f0507b93a35f6584ba695ba4761ed9c06604d Mon Sep 17 00:00:00 2001
From: Jean-Pascal <jean-pascal.aubry@inrae.fr>
Date: Mon, 29 Jan 2024 17:02:54 +0000
Subject: [PATCH] feat: add rugofond module and configure fields Refs #657

---
 jalhyd_branch                            |  2 +-
 src/app/calculators/rugofond/config.json | 58 ++++++++++++++++++++++++
 src/app/calculators/rugofond/en.json     | 42 +++++++++++++++++
 src/app/calculators/rugofond/fr.json     | 42 +++++++++++++++++
 src/app/config.json                      |  2 +-
 src/locale/messages.en.json              |  1 +
 src/locale/messages.fr.json              |  2 +
 7 files changed, 147 insertions(+), 2 deletions(-)
 create mode 100644 src/app/calculators/rugofond/config.json
 create mode 100644 src/app/calculators/rugofond/en.json
 create mode 100644 src/app/calculators/rugofond/fr.json

diff --git a/jalhyd_branch b/jalhyd_branch
index 94a6cacfd..aa60e2b3f 100644
--- a/jalhyd_branch
+++ b/jalhyd_branch
@@ -1 +1 @@
-325-courbe-de-remous-calculer-une-courbe-de-remous-de-passe-a-macro-rugosites
+340-ajout-de-la-passe-a-rugosite-de-fond
diff --git a/src/app/calculators/rugofond/config.json b/src/app/calculators/rugofond/config.json
new file mode 100644
index 000000000..3acfae33b
--- /dev/null
+++ b/src/app/calculators/rugofond/config.json
@@ -0,0 +1,58 @@
+[
+    {
+        "id": "fs_hydraulique",
+        "type": "fieldset",
+        "fields": [
+            "Z1",
+            "Q"
+        ]
+    },
+    {
+        "id": "fs_geometry",
+        "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
+            },
+            {
+                "id": "Ks",
+                "help": "pam/macrorugo.html#rugosite-de-fond"
+            }
+        ]
+    },
+    {
+        "id": "fs_type",
+        "type": "fieldset",
+        "fields": [
+            "ZF1",
+            {
+                "id": "Nb",
+                "allowEmpty": true
+            }
+        ]
+    }
+]
diff --git a/src/app/calculators/rugofond/en.json b/src/app/calculators/rugofond/en.json
new file mode 100644
index 000000000..1048d75f9
--- /dev/null
+++ b/src/app/calculators/rugofond/en.json
@@ -0,0 +1,42 @@
+{
+    "fs_hydraulique": "Hydraulic parameters",
+    "fs_geometry": "Pass geometry",
+    "fs_pass": "Fish pass parameters",
+    "fs_bloc": "Blocks parameters",
+    "fs_pass_type": "Pass type",
+    "macrorugo_container": "Aprons",
+    "fs_macrorugo": "Apron",
+
+    "select_passtype": "Pass type",
+    "Q": "Flow",
+    "If": "Slope",
+    "Ks": "Bottom roughness",
+    "C": "Block concentration",
+    "PBD": "Diameter",
+    "PBH": "Height",
+    "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",
+    "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",
+    "d65": "d65",
+    
+
+    "PASSTYPE_0": "Multiple aprons",
+    "PASSTYPE_1": "Inclined apron"
+}
\ No newline at end of file
diff --git a/src/app/calculators/rugofond/fr.json b/src/app/calculators/rugofond/fr.json
new file mode 100644
index 000000000..9ff740907
--- /dev/null
+++ b/src/app/calculators/rugofond/fr.json
@@ -0,0 +1,42 @@
+{
+    "fs_hydraulique": "Paramètres hydrauliques",
+    "fs_geometry": "Géométrie de la passe",
+    "fs_type": "Type de rampe",
+    "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",
+
+    "select_passtype": "Type de passe",
+    "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",
+    "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",
+    "d65": "d65",
+    
+    "PASSTYPE_0": "Radiers multiples",
+    "PASSTYPE_1": "Radier incliné"
+}
\ No newline at end of file
diff --git a/src/app/config.json b/src/app/config.json
index e3ac99d86..bf12d9f31 100644
--- a/src/app/config.json
+++ b/src/app/config.json
@@ -31,7 +31,7 @@
                 "path": "passe-naturelle.jpg",
                 "credits": "S. Richard / OFB"
             },
-            "calculators": [ 11, 17, 27, 37 ]
+            "calculators": [ 11, 17, 27, 37, 38 ]
         },
         {
             "name": "VERIFICATION",
diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json
index b6d2282fa..fac0b022e 100755
--- a/src/locale/messages.en.json
+++ b/src/locale/messages.en.json
@@ -512,6 +512,7 @@
     "INFO_PARALLELSTRUCTURE_TITRE_COURT": "// structures",
     "INFO_PARALLELSTRUCTURE_TITRE": "Parallel structures",
     "INFO_PAR_TITRE": "Baffle fishway: setup",
+    "INFO_RUGOFOND_TITRE": "toto",
     "INFO_PAR_DESCRIPTION": "planes Denil Fatou superactive mixte chevrons canoe",
     "INFO_PAR_TITRE_COURT": "HF: setup",
     "INFO_PARSIMULATION_TITRE": "Baffle fishway: simulation",
diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json
index 88331c2bb..1290374dd 100755
--- a/src/locale/messages.fr.json
+++ b/src/locale/messages.fr.json
@@ -513,6 +513,8 @@
     "INFO_PARALLELSTRUCTURE_TITRE_COURT": "Ouvrages",
     "INFO_PARALLELSTRUCTURE_TITRE": "Lois d'ouvrages",
     "INFO_PAR_TITRE": "Passe à ralentisseurs&nbsp;: calage",
+    "INFO_RUGOFOND_TITRE": "Passe à rugosité de fond",
+    "INFO_RUGOFOND_TITRE_COURT": "Rugofond",
     "INFO_PAR_DESCRIPTION": "plans Denil Fatou fonds suractifs mixte chevrons canoë",
     "INFO_PAR_TITRE_COURT": "PAR&nbsp;: calage",
     "INFO_PARSIMULATION_TITRE": "Passe à ralentisseurs&nbsp;: simulation",
-- 
GitLab