On Sat, Mar 01, 2003 at 02:22:05PM -0500, Gene Heskett wrote:
> On Fri February 28 2003 17:58, Jean-Louis Martineau wrote:
> >On Fri, Feb 28, 2003 at 02:04:45PM -0700, Broderick Wood wrote:
> >> Except that the ps file(s) generate by "amplot -p -l amdump*" 
> >> is a B/W ps file.
> >>
> >> Is there an option is the amplot that I am missing?
> >
> >Try this patch.
> >
> >Jean-Louis
> 
> I tried this patch with amanda-2.4.4/amplot, and it worked as I 
> reported earlier.  Unforch, then I tried to apply it to 
> amanda/2.4.4-20030228/amplot, but got a message from patch that 
> this patch had already been applied.  But I got a b&w printout when 
> I tried it this morning.

The patch is not yet on a snapshot.

> If and when you do incorporate it into amplot, may I suggest the use 
> of the pure yellow be changed to orange so that those portions can 
> be easier seen under warm incandescent or a Lights Of America CCFL 
> lamp, whose color is also extremely warm, possibly containing even 
> less blue than a normal incandescent lamp?

Try this new patch, it also add a '-b' flag for people that want a
b/w postscript.

Jean-Louis
-- 
Jean-Louis Martineau             email: [EMAIL PROTECTED] 
Departement IRO, Universite de Montreal
C.P. 6128, Succ. CENTRE-VILLE    Tel: (514) 343-6111 ext. 3529
Montreal, Canada, H3C 3J7        Fax: (514) 343-5834
diff -u amanda-2.4.3.orig/amplot/amplot.awk amanda-2.4.3.new/amplot/amplot.awk
--- amanda-2.4.3.orig/amplot/amplot.awk 2002-12-30 11:23:47.000000000 -0500
+++ amanda-2.4.3.new/amplot/amplot.awk  2003-03-03 14:23:47.000000000 -0500
@@ -485,8 +485,14 @@
 
        if (gnuplot==0) {
                printf "set output \"%s.ps\"\n",fil >>"title";
-               if(paper==1) printf "set term postscript landscape \"Times-Roman\" 
10\n" >>"title";
-               else printf "set term postscript portrait \"Times-Roman\" 10\n" 
>>"title";
+               if(bw==1) {
+                       if(paper==1) printf "set term postscript landscape 
\"Times-Roman\" 10\n" >>"title";
+                       else printf "set term postscript portrait \"Times-Roman\" 
10\n" >>"title";
+               }
+               else {
+                       if(paper==1) printf "set term postscript landscape color 
\"Times-Roman\" 10\n" >>"title";
+                       else printf "set term postscript portrait color 
\"Times-Roman\" 10\n" >>"title";
+               }
        }
        printf "set ylabel """";" >>"title";    # make sure there is no ylabel
        fmt= "set label %d \"%s\" at "third_col", %d\n";
diff -u amanda-2.4.3.orig/amplot/amplot.g amanda-2.4.3.new/amplot/amplot.g
--- amanda-2.4.3.orig/amplot/amplot.g   2002-11-04 20:37:52.000000000 -0500
+++ amanda-2.4.3.new/amplot/amplot.g    2003-03-03 14:28:42.000000000 -0500
@@ -62,7 +62,7 @@
 plot   "run_queue" title "Run Queue" with line 3,\
        "tape_queue" title "Tape Queue" with line 2,\
        "finished"  title "Dumps Finished" with line 4,\
-       "bandw_free" title "Bandwidth Allocated" with line 6, \
+       "bandw_free" title "Bandwidth Allocated" with line 8, \
        "disk_alloc" title "%Disk Allocated" with line 1, \
        "tape_wait" title "%Tape Wait" with line 5,\
        "tape_idle" title "Taper Idle" with line 1,\
diff -u amanda-2.4.3.orig/amplot/amplot.sh.in amanda-2.4.3.new/amplot/amplot.sh.in
--- amanda-2.4.3.orig/amplot/amplot.sh.in       2002-11-04 20:37:52.000000000 -0500
+++ amanda-2.4.3.new/amplot/amplot.sh.in        2003-03-03 14:24:18.000000000 -0500
@@ -58,7 +58,8 @@
        echo "  -e      Extends x (time) axes if needed"
        echo "  -g      Run gnuplot directly no postscript file generated DEFAULT"
        echo "  -l      Landscape mode suitable for printing"
-       echo "  -p      Postscript output"
+       echo "  -p      Postscript output (color)"
+       echo "  -b      The postscipt will be b/w"
        echo "  -t T    Set the right edge of the plot to be T hours"
        exit 1 
 fi
@@ -75,6 +76,7 @@
 cmpres=0
 para=""
 maxtime=4
+bw=0
 
 # setting up the parameters to pass to [gn]awk 
 while :; do 
@@ -84,6 +86,7 @@
    -g)  gnuplot=1; shift;;
    -l)  paper=1; para=$para"$AVARFLAG paper=1 "; shift;;
    -p)  gnuplot=0; shift;;
+   -b) bw=1; shift;;
    -t)  shift
        if test "$#" -eq 0; then
            echo "amplot: no argument for -t option" 1>&2
@@ -109,6 +112,14 @@
                echo "amplot: -l requires -p flag at the same time" 1>&2
                exit 6 
        fi
+       if [ "$bw" -eq 1 ] ; then
+               echo "amplot: -b requires -p flag at the same time" 1>&2
+               exit 6 
+       fi
+fi
+
+if [ $bw -eq 1 ]; then
+       para=$para" bw=1"
 fi
 
 list="";               # files to compress at the end

Reply via email to