X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=progress.cpp;fp=progress.cpp;h=a01ae71fb413031260df2202e3aa56cf6ccbc812;hb=197c6d3303439582502840980d6a85cf3aab2314;hp=9f3327fc4446beefd1d1a0d7165831f32e48a6d6;hpb=3329385a816a97bdde934d98a615865c29eaacad;p=mothur.git diff --git a/progress.cpp b/progress.cpp index 9f3327f..a01ae71 100644 --- a/progress.cpp +++ b/progress.cpp @@ -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);