5 * Created by Pat Schloss on 8/14/08.
6 * Copyright 2008 Patrick D. Schloss. All rights reserved.
11 #include "progress.hpp"
13 const int totalTicks = 50;
14 const char marker = '|';
17 /***********************************************************************/
21 mothurOut("********************#****#****#****#****#****#****#****#****#****#****#");
27 errorOut(e, "Progress", "Progress");
32 /***********************************************************************/
34 Progress::Progress(string job, int end){
36 mothurOut("********************#****#****#****#****#****#****#****#****#****#****#\n");
37 cout << setw(20) << left << job << setw(1) << marker;
38 mothurOutJustToLog(job);
39 mothurOut(toString(marker));
46 errorOut(e, "Progress", "Progress");
51 /***********************************************************************/
53 void Progress::newLine(string job, int end){
56 cout << setw(20) << left << job << setw(1) << marker;
57 mothurOutJustToLog(job);
58 mothurOut(toString(marker));
65 errorOut(e, "Progress", "newLine");
70 /***********************************************************************/
72 void Progress::update(const int currentPos){
74 int ratio = int(totalTicks * (float)currentPos / finalPos);
77 for(int i=nTicks;i<ratio;i++){
78 mothurOut(toString(marker));
85 errorOut(e, "Progress", "update");
90 /***********************************************************************/
92 void Progress::finish(){
94 for(int i=nTicks;i<totalTicks;i++){
95 mothurOut(toString(marker));
101 mothurOut("***********************************************************************\n");
104 catch(exception& e) {
105 errorOut(e, "Progress", "finish");
110 /***********************************************************************/