Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Gnuplot.cc
r36 r39 14 14 15 15 Gnuplot::Gnuplot(void) 16 : linestyle_(" lines"), pipe_(NULL)16 : linestyle_("steps"), pipe_(NULL) 17 17 { 18 18 acquire_program_path("gnuplot"); -
trunk/lib/Gnuplot.h
r36 r39 18 18 /// 19 19 struct GnuplotException : public std::runtime_error 20 { inline GnuplotException(const std::string &msg) : runtime_error(msg) {} };20 { inline GnuplotException(const std::string& msg) : runtime_error(msg) {} }; 21 21 22 22 /// … … 61 61 /// @note The \a style is not checked to be valid. 62 62 /// 63 inline void linestyle( std::stringstyle) { linestyle_=style; }63 inline void linestyle(const std::string& style) { linestyle_=style; } 64 64 65 65 /// … … 68 68 /// called again. 69 69 /// 70 inline void linetitle( std::stringtitle) { linetitle_=title; }70 inline void linetitle(const std::string& title) { linetitle_=title; } 71 71 72 72 /// -
trunk/lib/Stats.cc
r38 r39 10 10 #include <map> 11 11 #include <numeric> 12 #include <sstream> 12 13 #include <string> 13 14 #include <utility> … … 72 73 std::string cmd=std::string("set term png; set output '")+name+".png'"; 73 74 gnuplot_pipe_.command(cmd); 74 gnuplot_pipe_.plot(accumulated()); 75 for (MapConstIter_ i= map_.begin(); i != map_.end(); i++) 76 gnuplot_pipe_.replot(accumulated(i->first)); 75 gnuplot_pipe_.command("set key left Left reverse"); 76 std::vector<double> x=accumulated(); 77 std::stringstream sa; 78 sa << x.back() << " total"; 79 gnuplot_pipe_.linetitle(sa.str()); 80 gnuplot_pipe_.plot(x); 81 for (MapConstIter_ i= map_.begin(); i != map_.end(); i++) { 82 x=accumulated(i->first); 83 std::stringstream s; 84 s << x.back() << " " << i->first; 85 gnuplot_pipe_.linetitle(s.str()); 86 gnuplot_pipe_.replot(x); 87 } 77 88 78 89 // Jari, must rewrite output once since the replots above are not … … 86 97 void Stats::print(std::ostream& os) const 87 98 { 88 std::vector<std::pair<std::string, std::vector<u_int> > > accum;89 for (MapConstIter_ i= map_.begin(); i != map_.end(); i++){90 std::pair<std::string, std::vector<u_int> > element(*i);91 std::partial_sum(element.second.begin(),element.second.end(),92 element.second.begin());93 accum.push_back(element);94 }95 sort(accum.begin(),accum.end(), CodingMore());96 os << "<table>\n";97 for (size_t i = 0; i<accum.size(); i++){98 os << "<tr><td>\n" << accum[i].first << "</td><td>"99 << accum[i].second.back() << "</td></tr>";100 }101 os << "</table>\n";102 103 99 os << "<p><img src='" << plot() << "' alt='[svnstat plot]' border=0></p>\n"; 104 100 } -
trunk/lib/utility.h
r23 r39 58 58 59 59 /// 60 /// Jari, is this obsolete? And thus erasable? 61 /// 60 62 struct CodingMore : 61 63 public std::binary_function<std::pair<std::string,std::vector<u_int> >,
Note: See TracChangeset
for help on using the changeset viewer.