diff --git a/README.md b/README.md index f21cc888e778d43a6a8d728e6b78c3231385f947..803a0d3fb85b8b9f913c7069fea7d4312b444014 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ Custom Material SVG Icons will only show up when the application is deployed on throw "Toto.Equation() : invalid variable name " + sVarCalc; } - return new Result(v); + return new Result(v, this); } } diff --git a/src/app/components/fixedvar-results/fixed-results.component.ts b/src/app/components/fixedvar-results/fixed-results.component.ts index 8207c30c1d9c35a2cf293fad04cbf52afcaa65d2..182ed6f68b91106dcc7df37da2ea78f98abec8f5 100644 --- a/src/app/components/fixedvar-results/fixed-results.component.ts +++ b/src/app/components/fixedvar-results/fixed-results.component.ts @@ -6,6 +6,7 @@ import { CalculatorResults } from "../../results/calculator-results"; import { I18nService } from "../../services/internationalisation/internationalisation.service"; import { ApplicationSetupService } from "../../services/app-setup/app-setup.service"; import * as XLSX from "xlsx"; +import { Structure } from "jalhyd"; @Component({ selector: "fixed-results", @@ -67,8 +68,14 @@ export class FixedResultsComponent { const data = []; // 1. fixed parameters for (const fp of this.fixedParams) { + let label = this.formattedLabel(fp); + // add structure position before label + if (fp.paramDefinition.parentNub instanceof Structure) { + const pos = fp.paramDefinition.parentNub.findPositionInParent(); + label = this.intlService.localizeText("INFO_OUVRAGE") + " n°" + (pos + 1) + ": " + label; + } data.push({ - label: this.formattedLabel(fp), + label: label, value: this.formattedValue(fp), isCalcResult: false // for CSS }); @@ -82,8 +89,14 @@ export class FixedResultsComponent { ) { // 2.1. main result (sometimes empty, for ex. in "Section paramétrée") if (res.name && res.resultElement.vCalc !== undefined) { + let rLabel = this._fixedResults.calculatedParameterHeader; + // add structure position before label + if (res.sourceNub instanceof Structure) { + const pos = res.sourceNub.findPositionInParent(); + rLabel = this.intlService.localizeText("INFO_OUVRAGE") + " n°" + (pos + 1) + ": " + rLabel; + } data.push({ - label: this._fixedResults.calculatedParameterHeader, + label: rLabel, value: this.intlService.formatResult(res.name, res.resultElement.vCalc), isCalcResult: true // for CSS });