Index: branches/eam_branches/ipp-20100823/tools/roboczar.pl
===================================================================
--- branches/eam_branches/ipp-20100823/tools/roboczar.pl	(revision 29016)
+++ branches/eam_branches/ipp-20100823/tools/roboczar.pl	(revision 29124)
@@ -11,5 +11,6 @@
 use czartool::Pantasks;
 use czartool::Nebulous;
-use czartool::Czarplot;
+use czartool::Plotter;
+use czartool::Burntool;
 
 my $period = 60;
@@ -26,8 +27,10 @@
 my $nebulous = new czartool::Nebulous($czarDb);
 my $pantasks = new czartool::Pantasks();
-my $czarplot = new czartool::Czarplot($czarDb, "%Y%m%d-%H%M%S", "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8", "/tmp", $save_temps); # TODO hardcoded font path
+my $plotter = new czartool::Plotter($czarDb, "%Y%m%d-%H%M%S", "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8", "/tmp", $save_temps); # TODO hardcoded font path
+my $burntool = new czartool::Burntool();
+
 $czarDb->setDateFormat("%Y%m%d-%H%i%s");
 
-my @stages = ("chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
+my @stages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist");
 
 
@@ -101,9 +104,10 @@
     my $priority = undef;
     my $newState = undef;
+    my $nsStatus = undef;
 
     while (1) {
 
         # sort out times
-        $begin =  strftime('%Y-%m-%d 07:00',localtime);
+        $begin =  strftime('%Y-%m-%d 06:35',localtime);
         $end = $czarDb->getNowTimestamp();
 
@@ -112,9 +116,14 @@
             $begin = $czarDb->subtractInterval($begin, "1 DAY");
         }
+
+        # check nightly science status
+        print "* Checking nightly science status\n";
+        if (!$pantasks->getNightlyScienceStatus(\$nsStatus)) {$nsStatus = "Unknown";}
+        $czarDb->updateNightlyScience($nsStatus);
 
         # check nebulous
         print "* Checking Nebulous\n";
         $nebulous->updateClusterSpaceInfo();
-        $czarplot->plotDiskUsageHistogram();
+        $plotter->plotDiskUsageHistogram();
         updateServerStatus();
 
@@ -177,5 +186,5 @@
 
             chomp($label);
-            $czarplot->createTimeSeries($label,  $stage, $begin, $end);
+            $plotter->createLogAndLinearTimeSeries($label,  $stage, $begin, $end);
         }
     }
@@ -185,14 +194,14 @@
         my ($label) = @{$row};
 
-        $czarplot->createTimeSeries($label, undef, $begin, $end);
-        $czarplot->createHistogram($label, $begin, $end);
+        $plotter->createLogAndLinearTimeSeries($label, undef, $begin, $end);
+        $plotter->createHistogram($label, $begin, $end);
 
         #routineChecks($label, "1 HOUR");
     }
-    $czarplot->createTimeSeries("all_".$server."_labels", undef, $begin, $end);
-    $czarplot->createHistogram("all_".$server."_labels", $begin, $end);
+    $plotter->createLogAndLinearTimeSeries("all_".$server."_labels", undef, $begin, $end);
+    $plotter->createHistogram("all_".$server."_labels", $begin, $end);
     foreach $stage (@stages) {
 
-        $czarplot->createTimeSeries("all_".$server."_labels",  $stage, $begin, $end); # TODO must be a neater way...
+        $plotter->createLogAndLinearTimeSeries("all_".$server."_labels",  $stage, $begin, $end); # TODO must be a neater way...
     }
 }
@@ -233,8 +242,19 @@
             chomp($label);
 
-            $new = $gpc1Db->countExposures($label, $stage, $newState);
-            $full = $gpc1Db->countExposures($label, $stage, "full");
-            $faults = $gpc1Db->countFaults($label, $stage, $newState);
-
+            if ($stage eq "burntool") {
+
+                if ($labelServer eq "stdscience") {
+
+                    $burntool->getPendingAndProcessed($label, \$new, \$full);
+                    $faults = 0;
+                }
+                else { $new = $full = $faults = 0;}
+            }
+            else {
+
+                $new = $gpc1Db->countExposures($label, $stage, $newState);
+                $full = $gpc1Db->countExposures($label, $stage, "full");
+                $faults = $gpc1Db->countFaults($label, $stage, $newState);
+            }
             #printf("%s  %s, %s, %d, %d\n", $labelServer, $label, $stage, $new, $faults);
             $totalNew += $new;
