diff --git a/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.ts b/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.ts index 9102984c0e3cec2cbb3c94085c55ab8cb45d8742..8352c1fa5bc4aaf8e1aa3dbecc1ac4fd9de3067b 100644 --- a/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.ts +++ b/src/app/components/macrorugo-compound-results/macrorugo-compound-results-table.component.ts @@ -58,27 +58,46 @@ export class MacrorugoCompoundResultsTableComponent extends ResultsComponent { // lines 1 - n-1 for (let i = 0; i < pr.childrenResults.length; i++) { - if ( - pr.childrenResults[i].resultElements[vi].vCalc - ) { - const res = pr.childrenResults[i].resultElements[vi].values; - const nub = (pr.childrenResults[i].sourceNub as MacroRugo); - this._dataSet.push([ - i + 1, // n° radier - nub.prms.ZF1.singleValue.toFixed(nDigits), // @TODO what if ZF1 or B varies ? - nub.prms.B.singleValue.toFixed(nDigits), - res.Q.toFixed(nDigits), - res.ZF2.toFixed(nDigits), - res.Vdeb.toFixed(nDigits), - res.Fr.toFixed(nDigits), - res.Vmax.toFixed(nDigits), - res.PV.toFixed(nDigits), - this.intlService.localizeText("INFO_ENUM_MACRORUGOFLOWTYPE_" + res.ENUM_MacroRugoFlowType), - res.Q_GuideTech.toFixed(nDigits), - (res.V_GuideTech !== undefined ? res.V_GuideTech.toFixed(nDigits) : "-"), - res.xCenter.toFixed(nDigits) - ]); + // @TODO protect loop contents with if(vCalc) ? Will hide erroneous apron results.. + const res = pr.childrenResults[i].resultElements[vi].values; + const nub = (pr.childrenResults[i].sourceNub as MacroRugo); + // does ZF1 or B vary ? + let zf1: number; + try { + if (nub.prms.ZF1.hasMultipleValues) { + zf1 = nub.prms.ZF1.getInferredValuesList()[vi]; + } else { + zf1 = nub.prms.ZF1.singleValue; + } + } catch (e) { + // silent fail } + let b: number; + try { + if (nub.prms.B.hasMultipleValues) { + b = nub.prms.B.getInferredValuesList()[vi]; + } else { + b = nub.prms.B.singleValue; + } + } catch (e) { + // silent fail + } + + this._dataSet.push([ + i + 1, // n° radier + (zf1 !== undefined ? zf1.toFixed(nDigits) : "-"), + (b !== undefined ? b.toFixed(nDigits) : "-"), + res.Q.toFixed(nDigits), + res.ZF2.toFixed(nDigits), + res.Vdeb.toFixed(nDigits), + res.Fr.toFixed(nDigits), + res.Vmax.toFixed(nDigits), + res.PV.toFixed(nDigits), + this.intlService.localizeText("INFO_ENUM_MACRORUGOFLOWTYPE_" + res.ENUM_MacroRugoFlowType), + res.Q_GuideTech.toFixed(nDigits), + (res.V_GuideTech !== undefined ? res.V_GuideTech.toFixed(nDigits) : "-"), + res.xCenter.toFixed(nDigits) + ]); } } } diff --git a/src/app/components/macrorugo-compound-results/macrorugo-compound-results.component.ts b/src/app/components/macrorugo-compound-results/macrorugo-compound-results.component.ts index db564243efe57de8526493a444b5a053925dcd87..20b52128086995ade4b52b69e92f4bae8f710044 100644 --- a/src/app/components/macrorugo-compound-results/macrorugo-compound-results.component.ts +++ b/src/app/components/macrorugo-compound-results/macrorugo-compound-results.component.ts @@ -252,7 +252,6 @@ export class MacrorugoCompoundResultsComponent implements DoCheck { this.generalLogComponent.log = this.globalLog; } - console.log("update ====>", this._mrcResults); if (this.hasResults) { mrcUpdated = this.mrcResultsTableComponent !== undefined; if (mrcUpdated) { diff --git a/src/app/components/variable-results-selector/variable-results-selector.component.ts b/src/app/components/variable-results-selector/variable-results-selector.component.ts index 901c77ebbf5564074a2bf63a4c5c921979900cb0..0ac86ebd1c8f17be30b229129428686221ab6410 100644 --- a/src/app/components/variable-results-selector/variable-results-selector.component.ts +++ b/src/app/components/variable-results-selector/variable-results-selector.component.ts @@ -79,14 +79,22 @@ export class VariableResultsSelectorComponent { } protected entryLabel(index: number): string { - let i = 0; - return this.varValues.map((vv) => { + const kv = []; + for (let i = 0; i < this.varValues.length; i++) { + const vv = this.varValues[i]; const vp = this._results.variatedParameters[i]; - i++; - let value = "0"; - value = vv[index]; - return `${vp.symbol} = ${value}`; - }).join(", "); + let symbol = vp.symbol; + // is vp a parameter of a child Nub ? + if ( + vp.paramDefinition.parentNub + && vp.paramDefinition.parentNub !== vp.paramDefinition.originNub + ) { + const pos = vp.paramDefinition.parentNub.findPositionInParent() + 1; + symbol = this.intlService.localizeText("INFO_LIB_RADIER_N_COURT") + pos + "_" + symbol; + } + kv.push(`${symbol} = ${vv[index]}`); + } + return kv.join(", "); } public get selectedValue(): number { diff --git a/src/locale/messages.en.json b/src/locale/messages.en.json index adcc569bae24b83f24d50568eb65dff37d39e504..5953d1ee7ac8f993cfacff8a76be9978ec9971e8 100644 --- a/src/locale/messages.en.json +++ b/src/locale/messages.en.json @@ -215,9 +215,10 @@ "INFO_LIB_Q": "Discharge", "INFO_LIB_QA": "Attraction flow", "INFO_LIB_R": "Hydraulic radius", - "INFO_LIB_S": "Orifice area", "INFO_LIB_RADIER": "Basin bottom", "INFO_LIB_RADIER_N": "Apron #", + "INFO_LIB_RADIER_N_COURT": "A#", + "INFO_LIB_S": "Orifice area", "INFO_LIB_SELECT_LOIDEBIT": "Stage-discharge law", "INFO_LIB_SELECT_LOIDEBIT1_KIVI": "Kindsvater-Carter and Villemonte", "INFO_LIB_SELECT_LOIDEBIT1": "Stage-discharge law", diff --git a/src/locale/messages.fr.json b/src/locale/messages.fr.json index e5c5de4bf6a613ccbcc60ecd43b2c5a950bd5acc..ba9202669131842939f9eb75b9b6b418ed9d1bbb 100644 --- a/src/locale/messages.fr.json +++ b/src/locale/messages.fr.json @@ -216,6 +216,7 @@ "INFO_LIB_R": "Rayon hydraulique", "INFO_LIB_RADIER": "Radier", "INFO_LIB_RADIER_N": "Radier n°", + "INFO_LIB_RADIER_N_COURT": "R", "INFO_LIB_S": "Surface de l'orifice", "INFO_LIB_SELECT_LOIDEBIT": "Loi de débit", "INFO_LIB_SELECT_LOIDEBIT1_KIVI": "Kindsvater-Carter et Villemonte",