Closed biochem-fan closed 3 years ago
This is caused byaddMissingLabels()
failing to set unknowLabelNames
. Also have to check if unknownLabelPosition2Offset
is valid after deleting some labels.
label2offset[l] < 0
: This check is not sufficient with more than one unknownLabels.
activeLabel
mechanism is not good; we cannot distinguish different unknownLabels.
label2Offset
is the culprit. We might have several EMDL_UNKNOWN_LABEL
s.
We need a map<string, int>
for unknown labels. Oops, this is extremely messy. Perhaps we should use (int)EMDL_UNKNOWN_LABEL + i
instead? But label2offset
needs a fixed size...
We should not erase items from activeLabels
but instead set to -1 or something. Let's call this labels
. Then unknownLabelPosition2Offset
becomes easier to maintain, since labelPos = physical pos in a table, constant even after deactivateLabel
.
When we loop over labels (e.g. write
or compare
):
unknownLabelPosition2Offset
to get the array offset. Also use unknownLabelNames
to get the column name.OR
Keep activeLabels
as is, but change unknownLabelPosition2Offset
to vector and erase the same element when activeLabels
are updated. Then unknownLabelNames[unknownLabelPosition2Offset[i]]
will give the column name.
Need to test:
desiredLabels
mechanism can be removed? Currently it is broken.
containsLabel
and labelExists
seem redundant.
Working via the "Keep activeLabels as is, but change unknownLabelPosition2Offset to vector and erase the same element when activeLabels are updated" route.
deactivateLabel
is OK now, combine
needs more work.
Fixed in f295c96.
Reported by Andres Gonzales.
Somehow
unknownLabelNames
is empty...