Skip to content
Snippets Groups Projects
Commit b7082144 authored by mathias.chouet's avatar mathias.chouet
Browse files

Fix #156

parent ec5a720d
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
}
......
......@@ -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") + "" + (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") + "" + (pos + 1) + ": " + rLabel;
}
data.push({
label: this._fixedResults.calculatedParameterHeader,
label: rLabel,
value: this.intlService.formatResult(res.name, res.resultElement.vCalc),
isCalcResult: true // for CSS
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment