Skip to content

Commit

Permalink
fixed multiplex send on output change only bug
Browse files Browse the repository at this point in the history
  • Loading branch information
benkuper committed Mar 4, 2024
1 parent 687785d commit b3179fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ void MappingOutputManager::setOutParams(Array<Parameter *> params, int multiplex
outParams.set(multiplexIndex, Array<WeakReference<Parameter>>(params.getRawDataPointer(), params.size()));
if(outParams.size() > 0) for (auto &o : items) o->setOutParams(outParams[multiplexIndex], multiplexIndex); //better than this ? should handle all ?

prevMergedValue = getMergedOutValue(multiplexIndex);
prevMergedValue.ensureStorageAllocated(multiplexIndex+1);
prevMergedValue.set(multiplexIndex, getMergedOutValue(multiplexIndex));

omAsyncNotifier.addMessage(new OutputManagerEvent(OutputManagerEvent::OUTPUT_CHANGED));
}
Expand All @@ -60,10 +61,10 @@ void MappingOutputManager::updateOutputValues(int multiplexIndex, bool sendOnOut
{
var value = getMergedOutValue(multiplexIndex);
if (value.isVoid()) return; //possible if parameters have been deleted in another thread during process
if (sendOnOutputChangedOnly && value == prevMergedValue) return;
if (sendOnOutputChangedOnly && value == prevMergedValue[multiplexIndex]) return;

for (auto& i : items) i->setValue(value, multiplexIndex);
prevMergedValue = value;
prevMergedValue.set(multiplexIndex, value);
}

void MappingOutputManager::updateOutputValue(MappingOutput * o, int multiplexIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MappingOutputManager :
bool forceDisabled;

Array<Array<WeakReference<Parameter>>> outParams;
var prevMergedValue;
Array<var> prevMergedValue;

void clear() override;

Expand Down

0 comments on commit b3179fa

Please sign in to comment.