Commit b7082144 authored by Mathias Chouet's avatar Mathias Chouet 🍝
Browse files

Fix #156

parent ec5a720d
...@@ -139,7 +139,7 @@ Custom Material SVG Icons will only show up when the application is deployed on ...@@ -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; throw "Toto.Equation() : invalid variable name " + sVarCalc;
} }
return new Result(v); return new Result(v, this);
} }
} }
......
...@@ -6,6 +6,7 @@ import { CalculatorResults } from "../../results/calculator-results"; ...@@ -6,6 +6,7 @@ import { CalculatorResults } from "../../results/calculator-results";
import { I18nService } from "../../services/internationalisation/internationalisation.service"; import { I18nService } from "../../services/internationalisation/internationalisation.service";
import { ApplicationSetupService } from "../../services/app-setup/app-setup.service"; import { ApplicationSetupService } from "../../services/app-setup/app-setup.service";
import * as XLSX from "xlsx"; import * as XLSX from "xlsx";
import { Structure } from "jalhyd";
@Component({ @Component({
selector: "fixed-results", selector: "fixed-results",
...@@ -67,8 +68,14 @@ export class FixedResultsComponent { ...@@ -67,8 +68,14 @@ export class FixedResultsComponent {
const data = []; const data = [];
// 1. fixed parameters // 1. fixed parameters
for (const fp of this.fixedParams) { 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") + "" + (pos + 1) + ": " + label;
}
data.push({ data.push({
label: this.formattedLabel(fp), label: label,
value: this.formattedValue(fp), value: this.formattedValue(fp),
isCalcResult: false // for CSS isCalcResult: false // for CSS
}); });
...@@ -82,8 +89,14 @@ export class FixedResultsComponent { ...@@ -82,8 +89,14 @@ export class FixedResultsComponent {
) { ) {
// 2.1. main result (sometimes empty, for ex. in "Section paramétrée") // 2.1. main result (sometimes empty, for ex. in "Section paramétrée")
if (res.name && res.resultElement.vCalc !== undefined) { 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") + "" + (pos + 1) + ": " + rLabel;
}
data.push({ data.push({
label: this._fixedResults.calculatedParameterHeader, label: rLabel,
value: this.intlService.formatResult(res.name, res.resultElement.vCalc), value: this.intlService.formatResult(res.name, res.resultElement.vCalc),
isCalcResult: true // for CSS isCalcResult: true // for CSS
}); });
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment