Changeset 1330 for trunk


Ignore:
Timestamp:
Jan 27, 2011, 2:49:35 AM (10 years ago)
Author:
Peter Johansson
Message:

change confusing function and variable from xticks to dates (the vector holds the date/time for each revision).

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FilePrinter.cc

    r1321 r1330  
    118118    }
    119119    else {
    120       first = Graph::xticks()[Graph::rev_min()];
    121       assert(Graph::rev_max()<Graph::xticks().size());
    122       last = Graph::xticks()[Graph::rev_max()];
     120      first = Graph::dates()[Graph::rev_min()];
     121      assert(Graph::rev_max()<Graph::dates().size());
     122      last = Graph::dates()[Graph::rev_max()];
    123123    }
    124124    assert(last>first);
  • trunk/lib/Graph.cc

    r1329 r1330  
    3535  svn_revnum_t Graph::rev_max_=0;
    3636  svn_revnum_t Graph::rev_min_=0;
    37   std::vector<time_t> Graph::xticks_;
     37  std::vector<time_t> Graph::dates_;
    3838
    3939  Graph::Graph(const std::string& filename, const std::string& format)
     
    6666  bool Graph::date_xticks(void)
    6767  {
    68     return xticks_.size() != 0;
     68    return dates_.size() != 0;
    6969  }
    7070
     
    9393#ifdef HAVE_PLPLOT
    9494    if (!plots_) {
    95       assert(!date_xticks() || rev_min_<xticks_.size());
    96       assert(!date_xticks() || xticks_[rev_min_]);
    97       assert(rev_min_<xticks_.size() || !date_xticks());
    98       xmin_= date_xticks() ? xticks_[rev_min_] : rev_min_;
    99       assert(rev_max_<xticks_.size() || !date_xticks());
    100       xmax_= date_xticks() ? xticks_[rev_max_] : rev_max_;
     95      assert(!date_xticks() || rev_min_<dates_.size());
     96      assert(!date_xticks() || dates_[rev_min_]);
     97      assert(rev_min_<dates_.size() || !date_xticks());
     98      xmin_= date_xticks() ? dates_[rev_min_] : rev_min_;
     99      assert(rev_max_<dates_.size() || !date_xticks());
     100      xmax_= date_xticks() ? dates_[rev_max_] : rev_max_;
    101101      xrange_=xmax_-xmin_;
    102102      yrange_=ymax_-ymin_;
     
    192192  void Graph::set_dates(const std::vector<time_t>& date)
    193193  {
    194     xticks_=date;
     194    dates_=date;
    195195  }
    196196
     
    202202    PLFLT x1 = rev1;
    203203    if (date_xticks()) {
    204       assert(rev0<xticks_.size());
    205       assert(xticks_[rev0]);
    206       x0 = xticks_[rev0];
    207       assert(rev1<xticks_.size());
    208       assert(xticks_[rev1]);
    209       x1 = xticks_[rev1];
     204      assert(rev0<dates_.size());
     205      assert(dates_[rev0]);
     206      x0 = dates_[rev0];
     207      assert(rev1<dates_.size());
     208      assert(dates_[rev1]);
     209      x1 = dates_[rev1];
    210210    }
    211211#ifdef HAVE_PLPLOT
     
    231231
    232232
    233   const std::vector<time_t>& Graph::xticks(void)
    234   {
    235     return xticks_;
     233  const std::vector<time_t>& Graph::dates(void)
     234  {
     235    return dates_;
    236236  }
    237237
  • trunk/lib/Graph.h

    r1327 r1330  
    128128    /**
    129129    */
    130     static const std::vector<time_t>& xticks(void);
     130    static const std::vector<time_t>& dates(void);
    131131
    132132    /**
     
    165165    static svn_revnum_t rev_max_;
    166166    std::string title_;
    167     static std::vector<time_t> xticks_;
     167    static std::vector<time_t> dates_;
    168168    PLFLT xmin_, xmax_, xrange_, ymin_, ymax_, yrange_;
    169169  };
Note: See TracChangeset for help on using the changeset viewer.