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

Fix #446 - bugs in Bief when generating sections

parent 995803cb
No related branches found
No related tags found
1 merge request!82Resolve "Ajout de la fonctionnalité "Respect des critères""
Pipeline #138308 passed
......@@ -712,7 +712,11 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe
if (bief.prms.Z1 === bief.calculatedParam) {
return this.hasResults && ! bief.result.hasErrorMessages();
} else {
return true;
// check that linked values are available, if any
return (
(bief.prms.Z1.valueMode !== ParamValueMode.LINK || bief.prms.Z1.referencedValue.isDefined())
&& (bief.prms.ZF1.valueMode !== ParamValueMode.LINK || bief.prms.ZF1.referencedValue.isDefined())
);
}
}
......@@ -721,7 +725,11 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe
if (bief.prms.Z2 === bief.calculatedParam) {
return this.hasResults && ! bief.result.hasErrorMessages();
} else {
return true;
// check that linked values are available, if any
return (
(bief.prms.Z2.valueMode !== ParamValueMode.LINK || bief.prms.Z2.referencedValue.isDefined())
&& (bief.prms.ZF2.valueMode !== ParamValueMode.LINK || bief.prms.ZF2.referencedValue.isDefined())
);
}
}
......@@ -812,7 +820,12 @@ export class GenericCalculatorComponent implements OnInit, DoCheck, AfterViewChe
// do not link Y and If
&& ! [ "If", "Y" ].includes(p.symbol)
) {
p.defineReference(bief.section, p.symbol);
const bP = bief.section.getParameter(p.symbol);
if (bP.valueMode === ParamValueMode.LINK) {
p.defineReference(bP.referencedValue.nub, p.symbol);
} else {
p.defineReference(bief.section, p.symbol);
}
}
}
......
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