]> git.donarmstrong.com Git - mothur.git/blobdiff - progress.cpp
*** empty log message ***
[mothur.git] / progress.cpp
index 94ad41607064445a2307e5fcd2298403de8424a5..a01ae71fb413031260df2202e3aa56cf6ccbc812 100644 (file)
@@ -7,10 +7,8 @@
  *
  */
 
-#include <iostream>
-#include <string>
+
 #include "progress.hpp"
-#include <exception>
 
 using namespace std;
 
@@ -18,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 << "********************#****#****#****#****#****#****#****#****#****#****#\n";
+               cout << setw(20) << left << job << setw(1) << marker;
                cout.flush();
-       
+
                nTicks = 0;
                finalPos = end;
        }
@@ -41,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);
@@ -74,7 +112,7 @@ void Progress::finish(){
        
        
                cout << endl;
-               cout << "**********************************************************************\n";
+               cout << "***********************************************************************\n";
                cout.flush();
        }
        catch(exception& e) {