diff options
Diffstat (limited to '')
| -rw-r--r-- | src/viewerplainpct.cpp | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/src/viewerplainpct.cpp b/src/viewerplainpct.cpp index dcf90ec..9988ca7 100644 --- a/src/viewerplainpct.cpp +++ b/src/viewerplainpct.cpp | |||
| @@ -33,7 +33,8 @@ void ViewerPlainPct::endCommand() | |||
| 33 | if( sCmd.front().bCmdClean == false ) | 33 | if( sCmd.front().bCmdClean == false ) |
| 34 | printf("\n"); | 34 | printf("\n"); |
| 35 | sCmd.pop_front(); | 35 | sCmd.pop_front(); |
| 36 | iCC++; | 36 | if(sCmd.empty()) |
| 37 | iCC++; | ||
| 37 | } | 38 | } |
| 38 | 39 | ||
| 39 | void ViewerPlainPct::indent() | 40 | void ViewerPlainPct::indent() |
| @@ -53,58 +54,62 @@ void ViewerPlainPct::printHead() | |||
| 53 | bRunClean = false; | 54 | bRunClean = false; |
| 54 | sCmd.front().bCmdClean = false; | 55 | sCmd.front().bCmdClean = false; |
| 55 | indent(); | 56 | indent(); |
| 56 | printf("--- [%d/%d] %s ---\n", iCC, iTC, sCmd.front().sTarget.c_str() ); | 57 | if(sCmd.size() > 1) |
| 58 | printf("--- %s ---\n", sCmd.front().sTarget.c_str() ); | ||
| 59 | else | ||
| 60 | printf("--- [%d/%d] %s ---\n", iCC, iTC, sCmd.front().sTarget.c_str() ); | ||
| 57 | } | 61 | } |
| 58 | } | 62 | } |
| 59 | 63 | ||
| 64 | void ViewerPlainPct::printPerform(const char *sRule, const char *sTarget) | ||
| 65 | { | ||
| 66 | int iPct = (int)round( | ||
| 67 | ((double)sCmd.front().iCP/(double)sCmd.front().iTP)*100.0 | ||
| 68 | ); | ||
| 69 | if(sCmd.size() > 1) | ||
| 70 | printf( "[%3d%%] %8s: %s\n", iPct, sRule, sTarget ); | ||
| 71 | else | ||
| 72 | printf( "[%3d%%] %8s: %s\n", iPct, sRule, sTarget ); | ||
| 73 | } | ||
| 74 | |||
| 60 | void ViewerPlainPct::beginRequiresCheck( bool bCached, const std::string &sName ) | 75 | void ViewerPlainPct::beginRequiresCheck( bool bCached, const std::string &sName ) |
| 61 | { | 76 | { |
| 62 | printHead(); | 77 | printHead(); |
| 63 | indent(); | 78 | indent(); |
| 64 | printf("[%3d%%] deps: %s\n", (int)round(((double)iCP/(double)iTP)*100.0), sName.c_str() ); | 79 | printPerform("deps", sName.c_str()); |
| 65 | } | 80 | } |
| 66 | 81 | ||
| 67 | void ViewerPlainPct::endRequiresCheck() | 82 | void ViewerPlainPct::endRequiresCheck() |
| 68 | { | 83 | { |
| 69 | iCP++; | 84 | sCmd.front().iCP++; |
| 70 | //bDidReq = true; | ||
| 71 | } | 85 | } |
| 72 | 86 | ||
| 73 | void ViewerPlainPct::skipRequiresCheck( bool bCached, const std::string &sName ) | 87 | void ViewerPlainPct::skipRequiresCheck( bool bCached, const std::string &sName ) |
| 74 | { | 88 | { |
| 75 | iCP++; | 89 | sCmd.front().iCP++; |
| 76 | /* printHead(); | ||
| 77 | indent(); | ||
| 78 | printf("[%3d%%] ! deps: %s\n", (int)round(((double)iCP/(double)iTP)*100.0), sName.c_str() );*/ | ||
| 79 | } | 90 | } |
| 80 | 91 | ||
| 81 | void ViewerPlainPct::beginPerform( Perform *pPerform ) | 92 | void ViewerPlainPct::beginPerform( Perform *pPerform ) |
| 82 | { | 93 | { |
| 83 | printHead(); | 94 | printHead(); |
| 84 | indent(); | 95 | indent(); |
| 85 | printf("[%3d%%] %8s: %s\n", (int)round(((double)iCP/(double)iTP)*100.0), pPerform->getRule().c_str(), pPerform->getTarget().c_str() ); | 96 | printPerform(pPerform->getRule().c_str(), pPerform->getTarget().c_str()); |
| 86 | } | 97 | } |
| 87 | 98 | ||
| 88 | void ViewerPlainPct::endPerform() | 99 | void ViewerPlainPct::endPerform() |
| 89 | { | 100 | { |
| 90 | //if(!bDidReq) | 101 | sCmd.front().iCP++; |
| 91 | iCP++; | ||
| 92 | //bDidReq = false; | ||
| 93 | } | 102 | } |
| 94 | 103 | ||
| 95 | void ViewerPlainPct::skipPerform( Perform *pPerform ) | 104 | void ViewerPlainPct::skipPerform( Perform *pPerform ) |
| 96 | { | 105 | { |
| 97 | iCP++; | 106 | sCmd.front().iCP++; |
| 98 | /* printHead(); | ||
| 99 | indent(); | ||
| 100 | printf("[%3d%%] ! %8s: %s\n", (int)round(((double)iCP/(double)iTP)*100.0), pPerform->getRule().c_str(), pPerform->getTarget().c_str() );*/ | ||
| 101 | } | 107 | } |
| 102 | 108 | ||
| 103 | void ViewerPlainPct::beginPerforms( int nCount ) | 109 | void ViewerPlainPct::beginPerforms( int nCount ) |
| 104 | { | 110 | { |
| 105 | iTP = nCount*2; | 111 | sCmd.front().iTP = nCount*2; |
| 106 | iCP = 1; | 112 | sCmd.front().iCP = 1; |
| 107 | //bDidReq = false; | ||
| 108 | } | 113 | } |
| 109 | 114 | ||
| 110 | void ViewerPlainPct::beginAction( const std::string &sName, int nCommands ) | 115 | void ViewerPlainPct::beginAction( const std::string &sName, int nCommands ) |
