IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30254


Ignore:
Timestamp:
Jan 12, 2011, 4:16:20 PM (15 years ago)
Author:
rhenders
Message:

Fixed time-range of plots to use value from config

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czarplot.pl

    r30251 r30254  
    122122my $czarDb = $config->getCzarDbInstance();
    123123
     124my $newDayTime =  $config->getMetricsStartTime();
    124125
    125126my $plotter = undef;
     
    133134}
    134135
    135 # sort out times
     136# if a single day has been chosen
    136137if($day) {
    137138
     
    143144    else {
    144145
    145         # day plots should run from about 6:30am until midnight
    146         $begin = "$day 06:35";
    147         $end = "$day 23:59";
     146        # plots should span 24 housr from previous day
     147        my $dayBefore = $czarDb->subtractInterval($day, "1 DAY");
     148               
     149        $begin = "$dayBefore $newDayTime";
     150        $end = "$day $newDayTime";
    148151    }
    149152}
     
    153156    if (!$begin) {
    154157
     158        my $today = strftime('%Y-%m-%d', localtime);
     159        my $yesterday = $czarDb->subtractInterval($today, "1 DAY");
     160
     161       
    155162        if ($timeinpast) {$begin = $czarDb->subtractInterval($end, $timeinpast);}
    156         else {$begin =  strftime('%Y-%m-%d 06:35',localtime);}
     163        elsif ($czarDb->isBefore($end, "$today $newDayTime")) {$begin = "$yesterday $newDayTime";}
     164        else {$begin = "$today $newDayTime";}
    157165    }
    158166}
Note: See TracChangeset for help on using the changeset viewer.