Skip to content
Snippets Groups Projects
Commit fdcad5cc authored by François Grand's avatar François Grand
Browse files

refactor: calculators definition files: replace numeric values by enum symbolic values

refs #621
parent b34cfe3d
No related branches found
No related tags found
1 merge request!224Resolve "Utiliser des identifiants symboliques plutôt que numériques dans les fichiers"
Showing
with 92 additions and 90 deletions
......@@ -278,7 +278,7 @@ En général les valeurs autorisées sont tirées de l'**enum** correspondant, d
#### configuration
Dans le fichier de configuration du module, ajouter la définition des listes déroulantes dans "fields", notamment la propriété associée et la valeur par défaut; cette dernière est optionnelle et en son absence, la 1ère valeur de la liste sera sélectionnée.
Dans le fichier de configuration du module, ajouter la définition des listes déroulantes dans "fields", notamment la propriété associée et la valeur par défaut; cette dernière est optionnelle et en son absence, la 1ère valeur de la liste sera sélectionnée. Si la propriété associée est d'un type énuméré, la valeur par défaut est une des valeurs de l'enum.
Exemple dans `trigo/config.json` (ici le 2ème champ ne spécifie pas de valeur par défaut) :
......@@ -301,6 +301,7 @@ Exemple dans `trigo/config.json` (ici le 2ème champ ne spécifie pas de valeur
]
},
```
Dans cet exemple, la propriété `trigoOperation` est du type énuméré TrigoOperation (cf. code).
**IMPORTANT** : les ids doivent être de la forme `select_`_`unmotclesansespacenitirets`_
......@@ -415,13 +416,14 @@ Dans la configuration du module, ajouter un sélecteur de section associé à la
"type": "select",
"property": "nodeType",
"help": {
"1": "hsl/types_sections.html#section-rectangulaire",
"0": "hsl/types_sections.html#section-circulaire",
"2": "hsl/types_sections.html#section-trapezoidale",
"3": "hsl/types_sections.html#section-parabolique"
"SectionRectangle": "hsl/types_sections.html#section-rectangulaire",
"SectionCercle": "hsl/types_sections.html#section-circulaire",
"SectionTrapeze": "hsl/types_sections.html#section-trapezoidale",
"SectionPuissance": "hsl/types_sections.html#section-parabolique"
}
}
```
Les clés de la section `help` reprennent les valeurs de l'enum `SectionType`.
La section par défaut du formulaire sera celle du sélecteur, que celle ci soit ou non configurée explicitement par le champ `default`.
### si le module agrège des modules enfants
......
......@@ -21,10 +21,10 @@
"property": "nodeType",
"default": "SectionRectangle",
"help": {
"1": "hsl/types_sections.html#section-rectangulaire",
"0": "hsl/types_sections.html#section-circulaire",
"2": "hsl/types_sections.html#section-trapezoidale",
"3": "hsl/types_sections.html#section-parabolique"
"SectionRectangle": "hsl/types_sections.html#section-rectangulaire",
"SectionCercle": "hsl/types_sections.html#section-circulaire",
"SectionTrapeze": "hsl/types_sections.html#section-trapezoidale",
"SectionPuissance": "hsl/types_sections.html#section-parabolique"
}
},
"LargeurFond",
......
......@@ -2,16 +2,16 @@
"fs_water_line": "Type of water line",
"select_regime": "Regime",
"REGIME_0": "Fluvial",
"REGIME_1": "Torrential",
"REGIME_Fluvial": "Fluvial",
"REGIME_Torrentiel": "Torrential",
"fs_section": "Type of section",
"select_section": "Choice of section type",
"SECTION_2": "Trapezoidal",
"SECTION_1": "Rectangular",
"SECTION_0": "Circular",
"SECTION_3": "Parabolic",
"SECTION_SectionTrapeze": "Trapezoidal",
"SECTION_SectionRectangle": "Rectangular",
"SECTION_SectionCercle": "Circular",
"SECTION_SectionPuissance": "Parabolic",
"LargeurFond": "Width at bottom",
"Fruit": "Bank slope",
......
......@@ -2,16 +2,16 @@
"fs_water_line": "Type de ligne d'eau",
"select_regime": "Régime",
"REGIME_0": "Fluvial",
"REGIME_1": "Torrentiel",
"REGIME_Fluvial": "Fluvial",
"REGIME_Torrentiel": "Torrentiel",
"fs_section": "Type de section",
"select_section": "Choix du type de section",
"SECTION_2": "Trapézoïdale",
"SECTION_1": "Rectangulaire",
"SECTION_0": "Circulaire",
"SECTION_3": "Parabolique",
"SECTION_SectionTrapeze": "Trapézoïdale",
"SECTION_SectionRectangle": "Rectangulaire",
"SECTION_SectionCercle": "Circulaire",
"SECTION_SectionPuissance": "Parabolique",
"LargeurFond": "Largeur au fond",
"Fruit": "Fruit des berges",
......
......@@ -9,10 +9,10 @@
"property": "nodeType",
"default": "SectionRectangle",
"help": {
"1": "hsl/types_sections.html#section-rectangulaire",
"0": "hsl/types_sections.html#section-circulaire",
"2": "hsl/types_sections.html#section-trapezoidale",
"3": "hsl/types_sections.html#section-parabolique"
"SectionRectangle": "hsl/types_sections.html#section-rectangulaire",
"SectionCercle": "hsl/types_sections.html#section-circulaire",
"SectionTrapeze": "hsl/types_sections.html#section-trapezoidale",
"SectionPuissance": "hsl/types_sections.html#section-parabolique"
}
},
"LargeurFond",
......@@ -65,9 +65,9 @@
"property": "methodeResolution",
"default": "Trapezes",
"help": {
"0": "../methodes_numeriques/integration_trapezes.html",
"1": "../methodes_numeriques/rk4.html",
"2": "../methodes_numeriques/euler_explicite.html"
"Trapezes": "../methodes_numeriques/integration_trapezes.html",
"RungeKutta4": "../methodes_numeriques/rk4.html",
"EulerExplicite": "../methodes_numeriques/euler_explicite.html"
}
}
]
......@@ -122,4 +122,4 @@
"Tau0": "hsl/section_parametree.html#la-force-tractrice-pa"
}
}
]
\ No newline at end of file
]
......@@ -2,10 +2,10 @@
"fs_section": "Type of section",
"select_section": "Choice of section type",
"SECTION_2": "Trapezoidal",
"SECTION_1": "Rectangular",
"SECTION_0": "Circular",
"SECTION_3": "Parabolic",
"SECTION_SectionTrapeze": "Trapezoidal",
"SECTION_SectionRectangle": "Rectangular",
"SECTION_SectionCercle": "Circular",
"SECTION_SectionPuissance": "Parabolic",
"LargeurFond": "Width at bottom",
"Fruit": "Bank slope",
......@@ -44,9 +44,9 @@
"UNIT_IMP": "N",
"UNIT_TAU0": "Pa",
"RESOLUTION_0": "Integration by trapezoid",
"RESOLUTION_1": "Runge Kutta fourth order",
"RESOLUTION_2": "Explicit Euler",
"RESOLUTION_Trapezes": "Integration by trapezoid",
"RESOLUTION_RungeKutta4": "Runge Kutta fourth order",
"RESOLUTION_EulerExplicite": "Explicit Euler",
"fs_target_data": "Data to compute",
"select_target": "Choice of the data to compute",
......
......@@ -2,10 +2,10 @@
"fs_section": "Type de section",
"select_section": "Choix du type de section",
"SECTION_2": "Trapézoïdale",
"SECTION_1": "Rectangulaire",
"SECTION_0": "Circulaire",
"SECTION_3": "Parabolique",
"SECTION_SectionTrapeze": "Trapézoïdale",
"SECTION_SectionRectangle": "Rectangulaire",
"SECTION_SectionCercle": "Circulaire",
"SECTION_SectionPuissance": "Parabolique",
"LargeurFond": "Largeur au fond",
"Fruit": "Fruit des berges",
......@@ -44,9 +44,9 @@
"UNIT_IMP": "N",
"UNIT_TAU0": "Pa",
"RESOLUTION_0": "Intégration par trapèzes",
"RESOLUTION_1": "Runge Kutta d'ordre 4",
"RESOLUTION_2": "Euler explicite",
"RESOLUTION_Trapezes": "Intégration par trapèzes",
"RESOLUTION_RungeKutta4": "Runge Kutta d'ordre 4",
"RESOLUTION_EulerExplicite": "Euler explicite",
"fs_target_data": "Donnée à calculer",
"select_target": "Choix de la donnée à calculer",
......
......@@ -7,6 +7,6 @@
"select_divingjetsupported": "Diving jets support",
"DIVINGJETSUPPORTED_0": "Not supported",
"DIVINGJETSUPPORTED_1": "Supported"
"DIVINGJETSUPPORTED_NOT_SUPPORTED": "Not supported",
"DIVINGJETSUPPORTED_SUPPORTED": "Supported"
}
......@@ -7,6 +7,6 @@
"select_divingjetsupported": "Support des jets plongeants",
"DIVINGJETSUPPORTED_0": "Non supportés",
"DIVINGJETSUPPORTED_1": "Supportés"
"DIVINGJETSUPPORTED_NOT_SUPPORTED": "Non supportés",
"DIVINGJETSUPPORTED_SUPPORTED": "Supportés"
}
......@@ -24,9 +24,9 @@
"property": "gridType",
"default": "Conventional",
"help": {
"0": "devalaison/grille.html#grille-conventionnelle",
"1": "devalaison/grille.html#grille-orientee",
"2": "devalaison/grille.html#grille-inclinee"
"Conventional": "devalaison/grille.html#grille-conventionnelle",
"Oriented": "devalaison/grille.html#grille-orientee",
"Inclined": "devalaison/grille.html#grille-inclinee"
}
},
{
......
......@@ -23,13 +23,13 @@
"select_gridtype": "Grid type",
"select_gridprofile": "Bars profile",
"GRIDTYPE_0": "Conventional",
"GRIDTYPE_1": "Oriented",
"GRIDTYPE_2": "Inclined",
"GRIDTYPE_Conventional": "Conventional",
"GRIDTYPE_Oriented": "Oriented",
"GRIDTYPE_Inclined": "Inclined",
"GRIDPROFILE_0": "Rectangular",
"GRIDPROFILE_1": "Hydrodynamic",
"GRIDPROFILE_2": "Custom",
"GRIDPROFILE_Rectangular": "Rectangular",
"GRIDPROFILE_Hydrodynamic": "Hydrodynamic",
"GRIDPROFILE_Custom": "Custom",
"H": "Water height",
"HG": "Grid height",
......
......@@ -23,13 +23,13 @@
"select_gridtype": "Type de grille",
"select_gridprofile": "Profil des barreaux",
"GRIDTYPE_0": "Conventionnelle",
"GRIDTYPE_1": "Orientée",
"GRIDTYPE_2": "Inclinée",
"GRIDTYPE_Conventional": "Conventionnelle",
"GRIDTYPE_Oriented": "Orientée",
"GRIDTYPE_Inclined": "Inclinée",
"GRIDPROFILE_0": "Rectangulaire",
"GRIDPROFILE_1": "Hydrodynamique",
"GRIDPROFILE_2": "Personnalisé",
"GRIDPROFILE_Rectangular": "Rectangulaire",
"GRIDPROFILE_Hydrodynamic": "Hydrodynamique",
"GRIDPROFILE_Custom": "Personnalisé",
"H": "Hauteur d'eau",
"HG": "Hauteur de grille",
......
......@@ -21,6 +21,6 @@
"Y": "Water depth",
"xCenter": "Mid-apron abscissa",
"PASSTYPE_0": "Multiple aprons",
"PASSTYPE_1": "Inclined apron"
"PASSTYPE_NOT_INCLINED": "Multiple aprons",
"PASSTYPE_INCLINED": "Inclined apron"
}
\ No newline at end of file
......@@ -21,6 +21,6 @@
"Y": "Profondeur",
"xCenter": "Abscisse du milieu du radier",
"PASSTYPE_0": "Radiers multiples",
"PASSTYPE_1": "Radier incliné"
"PASSTYPE_NOT_INCLINED": "Radiers multiples",
"PASSTYPE_INCLINED": "Radier incliné"
}
\ No newline at end of file
......@@ -24,10 +24,10 @@
"property": "parType",
"default": "PLANE",
"help": {
"0": "par/theorie_plans.html",
"1": "par/theorie_fatou.html",
"2": "par/theorie_suractif.html",
"3": "par/theorie_mixte.html"
"PLANE": "par/theorie_plans.html",
"FATOU": "par/theorie_fatou.html",
"SUPERACTIVE": "par/theorie_suractif.html",
"CHEVRON": "par/theorie_mixte.html"
}
},
"ha",
......
......@@ -31,8 +31,8 @@
"Hmax": "Maximal baffle height",
"select_partype": "Pass type",
"PARTYPE_0": "Plane baffles",
"PARTYPE_1": "Fatou",
"PARTYPE_2": "Superactive",
"PARTYPE_3": "Mixed / chevrons"
"PARTYPE_PLANE": "Plane baffles",
"PARTYPE_FATOU": "Fatou",
"PARTYPE_SUPERACTIVE": "Superactive",
"PARTYPE_CHEVRON": "Mixed / chevrons"
}
\ No newline at end of file
......@@ -31,8 +31,8 @@
"Hmax": "Hauteur maximale du ralentisseur",
"select_partype": "Type de passe",
"PARTYPE_0": "Ralentisseurs plans",
"PARTYPE_1": "Fatou",
"PARTYPE_2": "Ralentisseurs suractifs",
"PARTYPE_3": "Mixte / chevrons"
"PARTYPE_PLANE": "Ralentisseurs plans",
"PARTYPE_FATOU": "Fatou",
"PARTYPE_SUPERACTIVE": "Ralentisseurs suractifs",
"PARTYPE_CHEVRON": "Mixte / chevrons"
}
\ No newline at end of file
......@@ -21,10 +21,10 @@
"property": "parType",
"default": "PLANE",
"help": {
"0": "par/theorie_plans.html",
"1": "par/theorie_fatou.html",
"2": "par/theorie_suractif.html",
"3": "par/theorie_mixte.html"
"PLANE": "par/theorie_plans.html",
"FATOU": "par/theorie_fatou.html",
"SUPERACTIVE": "par/theorie_suractif.html",
"CHEVRON": "par/theorie_mixte.html"
}
},
"L",
......
......@@ -31,8 +31,8 @@
"Hmax": "Maximal baffle height",
"select_partype": "Pass type",
"PARTYPE_0": "Plane baffles",
"PARTYPE_1": "Fatou",
"PARTYPE_2": "Superactive",
"PARTYPE_3": "Mixed / chevrons"
"PARTYPE_PLANE": "Plane baffles",
"PARTYPE_FATOU": "Fatou",
"PARTYPE_SUPERACTIVE": "Superactive",
"PARTYPE_CHEVRON": "Mixed / chevrons"
}
......@@ -31,8 +31,8 @@
"Hmax": "Hauteur maximale du ralentisseur",
"select_partype": "Type de passe",
"PARTYPE_0": "Ralentisseurs plans",
"PARTYPE_1": "Fatou",
"PARTYPE_2": "Ralentisseurs suractifs",
"PARTYPE_3": "Mixte / chevrons"
"PARTYPE_PLANE": "Ralentisseurs plans",
"PARTYPE_FATOU": "Fatou",
"PARTYPE_SUPERACTIVE": "Ralentisseurs suractifs",
"PARTYPE_CHEVRON": "Mixte / chevrons"
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment