DD2-monitor/plot.sh

38 lines
646 B
Bash
Raw Normal View History

2019-04-04 03:36:27 +11:00
#!/bin/bash
# THIS IS A KLUDGE
2019-05-28 00:52:32 +11:00
nbsamp=3000 # nombre d'echantillon
if [ $# -eq 1 ]; then
nbsamp=$1
fi
2019-04-04 03:36:27 +11:00
DATAFILE="serial/foo.dat"
IMAGE="graphe.png"
2019-04-14 20:33:52 +11:00
TMPFILE="/dev/shm/tmpdata"
2019-04-04 03:36:27 +11:00
2019-05-28 00:52:32 +11:00
echo $nbsamp
2019-05-16 02:22:44 +11:00
wc -l ${DATAFILE}
2019-07-31 06:19:44 +11:00
tail -${nbsamp} < ${DATAFILE} > ${TMPFILE}
2019-04-04 03:36:27 +11:00
gnuplot << __EOC__
2019-05-16 02:22:44 +11:00
set term png size 1600,800
2019-04-04 03:36:27 +11:00
set output "${IMAGE}"
set ytics 2
set xtics
set grid front
set title "* Temperatures du Phytotron *"
2019-04-04 03:36:27 +11:00
set xdata time
set timefmt "%s"
set format x "%b %d\n%H:%M"
2021-03-30 06:32:53 +11:00
set yrange [ 10.0 : 40.0 ]
plot "${TMPFILE}" using 1:3 title " inside" with lines, \
"${TMPFILE}" using 1:4 title "ambient" with lines
2019-04-04 03:36:27 +11:00
__EOC__
2019-05-16 02:22:44 +11:00
display ${IMAGE} &
2019-04-04 03:36:27 +11:00