Progress update signal for time-expensive tasks
This commit is contained in:
@@ -68,6 +68,9 @@ namespace Bloom
|
||||
);
|
||||
|
||||
std::move(dataSegment.begin(), dataSegment.end(), std::back_inserter(*this->data));
|
||||
emit this->progressUpdate(static_cast<int>(
|
||||
(static_cast<float>(i) + 1) / (static_cast<float>(readsRequired + 1) / 100)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,19 @@ namespace Bloom
|
||||
*/
|
||||
void started();
|
||||
|
||||
/**
|
||||
* Some tasks will emit an InsightWorkerTask::progressUpdate() signal to provide an update on their progress.
|
||||
*
|
||||
* This is used for progress bar widgets.
|
||||
*
|
||||
* NOTE: A task doesn't have to emit this signal. Currently, the time-expensive tasks (like ReadTargetMemory)
|
||||
* emit this signal.
|
||||
*
|
||||
* @param progressPercentage
|
||||
* The task's current progress.
|
||||
*/
|
||||
void progressUpdate(int progressPercentage);
|
||||
|
||||
/**
|
||||
* The InsightWorkerTask::completed() signal will be emitted once the task has successfully completed.
|
||||
*/
|
||||
|
||||
@@ -49,6 +49,9 @@ namespace Bloom
|
||||
);
|
||||
|
||||
std::move(dataSegment.begin(), dataSegment.end(), std::back_inserter(data));
|
||||
emit this->progressUpdate(static_cast<int>(
|
||||
(static_cast<float>(i) + 1) / (static_cast<float>(readsRequired) / 100)
|
||||
));
|
||||
}
|
||||
|
||||
emit this->targetMemoryRead(data);
|
||||
|
||||
Reference in New Issue
Block a user