Index: trunk/tools/czarplot.pl
===================================================================
--- trunk/tools/czarplot.pl	(revision 28750)
+++ trunk/tools/czarplot.pl	(revision 28752)
@@ -64,5 +64,5 @@
 else {$savingToFile = 1;}
 
-my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", $verbose);
+my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", $verbose, $save_temps);
 $czarDb->setDateFormat("%Y%m%d-%H%i%s");
 
Index: trunk/tools/czartool/CzarDb.pm
===================================================================
--- trunk/tools/czartool/CzarDb.pm	(revision 28750)
+++ trunk/tools/czartool/CzarDb.pm	(revision 28752)
@@ -2,5 +2,4 @@
 
 package czartool::CzarDb;
-
 
 use warnings;
@@ -10,5 +9,4 @@
 
 my @stages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist"); # TODO put elsewhere
-
 
 use base 'czartool::MySQLDb';
@@ -20,5 +18,5 @@
 
     # Call the constructor of the parent class, Person.
-    my $self = $class->SUPER::new( $_[1], $_[2], $_[3], $_[4],  $_[5]);
+    my $self = $class->SUPER::new( $_[1], $_[2], $_[3], $_[4],  $_[5], $_[6]);
 
     bless $self, $class;
@@ -147,7 +145,7 @@
 ###########################################################################
 sub getTimeDifference { # TODO fix this
-    my ($self, $save_temps, $fromTime, $toTime) = @_; # TODO save_temps should be constructor arg
-
-    my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$save_temps);
+    my ($self, $fromTime, $toTime) = @_; 
+
+    my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$self->{_save_temps});
 
     my $query = $self->{_db}->prepare(<<SQL);
@@ -167,7 +165,7 @@
 ###########################################################################
 sub createTimeSeriesData {
-    my ($self, $save_temps, $label, $table, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff) = @_; # TODO save_temps should be constructor arg
-
-    my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$save_temps);
+    my ($self, $label, $table, $fromTime, $toTime, $minX, $maxX, $minY, $maxY, $timeDiff) = @_;
+
+    my ($tempFile, $tempName) = tempfile( "/tmp/czartool_gnuplot_timeseries.XXXX", UNLINK => !$self->{_save_temps});
 
     my $query = $self->{_db}->prepare(<<SQL);
Index: trunk/tools/czartool/Czarplot.pm
===================================================================
--- trunk/tools/czartool/Czarplot.pm	(revision 28750)
+++ trunk/tools/czartool/Czarplot.pm	(revision 28752)
@@ -66,5 +66,5 @@
     my $stage = undef;
     foreach $stage (@{$stages}) {
-        $gnuplotFiles{$stage} =  $self->{_czarDb}->createTimeSeriesData($self->{_save_temps}, $label, $stage, $beginTime, $endTime, \$minX, \$maxX, \$minY, \$maxY, \$timeDiff);
+        $gnuplotFiles{$stage} =  $self->{_czarDb}->createTimeSeriesData($label, $stage, $beginTime, $endTime, \$minX, \$maxX, \$minY, \$maxY, \$timeDiff);
     }                                                           
 
Index: trunk/tools/czartool/MySQLDb.pm
===================================================================
--- trunk/tools/czartool/MySQLDb.pm	(revision 28750)
+++ trunk/tools/czartool/MySQLDb.pm	(revision 28752)
@@ -21,4 +21,5 @@
         _dbPass => shift,
         _verbose => shift,
+        _save_temps => shift,
     };                              
 
Index: trunk/tools/roboczar.pl
===================================================================
--- trunk/tools/roboczar.pl	(revision 28750)
+++ trunk/tools/roboczar.pl	(revision 28752)
@@ -17,17 +17,17 @@
 my $save_temps = 0;
 
-my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp");
-my $gpc1Db = new czartool::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser");
-my $pantasks = new czartool::Pantasks();
-my $czarplot = new czartool::Czarplot($czarDb, "%Y%m%d-%H%M%S", "png", "~/", $save_temps);
-$czarDb->setDateFormat("%Y%m%d-%H%i%s");
-
-my @stages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
-
-
 GetOptions (
         "period|p=s" => \$period, # TODO more Db args
         "dbname|d=s" => \$czarDbName,
         );
+
+my $czarDb = new czartool::CzarDb($czarDbName, "ippdb01", "ipp", "ipp", 0, $save_temps); # TODO last arg here is save_temps, should get as arg
+my $gpc1Db = new czartool::Gpc1Db("gpc1", "ippdb01", "ippuser", "ippuser");
+my $pantasks = new czartool::Pantasks();
+my $czarplot = new czartool::Czarplot($czarDb, "%Y%m%d-%H%M%S", "png", "/tmp", $save_temps);
+$czarDb->setDateFormat("%Y%m%d-%H%i%s");
+
+my @stages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
+
 
 timePoll($period);
