From 8933e858b0ab1893fff1e6c48df0a18488703674 Mon Sep 17 00:00:00 2001 From: "mathias.chouet" <mathias.chouet@irstea.fr> Date: Thu, 12 Sep 2019 15:35:31 +0200 Subject: [PATCH] #287 added prototype for Jet module --- README.md | 5 +++-- src/app/calculators/jet/jet.config.json | 12 ++++++++++++ src/app/calculators/jet/jet.en.json | 21 +++++++++++++++++++++ src/app/calculators/jet/jet.fr.json | 21 +++++++++++++++++++++ src/app/config.json | 10 +++++++++- src/app/services/formulaire.service.ts | 2 ++ src/locale/messages.en.json | 4 ++++ src/locale/messages.fr.json | 4 ++++ 8 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 src/app/calculators/jet/jet.config.json create mode 100644 src/app/calculators/jet/jet.en.json create mode 100644 src/app/calculators/jet/jet.fr.json diff --git a/README.md b/README.md index 319797424..4b93c0343 100644 --- a/README.md +++ b/README.md @@ -267,8 +267,9 @@ Custom Material SVG Icons will only show up when the application is deployed on On peut soit composer la classe concrète directement avec ces classes, soient dériver ces dernières et composer avec. 3. _src/locale/messages.<langue>.json_ : - Ajouter un champ pour le titre du module de calcul. Par exemple : - _"INFO_MACALC_TITRE": "Ma calculette"_ + Ajouter deux champs pour le titre et le titre court du module de calcul. Par exemple : + _"INFO_MACALC_TITRE": "Ma calculette"_, + _"INFO_MACALC_TITRE_COURT": "Ma calc."_ 4. Dans le constructeur de _FormulaireService_, ajouter une entrée dans `this.calculatorPaths` pour fournir le préfixe des fichiers de configuration/internationalisation. diff --git a/src/app/calculators/jet/jet.config.json b/src/app/calculators/jet/jet.config.json new file mode 100644 index 000000000..857c2018e --- /dev/null +++ b/src/app/calculators/jet/jet.config.json @@ -0,0 +1,12 @@ +[ + { + "id": "fs_jet", + "type": "fieldset", + "fields": [ "V0", "S", "D", "H" ] + }, + { + "type": "options", + "__idCal": "D", + "help": "devalaison/jet" + } +] \ No newline at end of file diff --git a/src/app/calculators/jet/jet.en.json b/src/app/calculators/jet/jet.en.json new file mode 100644 index 000000000..67fc3ad49 --- /dev/null +++ b/src/app/calculators/jet/jet.en.json @@ -0,0 +1,21 @@ +{ + "fs_jet": "Jet and impact parameters", + + "V0": "Initial speed", + "S": "Initial slope", + "D": "Impact abscissa", + "H": "Fall height", + "t": "Flight time", + "Vx": "Horizontal speed at impact", + "Vz": "Vertical speed at impact", + "Vt": "Impact speed at impact", + + "UNIT_V0": "m/s", + "UNIT_S": "m/m", + "UNIT_D": "m", + "UNIT_H": "m", + "UNIT_T": "s", + "UNIT_VX": "m/s", + "UNIT_VZ": "m/s", + "UNIT_VT": "m/s" +} \ No newline at end of file diff --git a/src/app/calculators/jet/jet.fr.json b/src/app/calculators/jet/jet.fr.json new file mode 100644 index 000000000..af50a3b85 --- /dev/null +++ b/src/app/calculators/jet/jet.fr.json @@ -0,0 +1,21 @@ +{ + "fs_jet": "Paramètres du jet et de l'impact", + + "V0": "Vitesse initiale", + "S": "Pente initiale", + "D": "Abscisse de l'impact", + "H": "Hauteur de chute", + "t": "Temps de vol", + "Vx": "Vitesse horizontale à l'impact", + "Vz": "Vitesse verticale à l'impact", + "Vt": "Vitesse d'impact à l'impact", + + "UNIT_V0": "m/s", + "UNIT_S": "m/m", + "UNIT_D": "m", + "UNIT_H": "m", + "UNIT_T": "s", + "UNIT_VX": "m/s", + "UNIT_VZ": "m/s", + "UNIT_VT": "m/s" +} \ No newline at end of file diff --git a/src/app/config.json b/src/app/config.json index c2ec2a974..41449c8e1 100644 --- a/src/app/config.json +++ b/src/app/config.json @@ -14,7 +14,7 @@ "path": "passe-bassin.jpg", "credits": "S. Richard / AFB" }, - "calculators": [ 12, 13, 6, 5, 10, 15, 9 ] + "calculators": [ 12, 13, 6, 5, 10, 15 ] }, { "name": "PASSE_NATURELLE", @@ -24,6 +24,14 @@ }, "calculators": [ 11, 17 ] }, + { + "name": "DEVALAISON", + "image": { + "path": "surface-libre.jpg", + "credits": "PENSER À CHANGER CETTE IMAGE" + }, + "calculators": [ 18, 3, 9 ] + }, { "name": "HYDRAULIQUE_A_SURFACE_LIBRE", "image": { diff --git a/src/app/services/formulaire.service.ts b/src/app/services/formulaire.service.ts index d880cb7d3..5bfbb27c0 100644 --- a/src/app/services/formulaire.service.ts +++ b/src/app/services/formulaire.service.ts @@ -77,6 +77,7 @@ export class FormulaireService extends Observable { this.calculatorPaths[CalculatorType.MacroRugo] = "macrorugo"; this.calculatorPaths[CalculatorType.Pab] = "pab"; this.calculatorPaths[CalculatorType.MacroRugoCompound] = "macrorugo-compound"; + this.calculatorPaths[CalculatorType.Jet] = "jet"; } private get _intlService(): I18nService { @@ -326,6 +327,7 @@ export class FormulaireService extends Observable { * @param calculatorName nom du module, à afficher dans l'interface */ public createFormulaire(ct: CalculatorType, nub?: Nub, calculatorName?: string): Promise<FormulaireDefinition> { + console.log(">> Create form !!", ct); // Crée un formulaire du bon type const f: FormulaireDefinition = this.newFormulaire(ct); this._formulaires.push(f); diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index 51c6f4652..57ac348e1 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -146,6 +146,8 @@ "INFO_FIELDSET_MOVE_DOWN": "Move down", "INFO_FIELDSET_MOVE_LEFT": "Move left", "INFO_FIELDSET_MOVE_RIGHT": "Move right", + "INFO_JET_TITRE_COURT": "Jet", + "INFO_JET_TITRE": "Jet impact", "INFO_WALL_ADDED": "1 wall added", "INFO_WALL_ADDED_N_TIMES": "%s walls added", "INFO_WALL_COPIED": "Wall #%s copied", @@ -408,6 +410,8 @@ "INFO_SNACKBAR_RESULTS_INVALIDATED": "Results invalidated for", "INFO_SNACKBAR_SETTINGS_SAVED": "Settings saved on this device", "INFO_THEME_CREDITS": "Credit", + "INFO_THEME_DEVALAISON_TITRE": "Downstream migration", + "INFO_THEME_DEVALAISON_DESCRIPTION": "", "INFO_THEME_HYDRAULIQUE_A_SURFACE_LIBRE_DESCRIPTION": "Calculation modules for flows in channels and rivers", "INFO_THEME_HYDRAULIQUE_A_SURFACE_LIBRE_TITRE": "Open-channel flow", "INFO_THEME_HYDRAULIQUE_EN_CHARGE_DESCRIPTION": "Modules for calculating head losses in pressure pipes", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 217824715..69ae2bef5 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -146,6 +146,8 @@ "INFO_FIELDSET_MOVE_DOWN": "Déplacer vers le bas", "INFO_FIELDSET_MOVE_LEFT": "Déplacer vers la gauche", "INFO_FIELDSET_MOVE_RIGHT": "Déplacer vers la droite", + "INFO_JET_TITRE_COURT": "Jet", + "INFO_JET_TITRE": "Impact de jet", "INFO_WALL_ADDED": "1 cloison ajoutée", "INFO_WALL_ADDED_N_TIMES": "%s cloisons ajoutées", "INFO_WALL_COPIED": "Cloison n°%s copiée", @@ -407,6 +409,8 @@ "INFO_SNACKBAR_RESULTS_INVALIDATED": "Résultats invalidés pour", "INFO_SNACKBAR_SETTINGS_SAVED": "Paramètres enregistrés sur cet appareil", "INFO_THEME_CREDITS": "Crédit", + "INFO_THEME_DEVALAISON_TITRE": "Dévalaison", + "INFO_THEME_DEVALAISON_DESCRIPTION": "PENSER À METTRE UNE DESCRIPTION ICI", "INFO_THEME_HYDRAULIQUE_A_SURFACE_LIBRE_DESCRIPTION": "Modules de calcul pour les écoulements en canaux et rivières", "INFO_THEME_HYDRAULIQUE_A_SURFACE_LIBRE_TITRE": "Hydraulique à surface libre", "INFO_THEME_HYDRAULIQUE_EN_CHARGE_DESCRIPTION": "Modules de calcul de perte de charge dans les conduites sous pression", -- GitLab