OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.2 KiB

  1. #!/usr/bin/perl
  2. #
  3. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  4. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  5. #
  6. # T2 SDE: scripts/parasim3.pl
  7. # Copyright (C) 2004 - 2006 The T2 SDE Project
  8. # Copyright (C) 1998 - 2003 Clifford Wolf
  9. #
  10. # More information can be found in the files COPYING and README.
  11. #
  12. # This program is free software; you can redistribute it and/or modify
  13. # it under the terms of the GNU General Public License as published by
  14. # the Free Software Foundation; version 2 of the License. A copy of the
  15. # GNU General Public License can be found in the file COPYING.
  16. # --- T2-COPYRIGHT-NOTE-END ---
  17. my ($size_x, $max_x) = (68, 0);
  18. my $size_y=int( 16 / ($#ARGV+1) );
  19. my $file;
  20. foreach $file (@ARGV) {
  21. open(F, $file) || die $!;
  22. while (<F>) {
  23. @_ = split /\s+/;
  24. $_[0]=int($_[0] * 100);
  25. $max_x=$_[0] if $_[0] > $max_x;
  26. }
  27. close F;
  28. }
  29. print "\n -----+-----------------------------------" .
  30. "---------------------------------+\n";
  31. foreach $file (reverse @ARGV) {
  32. my @data_val;
  33. my @data_nr;
  34. my $max_y = 0;
  35. my ($x, $newx, $y);
  36. open(F, $file) || die $!;
  37. while (<F>) {
  38. @_ = split /\s+/;
  39. $max_y=$_[1] if $_[1] > $max_y;
  40. }
  41. close F;
  42. open(F, $file) || die $!;
  43. for ($x=0; <F>; ) {
  44. @_ = split /\s+/;
  45. for ($newx=int($_[0] * 100); $x <= $newx; $x++) {
  46. $_ = int(($x*$size_x) / $max_x);
  47. $data_val[$_] = 0 unless defined $data_val[$_];
  48. $data_nr[$_] = 0 unless defined $data_nr[$_];
  49. $data_val[$_] += $_[1];
  50. $data_nr[$_]++;
  51. }
  52. }
  53. close(F);
  54. for ($y=$size_y; $y>0; $y--) {
  55. if ($y == $size_y) { printf(" %3d |", $max_y); }
  56. elsif ($y == 1) { print " 1 |"; }
  57. else { print " |"; }
  58. for ($x=0; $x<$size_x; $x++) {
  59. if (defined $data_val[$x]) {
  60. $_ = ($data_val[$x]*$size_y*2 /
  61. $data_nr[$x]) / $max_y;
  62. if ($_ >= $y*2-1) { print ":"; }
  63. elsif ($_ >= $y*2-2) { print "."; }
  64. else { print " "; }
  65. } else {
  66. print " ";
  67. }
  68. }
  69. print "|\n";
  70. }
  71. print " -----+-----------------------------------" .
  72. "---------------------------------+\n";
  73. }
  74. printf " Jobs | 00:00 Time " .
  75. " %02d:%02d |\n\n",
  76. $max_x / 100, ($max_x * 0.6 ) % 60;