Changeset 30586 for branches/czw_branch/20101203/tools/czartool/Plotter.pm
- Timestamp:
- Feb 11, 2011, 4:29:48 PM (15 years ago)
- Location:
- branches/czw_branch/20101203
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
tools/czartool/Plotter.pm (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/czw_branch/20101203
- Property svn:mergeinfo changed
-
branches/czw_branch/20101203/tools/czartool/Plotter.pm
r30118 r30586 7 7 8 8 use File::Temp; 9 10 use czartool::Config; 9 11 10 12 my @allStages = ("burntool", "chip", "cam", "fake", "warp", "stack", "diff", "magic", "magicDS", "dist"); … … 18 20 my $class = shift; 19 21 my $self = { 20 _gpc1Db => shift, 21 _czarDb => shift, 22 _config => shift, 22 23 _dateFormat => shift, 23 24 _outputFormat => shift, … … 27 28 28 29 bless $self, $class; 30 $self->init(); 29 31 return $self; 30 32 } … … 38 40 my $class = shift; 39 41 my $self = { 40 _gpc1Db => shift, 41 _czarDb => shift, 42 _config => shift, 42 43 _outputPath => shift, 43 44 _save_temps => shift, 44 45 }; 45 46 46 $self->{_dateFormat} = "%Y%m%d-%H%M%S"; 47 $self->{_outputFormat} = "png font \"/usr/share/fonts/corefonts/arial.ttf\" 8"; # TODO path needs to be in config 48 49 bless $self, $class; 47 $self->{_outputFormat} = "png font \"".$self->{_config}->getGnuplotFont()."\" ".$self->{_config}->getGnuplotFontSize(); 48 49 bless $self, $class; 50 $self->init(); 50 51 return $self; 51 52 } … … 59 60 my $class = shift; 60 61 my $self = { 61 _gpc1Db => shift, 62 _czarDb => shift, 62 _config => shift, 63 63 _save_temps => shift, 64 64 }; … … 69 69 70 70 bless $self, $class; 71 $self->init(); 71 72 return $self; 72 73 } 73 74 74 75 ########################################################################### 76 # 77 # Some initialisation code common to all constructors 78 # 79 ########################################################################### 80 sub init { 81 my ($self) = @_; 82 83 $self->{_gpc1Db} = $self->{_config}->getGpc1Instance(); 84 $self->{_czarDb} = $self->{_config}->getCzarDbInstance(); 85 } 75 86 76 87 ########################################################################### … … 508 519 GP->autoflush(1); 509 520 521 my $datFile = $tmpFile->filename; 510 522 if ($self->{_outputFormat} ne "X11") {print GP "set output \"$outputFile\";";} 511 print GP 512 "set term $self->{_outputFormat};" .513 "set title \"Total available cluster space over time\\nFrom $fromTime to $toTime HST\";" .514 "set key left top;" .515 "set xdata time;" .516 "set timefmt \"$self->{_dateFormat}\";" .517 "set format x \"$timeFormat\";" .518 "set xtics \"$minX\", $divX, \"$maxX\";" .519 "set grid xtics;" .520 "set xlabel \"Time\";" .521 "set ylabel \"Available (TB)\";" .522 "plot " .523 "'".$tmpFile->filename."' using 1:2 title \"Available\" with lines lt 2 lw 2\n"; 523 print GP <<PLOT; 524 set term $self->{_outputFormat} 525 set title "Total available cluster space over time\\nFrom $fromTime to $toTime HST" 526 set key left top 527 set xdata time 528 set timefmt "$self->{_dateFormat}" 529 set format x "$timeFormat" 530 set xtics "$minX", $divX, "$maxX" 531 set grid xtics 532 set xlabel "Time" 533 set ylabel "Available (TB)" 534 plot "$datFile" using 1:2 title "Available" with lines lt 2 lw 2 535 PLOT 524 536 525 537 print GP "\n";
Note:
See TracChangeset
for help on using the changeset viewer.
