Index: /trunk/ippMonitor/czartool/czartool/Plotter.pm
===================================================================
--- /trunk/ippMonitor/czartool/czartool/Plotter.pm	(revision 32762)
+++ /trunk/ippMonitor/czartool/czartool/Plotter.pm	(revision 32763)
@@ -10,5 +10,27 @@
 use czartool::Config;
 
-my @allStages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist", "pub");
+my @allStages = (
+        "burntool", 
+        "chip", 
+        "cam", 
+        "fake", 
+        "warp", 
+        "stack", 
+        "diff", 
+        "magic", 
+        "magicDS", 
+        "dist", 
+        "pub");
+
+my @allIppToPspsStages = (
+        "processed", 
+        "loaded_to_datastore", 
+        "loaded_to_ODM", 
+        "merge_worthy", 
+        "deleted_datastore", 
+        "deleted_dxlayer", 
+        "merged", 
+        "deleted_local");
+
 
 ###########################################################################
@@ -75,4 +97,26 @@
 ###########################################################################
 #
+# Sets plotter to use standard IPP mode, i.e. chip, cam etc 
+#
+###########################################################################
+sub setStandardMode {
+    my ($self) = @_;
+
+    $self->{allStages} = \@allStages;
+}
+
+###########################################################################
+#
+# Sets plotter to use ippToPsps mode, i.e. processed, loaded_to_datastore etc 
+#
+###########################################################################
+sub setIppToPspsMode {
+    my ($self) = @_;
+
+    $self->{allStages} = \@allIppToPspsStages;
+}
+
+###########################################################################
+#
 # Some initialisation code common to all constructors
 #
@@ -83,4 +127,5 @@
     $self->{_gpc1Db} = $self->{_config}->getGpc1Instance();
     $self->{_czarDb} = $self->{_config}->getCzarDbInstance();
+    $self->setStandardMode();
 }
 
@@ -140,5 +185,5 @@
     my $stages = undef;                 
     if (!$selectedStage) {
-        $stages = \@allStages;
+        $stages = \@{$self->{allStages}};
         $selectedStage = 'all_stages';
     }
@@ -203,10 +248,10 @@
         "set style histogram rowstacked;" .
         "set style fill solid border -1;" .
-        "set ylabel \"Exposures processed per $interval\";" .
+        "set ylabel \"Items processed per $interval\";" .
         "set boxwidth 0.75;" .
         "plot ";
 
     my $first = 1;
-    foreach my $stage (@allStages) {
+    foreach my $stage (@{$self->{allStages}}) {
 
 
@@ -226,5 +271,5 @@
 ###########################################################################
 #
-# Plots a time series for all stages for this label
+# Plots a time series for all or one stage for this label
 #
 ###########################################################################
@@ -238,5 +283,5 @@
     my $stages = undef;                 
 
-    if (!$selectedStage) {$stages = \@allStages;}
+    if (!$selectedStage) {$stages = \@{$self->{allStages}};}
     else {$stages = ["$selectedStage"]};        
 
@@ -297,5 +342,5 @@
                 $timeDiff, 
                 "",
-                "Exposures");
+                "Items");
     }
 
@@ -314,5 +359,5 @@
                 $timeDiff, 
                 "",
-                "Log(Exposures)");
+                "Log(Items)");
     }
 
@@ -331,5 +376,5 @@
                 $timeDiff, 
                 "",
-                "Exposures per hour");
+                "Items per hour");
 }    
 }                                                
@@ -351,5 +396,5 @@
     my $stage = undef;
     my $pendingMinusFaults = undef;
-    foreach $stage (@allStages) {
+    foreach $stage (@{$self->{allStages}}) {
 
         if (!$self->{_czarDb}->countProcessedPendingAndFaults(
@@ -381,5 +426,5 @@
         "set style histogram rowstacked;" .
         "set style fill solid border -1;" .
-        "set ylabel \"Exposures\";" .
+        "set ylabel \"Items\";" .
         "set boxwidth 0.75;" .
         "plot '".$tmpFile->filename."' using 2:xtic(1) title \"Faults\" lt 1, '' using 3 title \"Processed\" lt 2, '' using 4 title \"Pending\" lt 7;" . 
@@ -520,5 +565,6 @@
     my $firstIn = 1;
     # loop through stages array so that they are ordered properly (not maintained in hash)
-    foreach my $stage (@allStages) {
+    #foreach my $stage (@allStages) {
+    foreach my $stage (@{$self->{allStages}}) {
 
         if(!$gnuplotFiles->{$stage}) {next;}
@@ -620,4 +666,5 @@
         "set title \"Nebulous disk use across IPP cluster ($totalPercent of total allocated)\";" .
         "set style fill solid 1.00 border -1;" .
+        "set key center top;" .
         "set style histogram rowstacked;" .
         "set style data histograms;" .
