Progress bar and multiple threads, decoupling of the graphical interface and logic - which design template will be the best?

I am looking for a design template that matches my application design.

My application processes large amounts of data and creates some graphics. Data processing (sampling from files, computations with intensive computation) and operations with the schedule (drawing, updating) are performed in separate streams.

The chart can be scrolled - in this case, it is necessary to process new pieces of data. Since there can be several rows on a graph, several streams can be created (two streams for each series, one for updating the data set and one for updating the graph).

I do not want to create multiple progress indicators. Instead, I would like to have a single indicator of progress that informs about global progress. Right now I can think of MVC and Observer / Observable, but that is a bit vague :) Maybe someone can point me in the right direction, thanks.

+5
source share
4 answers

I spent most of the week trying to make a smooth, non-hiccup indicator of progress using a very complex algorithm.

6 . , A) , "" , "" B) 2 , , 2 2 2 .

, .

, , , , . 6 , . , . 4- , , .

f1 (..) + f2 (..) + f3 (..) + f4 (..) + f5 (..) + f6 (..) =

, , , . , , 1 40% , , 40 1% . , for-loop 100 000 , , :

for (int i = 0; i < numItems; i++){
     if (i % (numItems / percentageOfTotalForThisStep) == 0) emitProgressEvent();
     .. do the actual processing ..
}

, . , , .

, , - , . ( ), , , .

SO- , - . , , . ;)

+6

/, , , ( ) . , ( Operation) , , , , - .

/ , - - , . , , 6 230 , . , - ( , , - , / ).

, , "" / . , "" , "" , .

, /, , , .

+2

, . , , , (, ). , .

, . , , (, ) .

, , .:)

+1

Stick to the Observer / Observe such things. Some objects observe different series processing flows and report status by updating the dashboard.

+1
source

All Articles