[Interest] How to properly show progress for a signal processing pipeline

Tony Rietwyk tony at rightsoft.com.au
Mon Apr 8 17:04:53 CEST 2019

Hi Sean,

I would just show one progress set to 3 * raw count.  Each stage 
periodically signals to the ui thread its progress, and whether it has 
processed the end-of-data signal from the previous stage.  In the ui 
thread slot:

int totalCount, rawCount;

QVector<int> stageProgress;

void stageProgressSlot(int stageIndex, int count, bool completed) {

     Q_ASSERT(count <= rawCount);

     auto thisCount = (if completed ? rawCount : count);

     Q_ASSERT(thisCount >= stageProgress[stageIndex]);

     totalCount += thisCount - stageProgress[stageIndex];

     stageProgress[stageIndex] = thisCount;



It will always appear to start slowly then jump forward depending on the 
degree of filtering.  I can't see a way to avoid that other than Bill's 

Hope that helps,  Tony

On 9/04/2019 12:16 am, william.crocker at analog.com wrote:
>>   So the issue I'm having here is that I want to show the user some 
>> sort of progress indicator (this whole pipeline takes a bit of time), 
>> but at the start I only know the raw count, not any of the 
>> intermediate or final counts. And because the A->B->Final portion of 
>> the pipeline takes a noticeable amount of time, I can't just run the 
>> progress bar from 0 to Raw count, because then from the user's 
>> standpoint the progress bar would reach 100% once the number of raw 
>> samples is exhausted, not when processing is fully complete.
> You could show three progress bars, one for each stage.
> Assume each item will pass through each stage (which is pessimistic)
> and show progress based on that. In most cases the whole
> process will finish early based on the bars, but progress
> will be shown.
> Bill
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest

More information about the Interest mailing list