From 6247b79278674b8a55fda73738f1ae474642ec5c Mon Sep 17 00:00:00 2001 From: David Dorchies <david.dorchies@irstea.fr> Date: Mon, 9 Jul 2018 17:49:27 +0200 Subject: [PATCH] Correction bug introduit dans le merge dd33cab1bb --- .../regime-uniforme.config.json | 4 --- src/app/calculators/remous/remous.config.json | 4 --- src/app/calculators/remous/remous.fr.json | 1 - .../section-param/section-param.config.json | 4 --- .../definition/form-compute-fixedvar.ts | 28 ++++++++++--------- 5 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/app/calculators/regime-uniforme/regime-uniforme.config.json b/src/app/calculators/regime-uniforme/regime-uniforme.config.json index 7958e3221..32b228708 100644 --- a/src/app/calculators/regime-uniforme/regime-uniforme.config.json +++ b/src/app/calculators/regime-uniforme/regime-uniforme.config.json @@ -152,11 +152,7 @@ }, { "type": "options", -<<<<<<< HEAD - "defaultNodeType": "SectionTrapeze", -======= "defaultNodeType": "SectionRectangle", ->>>>>>> 043f86cae47e4d5e65ba5c91b9e4ede45aff2428 "idCal": "Q", "sectionSourceId": "fs_section" } diff --git a/src/app/calculators/remous/remous.config.json b/src/app/calculators/remous/remous.config.json index c0b782504..8fcdf1c4d 100644 --- a/src/app/calculators/remous/remous.config.json +++ b/src/app/calculators/remous/remous.config.json @@ -260,11 +260,7 @@ }, { "type": "options", -<<<<<<< HEAD - "defaultNodeType": "SectionTrapeze", -======= "defaultNodeType": "SectionRectangle", ->>>>>>> 043f86cae47e4d5e65ba5c91b9e4ede45aff2428 "sectionSourceId": "select_section", "targetSelectId": "select_target", "methodSelectId": "select_resolution" diff --git a/src/app/calculators/remous/remous.fr.json b/src/app/calculators/remous/remous.fr.json index b3086abb4..98f5971f3 100644 --- a/src/app/calculators/remous/remous.fr.json +++ b/src/app/calculators/remous/remous.fr.json @@ -23,7 +23,6 @@ "Q": "Débit amont", "Yaval": "Tirant d'eau imposé à l'aval", "Yamont": "Tirant d'eau imposé à l'amont", - "fs_param_calc": "Paramètres de calcul", "Dx": "Pas de discrétisation", "Pr": "Précision de calcul des cotes", "select_resolution": "Méthode de résolution", diff --git a/src/app/calculators/section-param/section-param.config.json b/src/app/calculators/section-param/section-param.config.json index ea4e990e7..9268cc7e3 100644 --- a/src/app/calculators/section-param/section-param.config.json +++ b/src/app/calculators/section-param/section-param.config.json @@ -274,11 +274,7 @@ }, { "type": "options", -<<<<<<< HEAD - "defaultNodeType": "SectionTrapeze", -======= "defaultNodeType": "SectionRectangle", ->>>>>>> 043f86cae47e4d5e65ba5c91b9e4ede45aff2428 "sectionSourceId": "select_section", "targetSelectId": "select_target" } diff --git a/src/app/formulaire/definition/form-compute-fixedvar.ts b/src/app/formulaire/definition/form-compute-fixedvar.ts index 9285a6704..837e1eea9 100644 --- a/src/app/formulaire/definition/form-compute-fixedvar.ts +++ b/src/app/formulaire/definition/form-compute-fixedvar.ts @@ -15,15 +15,17 @@ export class FormComputeFixedVar extends FormCompute { } private getVariatedParameter(): NgParameter { - let res = this._formBase.getDisplayedParamFromState(ParamRadioConfig.VAR); - if (res !== undefined) + const res = this._formBase.getDisplayedParamFromState(ParamRadioConfig.VAR); + if (res !== undefined) { return res; + } const pms = this._formBase.getDisplayedParamListFromState(ParamRadioConfig.LINK); - for (const p of pms) - if (p.paramDefinition.hasMultipleValues) + for (const p of pms) { + if (p.paramDefinition.hasMultipleValues) { return p; - + } + } return undefined; } @@ -43,24 +45,24 @@ export class FormComputeFixedVar extends FormCompute { protected compute() { const nub: Nub = this._formBase.currentSessionNub.nub; + let computePrec: number; + if (this._formBase.hasParameter("Pr")) { + computePrec = this._formBase.getParameterValue("Pr"); // précision de calcul + } - if (this._formBase.hasParameter("Pr")) - var computePrec: number = this._formBase.getParameterValue("Pr"); // précision de calcul - - let computedParam: NgParameter = this.getComputedParameter(); + const computedParam: NgParameter = this.getComputedParameter(); this.formResult.addFixedParameters(); - let varParam: NgParameter = this.getVariatedParameter(); + const varParam: NgParameter = this.getVariatedParameter(); - if (varParam == undefined) { + if (varParam === undefined) { // pas de paramètre à varier const res: Result = this.runNubCalc(nub, computedParam, computePrec); this.formResult.fixedResults.result = res; this.formResult.fixedResults.calculatedParameter = computedParam; - } - else { + } else { // il y a un paramètre à varier const res: Result = this.runNubCalc(nub, computedParam, computePrec); -- GitLab