]> git.donarmstrong.com Git - mothur.git/blobdiff - progress.cpp
*** empty log message ***
[mothur.git] / progress.cpp
index 9f3327fc4446beefd1d1a0d7165831f32e48a6d6..a01ae71fb413031260df2202e3aa56cf6ccbc812 100644 (file)
@@ -16,14 +16,33 @@ const int totalTicks = 50;
 const char marker = '|';
 
 
+/***********************************************************************/
+
+Progress::Progress(){
+       try {
+               cout << "********************#****#****#****#****#****#****#****#****#****#****#";
+               
+               nTicks = 0;
+               finalPos = 0;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Progress class Function Progress. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Progress class function Progress. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+
 /***********************************************************************/
 
 Progress::Progress(string job, int end){
        try {
                cout << "********************#****#****#****#****#****#****#****#****#****#****#\n";
-               cout << job << marker;
+               cout << setw(20) << left << job << setw(1) << marker;
                cout.flush();
-       
+
                nTicks = 0;
                finalPos = end;
        }
@@ -39,6 +58,27 @@ Progress::Progress(string job, int end){
 
 /***********************************************************************/
 
+void Progress::newLine(string job, int end){
+       try {
+               cout << endl;
+               cout << setw(20) << left << job << setw(1) << marker;
+               cout.flush();
+               
+               nTicks = 0;
+               finalPos = end;
+       }
+       catch(exception& e) {
+               cout << "Standard Error: " << e.what() << " has occurred in the Progress class Function newline. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+       catch(...) {
+               cout << "An unknown error has occurred in the Progress class function newline. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
+               exit(1);
+       }
+}
+       
+/***********************************************************************/
+
 void Progress::update(const int currentPos){
        try {
                int ratio = int(totalTicks * (float)currentPos / finalPos);