Changeset 858
- Timestamp:
- Nov 19, 2009, 8:45:31 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 deleted
- 10 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/README
r806 r858 43 43 consequence, the dependency is inherited by svndigest. 44 44 45 * Gnuplot. 45 * PLplot, http://plplot.sourceforge.net, and pkg-config utility, 46 http://pkg-config.freedesktop.org, to query infomration about 47 PLplot headers and libs. 46 48 47 49 * A standard C++ compliant compiler with one extension: svndigest … … 114 116 {{{ 115 117 Copyright (C) 2005, 2006 Jari Häkkinen 116 Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson 117 Copyright (C) 2009 Peter Johansson 118 Copyright (C) 2007, 2008, 2009 Jari Häkkinen, Peter Johansson 118 119 119 120 This file is part of svndigest, http://dev.thep.lu.se/svndigest -
trunk/bin/Makefile.am
r847 r858 30 30 LDADD = $(top_builddir)/lib/libsvndigest.a \ 31 31 $(top_builddir)/lib/yat/libyat.a $(SVNDIGEST_LIBS) 32 AM_LDFLAGS = $(SVNDIGEST_LDFLAGS) 32 AM_LDFLAGS = $(SVNDIGEST_LDFLAGS) $(PLPLOT_LDFLAGS) 33 33 34 34 AM_CPPFLAGS = -I$(top_srcdir)/lib $(SVNDIGEST_CPPFLAGS) -
trunk/bin/svndigest.cc
r847 r858 27 27 #include "Directory.h" 28 28 #include "first_page.h" 29 #include "GnuplotFE.h"30 29 #include "html_utility.h" 31 30 #include "rmdirhier.h" … … 179 178 dates.push_back(iter->date()); 180 179 } 181 GnuplotFE::instance()->set_dates(dates);180 // GnuplotFE::instance()->set_dates(dates); 182 181 } 183 182 if (chdir(option->targetdir().c_str()) ) { … … 190 189 exit(-1); 191 190 } 192 GnuplotFE::instance()->command(std::string("cd '")+option->targetdir()+"/"193 +tree->name()+"'");191 // GnuplotFE::instance()->command(std::string("cd '")+option->targetdir()+"/" 192 // +tree->name()+"'"); 194 193 print_css("svndigest.css"); 195 194 print_main_page(tree->name(), tree->log(), stats, tree->url()); -
trunk/configure.ac
r847 r858 82 82 AC_PATH_PROG([HELP2MAN], [help2man], [no]) 83 83 AM_CONDITIONAL([HAVE_HELP2MAN], [test x$HELP2MAN != xno]) 84 AC_PATH_PROG([GNUPLOT],[gnuplot],[no]) 85 AC_DEFINE_UNQUOTED([GNUPLOT_PATH], ["$GNUPLOT"], 86 [defined to gnuplot path (or no if gnuplot was not found)]) 84 PKG_PROG_PKG_CONFIG([0.23]) # look for pkg-config 87 85 88 86 # Save FLAGS … … 178 176 # check if svnversion is installed 179 177 AC_PATH_PROG([SVNVERSION], [svnversion], [no]) 178 179 # PLplot API checks 180 plplot_found="yes" 181 plplot_version=5.9 182 AC_CHECK_HEADER([plplot/plstream.h], 183 [if $PKG_CONFIG --atleast-version=$plplot_version plplotd-c++; then 184 PLPLOT_LDFLAGS=`$PKG_CONFIG --libs plplotd-c++` 185 AC_SUBST([PLPLOT_LDFLAGS]) 186 else 187 plplot_found="nolib" 188 fi], 189 plplot_found="noheader") 180 190 181 191 # checking if we build in a subversion WC … … 268 278 fi 269 279 280 # Non-existing PLplot API is fatal -- sub-sequent compilation will fail. 281 if (test "$plplot_found" = "noheader") ; then 282 AC_MSG_WARN([PLplot developer files cannot be found. Make sure PLplot 283 is installed.]) 284 all_reqs_ok="false" 285 elif (test "$plplot_found" = "nolib") ; then 286 AC_MSG_WARN([PLplot developer files found but not required API version. 287 Version at least $plplot_version is required. Please upgrade PLplot.]) 288 all_reqs_ok="false" 289 fi 290 270 291 if test $ac_cv_type_long_long_int != yes ; then 271 292 AC_MSG_WARN([Compiler $CXX does not support `long long'. … … 294 315 AC_MSG_NOTICE([ Linker flags: $SD_LDFLAGS $LDFLAGS]) 295 316 AC_MSG_NOTICE([ LIBS: $SD_LIBS $LIBS]) 317 AC_MSG_NOTICE([ PLPLOT_LDFLAGS: $PLPLOT_LDFLAGS]) 296 318 AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++]) 297 319 AC_MSG_NOTICE([]) 298 320 299 # Failure to locate gnuplot is not considered fatal300 if (test "x$GNUPLOT" = "xno") ; then301 AC_MSG_WARN([Gnuplot was not found. svndigest will compile302 without gnuplot but will throw an exception at run-time. Please303 install gnuplot (available for a wide range of operating systems304 at http://www.gnuplot.info).])305 AC_MSG_NOTICE([])306 fi307 308 321 AC_MSG_NOTICE([Now type 'make && make check'.]) -
trunk/lib/File.cc
r847 r858 2 2 3 3 /* 4 Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson 5 Copyright (C) 2009 Peter Johansson 4 Copyright (C) 2005, 2006, 2007, 2008, 2009 Jari Häkkinen, Peter Johansson 6 5 7 6 This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 26 25 #include "Configuration.h" 27 26 #include "Date.h" 28 #include "G nuplotFE.h"27 #include "Graph.h" 29 28 #include "html_utility.h" 30 29 #include "HtmlStream.h" … … 258 257 int first=0; 259 258 bool using_dates=true; 260 if ( GnuplotFE::instance()->dates().empty()){259 if (!Graph::date_xticks()) { 261 260 using_dates=false; 262 261 last = stats_["classic"].revision(); 263 262 } 264 263 else { 265 last = Date(G nuplotFE::instance()->dates().back()).seconds();264 last = Date(Graph::xticks().back()).seconds(); 266 265 // earliest date corresponds either to revision 0 or revision 1 267 first = std::min(Date(G nuplotFE::instance()->dates()[0]).seconds(),268 Date(G nuplotFE::instance()->dates()[1]).seconds());266 first = std::min(Date(Graph::xticks()[0]).seconds(), 267 Date(Graph::xticks()[1]).seconds()); 269 268 } 270 269 // color is calculated linearly on time, c = kt + m -
trunk/lib/Makefile.am
r847 r858 4 4 5 5 # Copyright (C) 2005 Jari Häkkinen 6 # Copyright (C) 2006, 2007, 2008 Jari Häkkinen, Peter Johansson 7 # Copyright (C) 2009 Peter Johansson 6 # Copyright (C) 2006, 2007, 2008, 2009 Jari Häkkinen, Peter Johansson 8 7 # 9 8 # This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 35 34 Commitment.h Configuration.h copyright_year.h css.h\ 36 35 Date.h Directory.h File.h first_page.h Functor.h \ 37 G nuplot.h GnuplotFE.h \36 Graph.h \ 38 37 HtmlBuf.h HtmlStream.h html_utility.h LineTypeParser.h \ 39 38 Node.h … … 46 45 Commitment.cc Configuration.cc copyright_year.cc \ 47 46 css.cc Date.cc Directory.cc File.cc first_page.cc\ 48 Functor.cc G nuplot.cc GnuplotFE.ccHtmlBuf.cc HtmlStream.cc \47 Functor.cc Graph.cc HtmlBuf.cc HtmlStream.cc \ 49 48 html_utility.cc LineTypeParser.cc Node.cc \ 50 49 OptionVersion.cc \ -
trunk/lib/Stats.cc
r847 r858 25 25 26 26 #include "Functor.h" 27 #include "G nuplotFE.h"27 #include "Graph.h" 28 28 #include "SVNblame.h" 29 29 #include "SVNinfo.h" … … 352 352 const std::string& linetype) const 353 353 { 354 return filename; 354 355 assert(total_stats().size()); 355 plot_init(filename); 356 GnuplotFE* gp=GnuplotFE::instance(); 356 Graph gp(filename); 357 357 const Author2Vector* stat=NULL; 358 358 if (linetype=="total") … … 369 369 std::vector<unsigned int> total=get_vector(*stat, "all"); 370 370 double yrange_max=1.03*total.back()+1; 371 gp ->yrange(yrange_max);371 gp.yrange(yrange_max); 372 372 373 373 typedef std::vector<std::pair<std::string, std::vector<unsigned int> > > vec_type; … … 393 393 ss.str(""); 394 394 ss << "set key height " << 2*plotno; 395 gp->command(ss.str());395 // gp->command(ss.str()); 396 396 ss.str(""); 397 397 ss << get_back(*stat, i->first) << " " << i->first; 398 gp ->yrange(yrange_max);399 gp->linetitle(ss.str());398 gp.yrange(yrange_max); 399 // gp->linetitle(ss.str()); 400 400 ss.str(""); 401 401 ss << "steps " << --plotno+2; 402 gp->linestyle(ss.str());403 gp->plot(i->second);402 // gp->linestyle(ss.str()); 403 // gp->plot(i->second); 404 404 } 405 405 ss.str(""); 406 406 ss << get_back(*stat, "all") << " total"; 407 gp->command("set key height 0"); 408 gp->linetitle(ss.str()); 409 gp->linestyle("steps 1"); 410 gp->plot(total); 411 412 gp->command("unset multiplot"); 413 gp->yrange(); 407 // gp->command("set key height 0"); 408 // gp->linetitle(ss.str()); 409 // gp->linestyle("steps 1"); 410 // gp->plot(total); 411 412 // gp->command("unset multiplot"); 414 413 415 414 return filename; … … 417 416 418 417 419 void Stats::plot_init(const std::string& filename) const420 {421 GnuplotFE* gp=GnuplotFE::instance();422 gp->command("set term png");423 gp->command("set output '"+filename+"'");424 gp->command("set xtics nomirror");425 gp->command("set ytics nomirror");426 gp->command("set key default");427 gp->command("set key left Left reverse");428 gp->command("set multiplot");429 }430 431 432 418 void Stats::plot_summary(const std::string& filename) const 433 419 { 434 plot_init(filename); 435 GnuplotFE* gp=GnuplotFE::instance(); 420 Graph gp(filename); 436 421 std::vector<unsigned int> total = get_vector(total_stats(), "all"); 437 422 double yrange_max=1.03*total.back()+1; 438 gp ->yrange(yrange_max);423 gp.yrange(yrange_max); 439 424 std::stringstream ss; 440 425 … … 442 427 std::vector<unsigned int> x(get_vector(code_stats(), "all")); 443 428 ss << x.back() << " code"; 444 gp->command("set key height 2");445 gp->linetitle(ss.str());446 gp->linestyle("steps 2");447 gp->plot(x);429 // gp->command("set key height 2"); 430 // gp->linetitle(ss.str()); 431 // gp->linestyle("steps 2"); 432 // gp->plot(x); 448 433 449 434 ss.str(""); 450 435 x = get_vector(comment_or_copy_stats(), "all"); 451 436 ss << x.back() << " comment"; 452 gp->command("set key height 4");453 gp->linetitle(ss.str());454 gp->linestyle("steps 3");455 gp->plot(x);437 // gp->command("set key height 4"); 438 // gp->linetitle(ss.str()); 439 // gp->linestyle("steps 3"); 440 // gp->plot(x); 456 441 457 442 ss.str(""); 458 443 x = get_vector(other_stats(), "all"); 459 444 ss << x.back() << " other"; 460 gp->command("set key height 6");461 gp->linetitle(ss.str());462 gp->linestyle("steps 4");463 gp->plot(x);445 // gp->command("set key height 6"); 446 // gp->linetitle(ss.str()); 447 // gp->linestyle("steps 4"); 448 // gp->plot(x); 464 449 465 450 ss.str(""); 466 451 ss << total.back() << " total"; 467 gp->command("set key height 0"); 468 gp->linetitle(ss.str()); 469 gp->linestyle("steps 1"); 470 gp->plot(total); 471 472 gp->command("unset multiplot"); 473 gp->yrange(); 452 // gp->command("set key height 0"); 453 // gp->linetitle(ss.str()); 454 // gp->linestyle("steps 1"); 455 gp.plot(total); 456 457 // gp->command("unset multiplot"); 474 458 } 475 459 -
trunk/lib/Stats.h
r847 r858 191 191 Author2Vector& map); 192 192 193 ///194 /// Init statistics graph.195 ///196 void plot_init(const std::string& output) const;197 198 193 std::set<std::string> authors_; 199 194 -
trunk/lib/first_page.cc
r847 r858 226 226 void print_summary_plot(std::ostream& os, const Stats& stats) 227 227 { 228 std::string name("summary_plot .png");228 std::string name("summary_plot"); 229 229 stats.plot_summary(name); 230 230 os << "<div class=\"main\">\n"; -
trunk/test/Makefile.am
r847 r858 3 3 ## $Id$ 4 4 5 # Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson 6 # Copyright (C) 2009 Peter Johansson 5 # Copyright (C) 2005, 2006, 2007, 2008, 2009 Jari Häkkinen, Peter Johansson 7 6 # 8 7 # This file is part of svndigest, http://dev.thep.lu.se/svndigest … … 24 23 25 24 check_PROGRAMS = cache_partial_test \ 26 config_test copyright_test date_test gnuplot_pipe_test\25 config_test copyright_test date_test \ 27 26 parser_test stats_test trac_test utility_test 28 27 … … 41 40 $(top_builddir)/lib/yat/libyat.a \ 42 41 $(SVNDIGEST_LIBS) 43 AM_LDFLAGS = $(SVNDIGEST_LDFLAGS) 42 AM_LDFLAGS = $(SVNDIGEST_LDFLAGS) $(PLPLOT_LDFLAGS) 44 43 45 44 AM_CPPFLAGS = -I$(top_srcdir)/lib $(SVNDIGEST_CPPFLAGS) … … 52 51 copyright_test_SOURCES = copyright_test.cc 53 52 date_test_SOURCES = date_test.cc 54 gnuplot_pipe_test_SOURCES = gnuplot_pipe_test.cc55 53 parser_test_SOURCES = parser_test.cc 56 54 stats_test_SOURCES = stats_test.cc
Note: See TracChangeset
for help on using the changeset viewer.