Changeset 902


Ignore:
Timestamp:
Nov 27, 2009, 5:12:46 AM (14 years ago)
Author:
Peter Johansson
Message:

fixes #401

It is now possible to build without plplot. It is even possible to
generate reports, which obviously will be without images. If compiling
and HAVE_PLPLOT is not defined, the Graph class becomes a lame empty
class doing nothing (but existing). Needs some revision on README.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Graph.cc

    r886 r902  
    22
    33/*
    4   Copyright (C) 2009 Jari Häkkinen
     4  Copyright (C) 2009 Jari Häkkinen, Peter Johansson
    55
    66  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    3434
    3535  Graph::Graph(const std::string& filename)
     36#ifdef HAVE_PLPLOT
    3637    : plots_(0), pls_(1,1,"svg",filename.c_str()), timeformat_("%y-%b"),
    3738      title_(filename), xmin_(0.0), xmax_(0.0), ymin_(0.0), ymax_(0.0)
     
    4445    pls_.vsta();
    4546  }
     47#else
     48{}
     49#endif
    4650
    4751
     
    6165  {
    6266    // we use colour map 0 position 1 for current colour
     67#ifdef HAVE_PLPLOT
    6368    pls_.scol0a(1,legend.r,legend.g,legend.b,1.0);
     69#endif
    6470  }
    6571
     
    6874  {
    6975    // we use colour map 0 position 1 for current colour
     76#ifdef HAVE_PLPLOT
    7077    pls_.scol0a(1,r,g,b,1.0);
     78#endif
    7179  }
    7280
     
    7583                   unsigned int lines)
    7684  {
     85#ifdef HAVE_PLPLOT
    7786    if (!plots_) {
    7887      xmin_= date_xticks() ? Date(xticks_.front()).seconds() : 0;
     
    116125    pls_.gcol0(1,legend.r,legend.g,legend.b);
    117126    legend_.push_back(legend);
     127#endif
    118128  }
    119129
     
    121131  void Graph::print_legend(void)
    122132  {
     133#ifdef HAVE_PLPLOT
    123134    PLFLT line_length=0.05*xrange_;
    124135    PLFLT x=xmin_+1.7*line_length;
     
    141152      pls_.ptex(x+legend_lines_length+dx  , y, 0, 0, 1, ss.str().c_str());
    142153    }
     154#endif
    143155  }
    144156
  • trunk/lib/Graph.h

    r885 r902  
    55
    66/*
    7   Copyright (C) 2009 Jari Häkkinen
     7  Copyright (C) 2009 Jari Häkkinen, Peter Johansson
    88
    99  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    2323*/
    2424
     25#include <config.h>
     26
    2527#include <string>
    2628#include <vector>
    2729
     30#ifdef HAVE_PLPLOT
    2831#include <plplot/plstream.h>
     32#else
     33typedef int PLINT;
     34typedef double PLFLT;
     35typedef double plstream;
     36#endif
    2937
    3038namespace theplu {
  • trunk/lib/OptionVersion.cc

    r895 r902  
    3434#include <apr_version.h>
    3535
     36#ifdef HAVE_LIB
    3637#include <plplot/plstream.h>
     38#endif
    3739
    3840#include <sstream>
     
    8082      cs << apr_version_string();
    8183      cs << "\n";
     84#ifdef HAVE_LIB
    8285      cs << "using libplplot ";
    8386      plstream pls;
     
    8588      pls.gver(plplot_version);
    8689      cs << plplot_version << "\n";
     90#endif
    8791    }
    8892    exit(0);
  • trunk/test/Makefile.am

    r898 r902  
    4040  $(top_builddir)/lib/yat/libyat.a \
    4141  $(SVN_LIBS) $(APR_LIBS) $(PLPLOT_LIBS)
    42 AM_LDFLAGS = $(SVNDIGEST_LDFLAGS) $(PLPLOT_LDFLAGS)
     42AM_LDFLAGS = $(APR_LDFLAGS) $(SVN_LDFLAGS) $(PLPLOT_LDFLAGS)
    4343
    4444AM_CPPFLAGS = -I$(top_srcdir)/lib $(APR_CPPFLAGS) $(SVN_CPPFLAGS) \
Note: See TracChangeset for help on using the changeset viewer.