From 30f99c5a66b61a60b331f5ac9e6b6ef2582f7c7c Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Thu, 2 Jan 2020 15:41:38 +0100
Subject: [PATCH] Add new module: Blocks Concentration

---
 .../concentration-blocs.config.json           | 17 ++++++++++++++
 .../concentration-blocs.en.json               | 22 +++++++++++++++++++
 .../concentration-blocs.fr.json               | 22 +++++++++++++++++++
 src/app/config.json                           |  2 +-
 src/app/services/formulaire.service.ts        |  1 +
 src/locale/messages.en.json                   |  2 ++
 src/locale/messages.fr.json                   |  2 ++
 7 files changed, 67 insertions(+), 1 deletion(-)
 create mode 100644 src/app/calculators/concentration-blocs/concentration-blocs.config.json
 create mode 100644 src/app/calculators/concentration-blocs/concentration-blocs.en.json
 create mode 100644 src/app/calculators/concentration-blocs/concentration-blocs.fr.json

diff --git a/src/app/calculators/concentration-blocs/concentration-blocs.config.json b/src/app/calculators/concentration-blocs/concentration-blocs.config.json
new file mode 100644
index 000000000..c85dcc160
--- /dev/null
+++ b/src/app/calculators/concentration-blocs/concentration-blocs.config.json
@@ -0,0 +1,17 @@
+[
+    {
+        "id": "fs_params",
+        "type": "fieldset",
+        "fields": [
+            "C",
+            "N",
+            "L",
+            "D"
+        ]
+    },
+    {
+        "type": "options",
+        "idCal": "C",
+        "help": "macrorugo/macrorugo.html"
+    }
+]
\ No newline at end of file
diff --git a/src/app/calculators/concentration-blocs/concentration-blocs.en.json b/src/app/calculators/concentration-blocs/concentration-blocs.en.json
new file mode 100644
index 000000000..8c407122e
--- /dev/null
+++ b/src/app/calculators/concentration-blocs/concentration-blocs.en.json
@@ -0,0 +1,22 @@
+{
+    "fs_params": "Pass parameters",
+
+    "C": "Concentration",
+    "N": "Number of blocks",
+    "L": "Pass width",
+    "D": "Diameter of a block",
+
+    "ax": "Pattern width",
+    "R": "Residual width",
+    "NB": "Number of blocks, downwards harmonization",
+    "NH": "Number of blocks, upwards harmonization",
+    "AXB": "Pattern width, downwards harmonization",
+    "AXH": "Pattern width, upwards harmonization",
+    "CB": "Concentration, downwards harmonization",
+    "CH": "Concentration, upwards harmonization",
+
+    "UNIT_AX": "m",
+    "UNIT_R": "m",
+    "UNIT_AXB": "m",
+    "UNIT_AXH": "m"
+}
diff --git a/src/app/calculators/concentration-blocs/concentration-blocs.fr.json b/src/app/calculators/concentration-blocs/concentration-blocs.fr.json
new file mode 100644
index 000000000..1d0a9f3a5
--- /dev/null
+++ b/src/app/calculators/concentration-blocs/concentration-blocs.fr.json
@@ -0,0 +1,22 @@
+{
+    "fs_params": "Paramètres de la passe",
+
+    "C": "Concentration",
+    "N": "Nombre de blocs",
+    "L": "Largeur de la passe",
+    "D": "Diamètre d'un bloc",
+
+    "ax": "Largeur d'un motif",
+    "R": "Largeur résiduelle",
+    "NB": "Nombre de blocs, harmonisation vers le bas",
+    "NH": "Nombre de blocs, harmonisation vers le haut",
+    "AXB": "Largeur d'un motif, harmonisation vers le bas",
+    "AXH": "Largeur d'un motif, harmonisation vers le haut",
+    "CB": "Concentration, harmonisation vers le bas",
+    "CH": "Concentration, harmonisation vers le haut",
+
+    "UNIT_AX": "m",
+    "UNIT_R": "m",
+    "UNIT_AXB": "m",
+    "UNIT_AXH": "m"
+}
diff --git a/src/app/config.json b/src/app/config.json
index f9d36885c..ab384b6d8 100644
--- a/src/app/config.json
+++ b/src/app/config.json
@@ -23,7 +23,7 @@
                 "path": "passe-naturelle.jpg",
                 "credits": "S. Richard / AFB"
             },
-            "calculators": [ 11, 17 ]
+            "calculators": [ 11, 17, 27 ]
         },
         {
             "name": "DEVALAISON",
diff --git a/src/app/services/formulaire.service.ts b/src/app/services/formulaire.service.ts
index e0224f8d6..53156bc4d 100644
--- a/src/app/services/formulaire.service.ts
+++ b/src/app/services/formulaire.service.ts
@@ -92,6 +92,7 @@ export class FormulaireService extends Observable {
         this.calculatorPaths[CalculatorType.YAXB] = "yaxb";
         this.calculatorPaths[CalculatorType.Trigo] = "trigo";
         this.calculatorPaths[CalculatorType.SPP] = "spp";
+        this.calculatorPaths[CalculatorType.ConcentrationBlocs] = "concentration-blocs";
     }
 
     private get _intlService(): I18nService {
diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json
index 1e4480cb9..d064a60a0 100644
--- a/src/locale/messages.en.json
+++ b/src/locale/messages.en.json
@@ -81,6 +81,8 @@
     "INFO_CLOSE_DIALOGUE_DEPENDING_MODULES": "The following modules depend on the one you are closing:",
     "INFO_CLOSE_DIALOGUE_TEXT": "Warning ! Parameters and results of this module will be lost.",
     "INFO_CLOSE_DIALOGUE_TITRE": "Closing calculation module",
+    "INFO_CONCENTRATIONBLOCS_TITRE": "Blocks concentration",
+    "INFO_CONCENTRATIONBLOCS_TITRE_COURT": "Blocks conc.",
     "INFO_CONDUITEDISTRIBUTRICE_TITRE_COURT": "Distrib.",
     "INFO_CONDUITEDISTRIBUTRICE_TITRE": "Distributor pipe",
     "INFO_COURBEREMOUS_TITRE_COURT": "Backwater",
diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json
index 42ab64ad7..6e7ba5d64 100644
--- a/src/locale/messages.fr.json
+++ b/src/locale/messages.fr.json
@@ -81,6 +81,8 @@
     "INFO_CLOSE_DIALOGUE_DEPENDING_MODULES": "Les modules suivants dépendent de celui que vous êtes en train de fermer :",
     "INFO_CLOSE_DIALOGUE_TEXT": "Attention&nbsp;! Les paramètres et résultats du module de calcul seront perdus.",
     "INFO_CLOSE_DIALOGUE_TITRE": "Fermeture du module de calcul",
+    "INFO_CONCENTRATIONBLOCS_TITRE": "Concentration de blocs",
+    "INFO_CONCENTRATIONBLOCS_TITRE_COURT": "Conc. blocs",
     "INFO_CONDUITEDISTRIBUTRICE_TITRE_COURT": "Conduite distri.",
     "INFO_CONDUITEDISTRIBUTRICE_TITRE": "Conduite distributrice",
     "INFO_COURBEREMOUS_TITRE_COURT": "Remous",
-- 
GitLab