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

Fix #269 - expose links in PreBarrage, add spec

parent a38a55a7
This diff is collapsed.
......@@ -701,8 +701,14 @@ export abstract class Nub extends ComputeNode implements IObservable {
// If parameter comes from the same Nub, its parent or any of its children,
// no linking is possible at all.
// Different Structures in the same parent can get linked to each other.
if (! this.isParentOrChildOf(src.nubUid)) {
if (
! this.isParentOrChildOf(src.nubUid)
&& ( // check grand-parent for PreBarrage special case @TODO find a generic way
// to perform both tests (synthesise .nubUid and .originNub.uid)
! (this._calcType === CalculatorType.PreBarrage)
|| ! this.isParentOrChildOf(src.originNub.uid)
)
) {
// 1. own parameters
for (const p of this._prms) {
// if symbol and Nub type are identical
......@@ -782,8 +788,8 @@ export abstract class Nub extends ComputeNode implements IObservable {
}
}
// 3. children Nubs, except for PAB and MRC
if (! (this instanceof Pab || this instanceof MacrorugoCompound)) {
// 3. children Nubs, except for PAB and MRC and PreBarrage
if (!(this instanceof Pab || this instanceof MacrorugoCompound || this._calcType === CalculatorType.PreBarrage)) {
for (const cn of this.getChildren()) {
res = res.concat(cn.getLinkableValues(src));
}
......
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