progress_t.cpp
652 Bytes
#include <stim/ui/progressbar.h>
#include <stim/envi/envi.h>
void progress_thread_envi(stim::envi* e){
unsigned int p = 0;
unsigned int new_p;
e->reset_progress();
while(p != 100){
new_p = (unsigned)e->progress();
if(new_p > p){
p = new_p;
rtsProgressBar(p);
std::cout<<" "<<(double)e->data_rate() / 1000<<" kB/s ";
}
}
std::cout<<endl; //put a newline after the completed progress bar
}
void progress_thread_double(double* e){
unsigned int p = 0;
*e = 0;
rtsProgressBar(p);
while(p != 100){
p = (unsigned)(*e);
rtsProgressBar(p);
}
std::cout<<endl; //put a newline after the completed progress bar
}