# script to display the power consumption. This thing generates a plot from # data in logfiles. The result gets generated as a png file, and the script # is intended to be invoked from a higher level perl script which generates # a dynamical web page, containing this image. # Definition of core file, number of points, sampling, source directory, # target directory etc. These parameters get set via some direct input of the # calling script to adapt for things which should not be static in the # gnuplot script. For testing, uncomment the appropriate lines below. core="AHU2"; outfilename="AHU2V_1500.png" num=1500; evr=1; ofmt= "%m/%d\n%H:%M"; # num=10800; evr=10; ofmt= "%a\n%m/%d\n%H:%M"; # num=46000; evr=30; ofmt= "%m/%d" # num=120000; evr=120; ofmt= "%b/%y"; # Some directory paths logdir="/home/chris/construction/BTUmetering/log" imgdir="/home/chris/construction/BTUmetering/web/img" # Define the output format and size of the resulting graphic set terminal png medium size 640,480 set output imgdir.'/'.outfilename # have both plots in same image set title core # define time format for input set xdata time set timefmt "%m/%d/%y %H:%M:%S" # This is the source file plus a filter for the last n entries srcfile='< tail -n '.num.' '.logdir.'/heat_'.core.'.log' set format x ofmt # format for power between 0..200kW; works also for temperature 6..25C set format y "%4.3g" set ylabel "Chilled water flow (l/s)" set grid xtics ytics # Do the actual plot plot srcfile every evr using 1:($5/($6-$7)/4.19) w l notitle