IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28752


Ignore:
Timestamp:
Jul 28, 2010, 4:12:14 PM (16 years ago)
Author:
rhenders
Message:

Handling save_temps arg properly

Location:
trunk/tools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/czarplot.pl

    r28719 r28752  
    6464else {$savingToFile = 1;}
    6565
    66 my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", $verbose);
     66my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", $verbose, $save_temps);
    6767$czarDb->setDateFormat("%Y%m%d-%H%i%s");
    6868
  • trunk/tools/czartool/CzarDb.pm

    r28719 r28752  
    22
    33package czartool::CzarDb;
    4 
    54
    65use warnings;
     
    109
    1110my @stages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist"); # TODO put elsewhere
    12 
    1311
    1412use base 'czartool::MySQLDb';
     
    2018
    2119    # Call the constructor of the parent class, Person.
    22     my $self = $class->SUPER::new( $_[1], $_[2], $_[3], $_[4],  $_[5]);
     20    my $self = $class->SUPER::new( $_[1], $_[2], $_[3], $_[4],  $_[5], $_[6]);
    2321
    2422    bless $self, $class;
     
    147145###########################################################################
    148146sub getTimeDifference { # TODO fix this
    149     my ($self, $save_temps, $fromTime, $toTime) = @_; # TODO save_temps should be constructor arg
    150 
    151     my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$save_temps);
     147    my ($self, $fromTime, $toTime) = @_;
     148
     149    my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$self->{_save_temps});
    152150
    153151    my $query = $self->{_db}->prepare(<<SQL);
     
    167165###########################################################################
    168166sub createTimeSeriesData {
    169     my ($self, $save_temps, $label, $table, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff) = @_; # TODO save_temps should be constructor arg
    170 
    171     my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$save_temps);
     167    my ($self, $label, $table, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff) = @_;
     168
     169    my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$self->{_save_temps});
    172170
    173171    my $query = $self->{_db}->prepare(<<SQL);
  • trunk/tools/czartool/Czarplot.pm

    r28728 r28752  
    6666    my $stage = undef;
    6767    foreach $stage (@{$stages}) {
    68         $gnuplotFiles{$stage} =  $self->{_czarDb}->createTimeSeriesData($self->{_save_temps}, $label, $stage, $beginTime, $endTime, \$minX, \$maxX, \$minY, \$maxY, \$timeDiff);
     68        $gnuplotFiles{$stage} =  $self->{_czarDb}->createTimeSeriesData($label, $stage, $beginTime, $endTime, \$minX, \$maxX, \$minY, \$maxY, \$timeDiff);
    6969    }                                                           
    7070
  • trunk/tools/czartool/MySQLDb.pm

    r28704 r28752  
    2121        _dbPass => shift,
    2222        _verbose => shift,
     23        _save_temps => shift,
    2324    };                             
    2425
  • trunk/tools/roboczar.pl

    r28729 r28752  
    1717my $save_temps = 0;
    1818
    19 my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp");
    20 my $gpc1Db = new czartool::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser");
    21 my $pantasks = new czartool::Pantasks();
    22 my $czarplot = new czartool::Czarplot($czarDb, "%Y%m%d-%H%M%S", "png", "~/", $save_temps);
    23 $czarDb->setDateFormat("%Y%m%d-%H%i%s");
    24 
    25 my @stages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
    26 
    27 
    2819GetOptions (
    2920        "period|p=s" => \$period, # TODO more Db args
    3021        "dbname|d=s" => \$czarDbName,
    3122        );
     23
     24my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", 0, $save_temps); # TODO last arg here is save_temps, should get as arg
     25my $gpc1Db = new czartool::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser");
     26my $pantasks = new czartool::Pantasks();
     27my $czarplot = new czartool::Czarplot($czarDb, "%Y%m%d-%H%M%S", "png", "/tmp", $save_temps);
     28$czarDb->setDateFormat("%Y%m%d-%H%i%s");
     29
     30my @stages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
     31
    3232
    3333timePoll($period);
Note: See TracChangeset for help on using the changeset viewer.