diff --git a/CHANGELOG.md b/CHANGELOG.md index 313cd013c7d333885123180b0404fcfd3a13383d..1bcb3184a59c1000eb4f6c177bfd1324c7e9cd36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,11 @@ -4.3.0 - 2019-04-11 -================== +# Changelog -Nouvelles fonctionnalités -------------------------- +## 4.3.0 - 2019-04-12 (Éditions LLL) + +### Nouvelles fonctionnalités + + * Module "Passe à bassin : chute" + * Module "Passe à bassin : nombre de bassins" * Amélioration du filtre de choix des paramètres liables * Vérification de la cohérence des paramètres liés au chargement de session * Validation et invalidation en cascade des modules de calcul liés @@ -12,17 +15,16 @@ Nouvelles fonctionnalités * La touche TAB permet de passer directement d'un champ de saisie à un autre * Le bouton "+" disparaît sur la page d'accueil - Correction de bogues ---------------------- +### Correction de bogues + * Divers bogues autour des paramètres liés * Mise à jour intempestive des paramètres calculés dans le formulaire de saisie * Précision d'affichage des données dans les infobulles -4.2.0 - 2019-03-11 -================== +## 4.2.0 - 2019-03-11 + +### Nouvelles fonctionnalités -Nouvelles fonctionnalités -------------------------- * titres courts pour les modules, suffixe numérique automatique * Lechapt-Calmon : amélioration du sélecteur de matériau * affichage des valeurs liées @@ -32,8 +34,8 @@ Nouvelles fonctionnalités * paramètres variables : courbe d'évolution * graphiques de résultats : choix libre de l'abscisse et de l'ordonnée -Correction de bogues --------- +### Correction de bogues + * déplacement de la sérialisation au niveau du modèle (JaLHyd) * nouvelle gestion des langues: plus robuste, charge moins de fichiers inutiles, ajout d'un cache * meilleure gestion de la session et de la hiérarchie (ouvrages en parallèle / parent) @@ -48,11 +50,10 @@ Correction de bogues * conservation du type de graphe lorsqu'on change de module * ajout de tests exhaustifs sur le calcul des paramètres et le clonage des modules -4.1.0 - 2019-02-20 -================== +## 4.1.0 - 2019-02-20 + +### Nouvelles fonctionnalités -Nouvelles fonctionnalités -------------------------- * interface : angular-material, angular-flex, charte graphique Irstea * nouvelle page de liste, modules groupés par thèmes * ajout du module Passe à Enrochement @@ -68,8 +69,8 @@ Nouvelles fonctionnalités * ajout de tests e2e avec Protractor * limitation de la précision dans les graphiques -Correction de bogues --------- +### Correction de bogues + * redirection des URL invalides vers /list * chargement de paramètres liés * sauvegarde et chargement des valeurs des paramètres @@ -79,8 +80,8 @@ Correction de bogues * renommage et simplification de classes * amélioration de la traduction -Mises à jour de dépendances --------- +### Mises à jour de dépendances + * Angular 7.2 * Compodoc * angular-material @@ -88,5 +89,4 @@ Mises à jour de dépendances * suppression de MDBootstrap * suppression de FontAwesome -4.0.0 - 2018-07-23 -================== +## 4.0.0 - 2018-07-23 diff --git a/README.md b/README.md index 38b3b040b5f98d47f680aa78ee0a3ffb4d550c18..f21cc888e778d43a6a8d728e6b78c3231385f947 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,9 @@ Custom Material SVG Icons will only show up when the application is deployed on export class Toto extends Nub { constructor(prms: TotoParams, dbg: boolean = false) { super(prms, dbg); + // paramètre à calculer par défaut + this._defaultCalculatedParam = prms.A; + this.resetDefaultCalculatedParam(); } /** @@ -152,7 +155,7 @@ Custom Material SVG Icons will only show up when the application is deployed on ## ngHyd -* Créer les fichiers de configuration du module de calcul +1. Créer les fichiers de configuration du module de calcul - dans _src/app/calculators_ : créer un répertoire (par ex _ma-calculette_) - dans _src/app/calculators/ma-calculette_ : @@ -169,7 +172,7 @@ Custom Material SVG Icons will only show up when the application is deployed on Créer les fichiers d'internationalisation (_ma-calculette.<langue>.json_). Il doivent reprendre tous les ids utilisés dans le fichier de configuration et fournir leur traduction. -* créer la classe du formulaire dans _src/app/formulaire/definition/concrete_ +2. **Si nécessaire** créer la classe du formulaire dans _src/app/formulaire/definition/concrete_ . Une classe de base gérant la majorité des cas est déjà disponible, en général cette étape n'est pas nécessaire - Par ex : _FormulaireMaCalculette_ dans _src/app/formulaire/definition/concrete/form-ma-calculette.ts_ @@ -183,10 +186,10 @@ 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. -* _src/locale/messages.<langue>.json_ : +3. _src/locale/messages.<langue>.json_ : Ajouter un champ pour le titre du module de calcul. Par exemple : _"INFO_MACALC_TITRE": "Ma calculette"_ -* Dans la méthode _FormulaireService.getConfigPathPrefix()_, compléter le _switch_ pour fournir le préfixe des fichiers de configuration/internationalisation. +4. Dans le constructeur de _FormulaireService_, ajouter une entrée dans `this.calculatorPaths` pour fournir le préfixe des fichiers de configuration/internationalisation. -* Dans la méthode _FormulaireService.newFormulaire()_, compléter le _switch_ pour fournir la classe à instancier. +5. **Si une nouvelle classe a été créée à l'étape 2**, dans la méthode _FormulaireService.newFormulaire()_, compléter le _switch_ pour fournir la classe à instancier. diff --git a/docs-fr/CHANGELOG.md b/docs-fr/CHANGELOG.md new file mode 120000 index 0000000000000000000000000000000000000000..04c99a55caae5d51f17666f554c2c8cea0aadfc0 --- /dev/null +++ b/docs-fr/CHANGELOG.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/jalhyd_branch b/jalhyd_branch index 1f7391f92b6a3792204e07e99f71f643cc35e7e1..e9797aa3c24e9fceb80162f45beb21d664c4d414 100644 --- a/jalhyd_branch +++ b/jalhyd_branch @@ -1 +1 @@ -master +26-ajout-de-la-calculette-passe-a-bassins-calcul-du-nombre-de-bassins diff --git a/mkdocs.yml b/mkdocs.yml index 7c3c8af0a3f203be2141fc9aea5d0aecd541b9ba..9b224333fae16bb71621c8ac5fbeec629960efb8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -32,4 +32,4 @@ nav: - Passes à macro-rugosité: - calculators/pam/macrorugo.md - calculators/pam/macrorugo_theorie.md - + - CHANGELOG.md diff --git a/src/app/app.component.html b/src/app/app.component.html index 50dad1690423162f37f5f32cd42733eee20a5155..0b4c83e46368616b11f9653e70c79afa9c29b224 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -52,8 +52,8 @@ </div> - <button mat-icon-button id="new-calculator" routerLink="/list" (click)="sidenav.close()"> - <mat-icon *ngIf="currentRoute != '/list'">add_box</mat-icon> + <button *ngIf="currentRoute != '/list'" mat-icon-button id="new-calculator" routerLink="/list" (click)="sidenav.close()"> + <mat-icon>add_box</mat-icon> </button> <div id="toolbar-bottom-spacer"></div> diff --git a/src/app/calculators/pab-chute/pab-chute.config.json b/src/app/calculators/pab-chute/pab-chute.config.json new file mode 100644 index 0000000000000000000000000000000000000000..7dfaaf76b34365313c8e5e29e76baee3774bcbbe --- /dev/null +++ b/src/app/calculators/pab-chute/pab-chute.config.json @@ -0,0 +1,29 @@ +[ + { + "id": "fs_chute", + "type": "fieldset", + "option": "cal", + "fields": [ + { + "type": "input", + "id": "Z1", + "unit": "m" + }, + { + "type": "input", + "id": "Z2", + "unit": "m" + }, + { + "type": "input", + "id": "DH", + "unit": "m" + } + ] + }, + { + "type": "options", + "idCal": "DH", + "help": "pab/chute" + } +] \ No newline at end of file diff --git a/src/app/calculators/pab-chute/pab-chute.en.json b/src/app/calculators/pab-chute/pab-chute.en.json new file mode 100644 index 0000000000000000000000000000000000000000..b10a882c4bdefaafe78bc75918c94971563fee6b --- /dev/null +++ b/src/app/calculators/pab-chute/pab-chute.en.json @@ -0,0 +1,6 @@ +{ + "fs_chute": "Fish ladder elevations and fall", + "Z1": "Upstream elevation", + "Z2": "Downstream elevation", + "DH": "Fall" +} \ No newline at end of file diff --git a/src/app/calculators/pab-chute/pab-chute.fr.json b/src/app/calculators/pab-chute/pab-chute.fr.json new file mode 100644 index 0000000000000000000000000000000000000000..283ed390244fce9f9906ed0b300e40b80cffcfce --- /dev/null +++ b/src/app/calculators/pab-chute/pab-chute.fr.json @@ -0,0 +1,6 @@ +{ + "fs_chute": "Cote et chute de la passe", + "Z1": "Cote amont", + "Z2": "Cote aval", + "DH": "Chute" +} \ No newline at end of file diff --git a/src/app/calculators/pab-nombre/pab-nombre.config.json b/src/app/calculators/pab-nombre/pab-nombre.config.json new file mode 100644 index 0000000000000000000000000000000000000000..1534195af9979fafe13fdfe8a99a2671789725d6 --- /dev/null +++ b/src/app/calculators/pab-nombre/pab-nombre.config.json @@ -0,0 +1,29 @@ +[ + { + "id": "fs_nombre", + "type": "fieldset", + "option": "cal", + "fields": [ + { + "type": "input", + "id": "DHT", + "unit": "m" + }, + { + "type": "input", + "id": "N", + "unit": "" + }, + { + "type": "input", + "id": "DH", + "unit": "m" + } + ] + }, + { + "type": "options", + "idCal": "N", + "help": "pab/nombre" + } +] \ No newline at end of file diff --git a/src/app/calculators/pab-nombre/pab-nombre.en.json b/src/app/calculators/pab-nombre/pab-nombre.en.json new file mode 100644 index 0000000000000000000000000000000000000000..b4b5570ef55f1ff399f1cc0fb4da8ee0ab818678 --- /dev/null +++ b/src/app/calculators/pab-nombre/pab-nombre.en.json @@ -0,0 +1,6 @@ +{ + "fs_nombre": "Fall and number of basins", + "DHT": "Total fall", + "N": "Number of basins", + "DH": "Fall between basins" +} \ No newline at end of file diff --git a/src/app/calculators/pab-nombre/pab-nombre.fr.json b/src/app/calculators/pab-nombre/pab-nombre.fr.json new file mode 100644 index 0000000000000000000000000000000000000000..ac914d8bdf99077b672908e86a5c4409c62cbf38 --- /dev/null +++ b/src/app/calculators/pab-nombre/pab-nombre.fr.json @@ -0,0 +1,6 @@ +{ + "fs_nombre": "Chute et nombre de bassins", + "DHT": "Chute totale", + "N": "Nombre de bassins", + "DH": "Chute entre bassins" +} \ No newline at end of file diff --git a/src/app/config.json b/src/app/config.json index cb7754e64b271455f1e1d128346868fd88441224..86e823ea8cf12655218c8722e3bce223aaf2341a 100644 --- a/src/app/config.json +++ b/src/app/config.json @@ -13,7 +13,7 @@ "title": "Passe à poisson sur le Lez, entre Bollène et Suze", "credits": "Hervé Capra / Irstea" }, - "calculators": [ 5, 6, 10, 9 ] + "calculators": [ 5, 6, 12, 13, 10, 9 ] }, { "name": "PASSE_NATURELLE", diff --git a/src/app/services/formulaire/formulaire.service.ts b/src/app/services/formulaire/formulaire.service.ts index 79f728dcbe4404a21f454ebb9657b523d3fcbad1..1f80b90b46ed17270145e8b54df6e20683806601 100644 --- a/src/app/services/formulaire/formulaire.service.ts +++ b/src/app/services/formulaire/formulaire.service.ts @@ -25,6 +25,9 @@ import { NotificationsService } from "../notifications/notifications.service"; @Injectable() export class FormulaireService extends Observable { + + private calculatorPaths = {}; + /** list of known forms */ private _formulaires: FormulaireDefinition[]; @@ -32,7 +35,6 @@ export class FormulaireService extends Observable { /** to avoid loading language files multiple times */ private languageCache = {}; - constructor( private i18nService: I18nService, private appSetupService: ApplicationSetupService, @@ -42,6 +44,22 @@ export class FormulaireService extends Observable { ) { super(); this._formulaires = []; + + // register calculator config paths here + this.calculatorPaths[CalculatorType.ConduiteDistributrice] = "cond_distri"; + this.calculatorPaths[CalculatorType.LechaptCalmon] = "lechapt-calmon"; + this.calculatorPaths[CalculatorType.SectionParametree] = "section-param"; + this.calculatorPaths[CalculatorType.RegimeUniforme] = "regime-uniforme"; + this.calculatorPaths[CalculatorType.CourbeRemous] = "remous"; + this.calculatorPaths[CalculatorType.PabChute] = "pab-chute"; + this.calculatorPaths[CalculatorType.PabDimensions] = "pab-dimensions"; + this.calculatorPaths[CalculatorType.PabNombre] = "pab-nombre"; + this.calculatorPaths[CalculatorType.PabPuissance] = "pab-puissance"; + this.calculatorPaths[CalculatorType.Structure] = "ouvrages"; + this.calculatorPaths[CalculatorType.ParallelStructure] = "parallel-structures"; + this.calculatorPaths[CalculatorType.Dever] = "dever"; + this.calculatorPaths[CalculatorType.Cloisons] = "cloisons"; + this.calculatorPaths[CalculatorType.MacroRugo] = "macrorugo"; } private get _intlService(): I18nService { @@ -172,12 +190,6 @@ export class FormulaireService extends Observable { private newFormulaire(ct: CalculatorType, jsonState?: {}): FormulaireDefinition { let f: FormulaireDefinition; switch (ct) { - case CalculatorType.ConduiteDistributrice: - case CalculatorType.PabDimensions: - case CalculatorType.PabPuissance: - case CalculatorType.MacroRugo: - f = new FormulaireBase(); - break; case CalculatorType.LechaptCalmon: f = new FormulaireLechaptCalmon(); @@ -202,7 +214,7 @@ export class FormulaireService extends Observable { break; default: - throw new Error(`FormulaireService.newFormulaire() : type de module de calcul ${CalculatorType[ct]} non pris en charge`); + f = new FormulaireBase(); } f.defaultProperties["calcType"] = ct; @@ -337,50 +349,10 @@ export class FormulaireService extends Observable { } public getConfigPathPrefix(ct: CalculatorType): string { - if (ct === undefined) { - throw new Error("FormulaireService.getConfigPathPrefix() : CalculatorType is undefined"); - } - - switch (ct) { - case CalculatorType.ConduiteDistributrice: - return "app/calculators/cond_distri/cond_distri."; - - case CalculatorType.LechaptCalmon: - return "app/calculators/lechapt-calmon/lechapt-calmon."; - - case CalculatorType.SectionParametree: - return "app/calculators/section-param/section-param."; - - case CalculatorType.RegimeUniforme: - return "app/calculators/regime-uniforme/regime-uniforme."; - - case CalculatorType.CourbeRemous: - return "app/calculators/remous/remous."; - - case CalculatorType.PabDimensions: - return "app/calculators/pab-dimensions/pab-dimensions."; - - case CalculatorType.PabPuissance: - return "app/calculators/pab-puissance/pab-puissance."; - - case CalculatorType.Structure: - return "app/calculators/ouvrages/ouvrages."; - - case CalculatorType.ParallelStructure: - return "app/calculators/parallel-structures/parallel-structures."; - - case CalculatorType.Dever: - return "app/calculators/dever/dever."; - - case CalculatorType.Cloisons: - return "app/calculators/cloisons/cloisons."; - - case CalculatorType.MacroRugo: - return "app/calculators/macrorugo/macrorugo."; - - default: - throw new Error("FormulaireService.getConfigPathPrefix() : valeur de CalculatorType " + ct + " non implémentée"); + if (! this.calculatorPaths.hasOwnProperty(ct)) { + throw new Error("FormulaireService.getConfigPathPrefix() : valeur de CalculatorType " + ct + " non implémentée"); } + return "app/calculators/" + this.calculatorPaths[ct] + "/" + this.calculatorPaths[ct] + "."; } /** diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index 8f555f4907f9f935f764aa6e45aec112844a1f3e..76628a0959dbe756eb29bf76873573097ea8288e 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -80,6 +80,7 @@ "INFO_EXTRARES_LIB_B": "Surface width (m)", "INFO_EXTRARES_LIB_CV": "Cv: Velocity coefficient", "INFO_EXTRARES_LIB_CVQT": "CV.QT: Corrected discharge (m³/s)", + "INFO_EXTRARES_LIB_DHR": "DHR : Residual fall (m)", "INFO_EXTRARES_LIB_EC": "EC: Kinetic energy (m)", "INFO_EXTRARES_LIB_ENUM_MACRORUGOFLOWTYPE": "Flow type", "INFO_EXTRARES_LIB_FLU": "Subcritical water line", @@ -155,8 +156,12 @@ "INFO_OPTION_NONE": "None", "INFO_OPTION_NONE_F": "None", "INFO_OUVRAGE": "Structure", + "INFO_PABCHUTE_TITRE": "Fish ladder: fall", + "INFO_PABCHUTE_TITRE_COURT": "FL: fall", "INFO_PABDIMENSIONS_TITRE": "Fish ladder: dimensions", "INFO_PABDIMENSIONS_TITRE_COURT": "FL: dimensions", + "INFO_PABNOMBRE_TITRE": "Fish ladder : number of basins", + "INFO_PABNOMBRE_TITRE_COURT": "FL : number", "INFO_PABPUISSANCE_TITRE": "Fish ladder: dissipated power", "INFO_PABPUISSANCE_TITRE_COURT": "FL: diss. power", "INFO_PARALLELSTRUCTURE_TITRE": "Parallel structures", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index 5d719c76a3249aea9913f20f47ae645fbcd160e9..4a03ee1641ffcf2465629a1e8f96a6490a09572d 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -80,6 +80,7 @@ "INFO_EXTRARES_LIB_B": "Largeur au miroir (m)", "INFO_EXTRARES_LIB_CV": "Cv: Coefficient de vitesse d'approche", "INFO_EXTRARES_LIB_CVQT": "CV.QT: Débit corrigé (m³/s)", + "INFO_EXTRARES_LIB_DHR": "DHR: Chute résiduelle (m)", "INFO_EXTRARES_LIB_EC": "EC: Énergie cinétique (m)", "INFO_EXTRARES_LIB_ENUM_MACRORUGOFLOWTYPE": "Type d'écoulement", "INFO_EXTRARES_LIB_FLU": "Ligne d'eau fluviale", @@ -155,8 +156,12 @@ "INFO_OPTION_NONE": "Aucun", "INFO_OPTION_NONE_F": "Aucune", "INFO_OUVRAGE": "Ouvrage", + "INFO_PABCHUTE_TITRE": "Passe à bassin : chute", + "INFO_PABCHUTE_TITRE_COURT": "PAB : chute", "INFO_PABDIMENSIONS_TITRE": "Passe à bassin : dimensions", "INFO_PABDIMENSIONS_TITRE_COURT": "PAB : dimensions", + "INFO_PABNOMBRE_TITRE": "Passe à bassin : nombre de bassins", + "INFO_PABNOMBRE_TITRE_COURT": "PAB : nombre", "INFO_PABPUISSANCE_TITRE": "Passe à bassin : puissance dissipée", "INFO_PABPUISSANCE_TITRE_COURT": "PAB : puissance", "INFO_PARALLELSTRUCTURE_TITRE": "Lois d'ouvrages",