}
plot() {
- if [ -n "$PLOT_CMD" ]; then
- echo "set terminal postscript color eps enhanced;
- $PLOT_CMD" | gnuplot | epstopdf --filter > `basename $0 .sh`.pdf
+ for i in "${!PLOT_CMD[@]}"; do
if [ -z "$OPT_PDF_ONLY" ]; then
- echo "set terminal x11 enhanced; $PLOT_CMD" | gnuplot -persist
+ echo "set terminal x11 enhanced; ${PLOT_CMD[$i]}" | gnuplot -persist
fi
- fi
+ I=${i/0/}
+ echo "set terminal postscript color eps enhanced;
+ ${PLOT_CMD[$i]}" | gnuplot | epstopdf --filter > `basename $0 .sh`$I.pdf
+ done
}
go() {
-#!/bin/sh
+#!/bin/bash
. _lib.sh
t() {
PID_S=`vca_canping -s 1 -b -R FF:$RTPRIO -d $CAN1`
- vca_canping -m 1 -R FF:$RTPRIO -v -g $DRIVER -t 1 -d $CAN0 -w 2 -c 10000
+ vca_canping -m 1 -R FF:$RTPRIO -v -e $DRIVER-times -g $DRIVER -t 1 -d $CAN0 -w 1 -n 10 -c 10000
kill $PID_S
}
"lincan-1000.dat" with lp title "Lincan"
'
+PLOT_CMD[1]='
+set title "Round-trip time history (`uname -r`)"
+set logscale y
+set grid
+set xlabel "Ping number"
+set ylabel "Round-trip time [{/Symbol m}s]"
+plot "lincan-times-1000.dat" with lines, "socketcan-times-1000.dat" with lines
+'