diff --git a/src/app/components/fixedvar-results/fixedvar-results.component.ts b/src/app/components/fixedvar-results/fixedvar-results.component.ts index 68e5c7f4bc15f8e51d34d52e6fbde75d5174daf9..7908509065b6b4c505c8c8b5c5624cb6adc5bf01 100644 --- a/src/app/components/fixedvar-results/fixedvar-results.component.ts +++ b/src/app/components/fixedvar-results/fixedvar-results.component.ts @@ -95,9 +95,9 @@ export class FixedVarResultsComponent implements DoCheck { this._doUpdate = false; if (this._fixedResults != undefined) - this._doUpdate = this._fixedResults.hasResults; + this._doUpdate = this._fixedResults.hasResults || this._fixedResults.hasLog; if (this._varResults != undefined) - this._doUpdate = this._doUpdate || this._varResults.hasResults; + this._doUpdate = this._doUpdate || this._varResults.hasResults || this._varResults.hasLog; } public ngDoCheck() { @@ -105,12 +105,22 @@ export class FixedVarResultsComponent implements DoCheck { this._doUpdate = !this.updateResults(); } + private mergeLog(result: Result, log: cLog) { + if (result && result.hasLog) { + if (result.hasGlobalLog) + log.addLog(result.globalLog); + else + log.addLog(result.log); + } + } + private get mergedGlobalLogs(): cLog { const res = new cLog(); - if (this._fixedResults && this._fixedResults.log) - res.addLog(this._fixedResults.log); - if (this._varResults && this._varResults.log) - res.addLog(this._varResults.log); + if (this._fixedResults) + this.mergeLog(this._fixedResults.result, res); + + if (this._varResults) + this.mergeLog(this._varResults.result, res); return res; } diff --git a/src/app/results/param-calc-results.ts b/src/app/results/param-calc-results.ts index 2e9802f803486039157de38b5307dbab42aa6215..4a24add19472a5ec071a2689a69a3b8b8158aa1f 100644 --- a/src/app/results/param-calc-results.ts +++ b/src/app/results/param-calc-results.ts @@ -44,6 +44,12 @@ export abstract class CalculatedParamResults extends CalculatorResults { return this._result.ok; } + public get hasLog(): boolean { + if (this._result == undefined) + return false; + return this._result.hasLog; + } + public get log(): cLog { return this._result && this._result.log; // return x == undefined ? undefined : x.y } diff --git a/src/locale/error_messages.en.json b/src/locale/error_messages.en.json index 2711bac574daabb623a51b46ae81540d8ab5fa2b..86f94a5086460e25136ae11c518ef214b265022b 100644 --- a/src/locale/error_messages.en.json +++ b/src/locale/error_messages.en.json @@ -5,6 +5,7 @@ "ERROR_DICHO_NULL_STEP": "Dichotomy (initial interval search): invalid null step", "ERROR_DICHO_INVALID_STEP_GROWTH": "Dichotomy (initial interval search): invalid null step growth", "ERROR_DICHO_FUNCTION_VARIATION": "unable to determinate function direction of variation", + "ERROR_DICHO_CONVERGE": "Dichotomy could not converge", "ERROR_NEWTON_DERIVEE_NULLE": "Null function derivative in Newton computation", "ERROR_PARAMDOMAIN_INTERVAL_BOUNDS": "invalid %minValue%/%maxValue% min/max boundaries for 'interval' parameter definition domain", "ERROR_PARAMDEF_CALC_UNDEFINED": "calculability of '%symbol%' parameter is undefined", @@ -81,4 +82,4 @@ "INFO_PABDIM_TITRE": "Pool pass: dimensions", "INFO_PABPUISS_TITRE": "Pool pass: dissipated power", "INFO_OUVRAGEPARAL_TITRE": "Parallel structures" -} +} \ No newline at end of file diff --git a/src/locale/error_messages.fr.json b/src/locale/error_messages.fr.json index d08817f011651620fee26500581836e228a4a4cf..f336ee9cf6bd52b02202c52ad785d959789f5b84 100644 --- a/src/locale/error_messages.fr.json +++ b/src/locale/error_messages.fr.json @@ -5,6 +5,7 @@ "ERROR_DICHO_NULL_STEP": "Dichotomie : le pas pour la recherche de l'intervalle de départ ne devrait pas être nul", "ERROR_DICHO_INVALID_STEP_GROWTH": "Dichotomie : l'augmentation du pas pour la recherche de l'intervalle de départ est incorrecte (=0)", "ERROR_DICHO_FUNCTION_VARIATION": "Dichotomie : impossible de determiner le sens de variation de la fonction", + "ERROR_DICHO_CONVERGE": "La dichotomie n'a pas pu converger", "ERROR_NEWTON_DERIVEE_NULLE": "Dérivée nulle dans un calcul par la méthode de Newton", "ERROR_PARAMDOMAIN_INTERVAL_BOUNDS": "Les bornes (%minValue%/%maxValue%) de l'intervalle sont incorrectes", "ERROR_PARAMDEF_CALC_UNDEFINED": "La calculabilité du paramètre %symbol% n'est pas définie",