diff --git a/src/app/components/generic-calculator/calculator.component.ts b/src/app/components/generic-calculator/calculator.component.ts index 8a328a71eb872b094146b15f2637cd315821c8b2..cca7416dd060bc8f6a86363264540fea2407d862 100644 --- a/src/app/components/generic-calculator/calculator.component.ts +++ b/src/app/components/generic-calculator/calculator.component.ts @@ -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); + } } }