aboutsummaryrefslogtreecommitdiff
path: root/src/viewerplainpct.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/viewerplainpct.cpp')
-rw-r--r--src/viewerplainpct.cpp45
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
39void ViewerPlainPct::indent() 40void 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
64void 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
60void ViewerPlainPct::beginRequiresCheck( bool bCached, const std::string &sName ) 75void 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
67void ViewerPlainPct::endRequiresCheck() 82void ViewerPlainPct::endRequiresCheck()
68{ 83{
69 iCP++; 84 sCmd.front().iCP++;
70 //bDidReq = true;
71} 85}
72 86
73void ViewerPlainPct::skipRequiresCheck( bool bCached, const std::string &sName ) 87void 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
81void ViewerPlainPct::beginPerform( Perform *pPerform ) 92void 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
88void ViewerPlainPct::endPerform() 99void ViewerPlainPct::endPerform()
89{ 100{
90 //if(!bDidReq) 101 sCmd.front().iCP++;
91 iCP++;
92 //bDidReq = false;
93} 102}
94 103
95void ViewerPlainPct::skipPerform( Perform *pPerform ) 104void 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
103void ViewerPlainPct::beginPerforms( int nCount ) 109void 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
110void ViewerPlainPct::beginAction( const std::string &sName, int nCommands ) 115void ViewerPlainPct::beginAction( const std::string &sName, int nCommands )