patching and testing again...

This commit is contained in:
Tonton Th 2019-02-22 17:25:24 +01:00
parent b6d49bd6f8
commit f3dfe77e3a
2 changed files with 7 additions and 6 deletions

View File

@ -5,19 +5,19 @@ DATAFILE="foo.dat"
TMPFILE="/tmp/dd2data" TMPFILE="/tmp/dd2data"
IMAGE="graphe.png" IMAGE="graphe.png"
NB_READ=5000 NB_READ=500
./t -vv -n ${NB_READ} -d ${DEVICE} | tee -a ${DATAFILE} ./t -vv -n ${NB_READ} -d ${DEVICE} | tee -a ${DATAFILE}
gnuplot << __EOC__ gnuplot << __EOC__
set term png size 4200,640 set term png size 1280,640
set output "${IMAGE}" set output "${IMAGE}"
set grid set grid
set title "Temperature dans le Double Dragon 2" set title "Temperature dans le Double Dragon 2"
set xdata time set xdata time
set timefmt "%s" set timefmt "%s"
set format x "%d, %H:%M:%S" set format x "%d, %H:%M:%S"
set yrange [ 0.0 : 30.0] set yrange [ 0.0 : 30.0 ]
plot "${DATAFILE}" using 1:2 title " foo" with lines, \ plot "${DATAFILE}" using 1:2 title " foo" with lines, \
"${DATAFILE}" using 1:3 title " bar" with lines, \ "${DATAFILE}" using 1:3 title " bar" with lines, \
"${DATAFILE}" using 1:4 title "quux" with lines, \ "${DATAFILE}" using 1:4 title "quux" with lines, \

View File

@ -23,7 +23,7 @@ int loop(int sfd, int iters)
{ {
int count, foo; int count, foo;
long temps; long temps;
char ligne[200]; char ligne[200], buff[200];
float datas[4]; float datas[4];
struct tm *p_tms; struct tm *p_tms;
@ -39,9 +39,10 @@ for (count=0; count<iters; count++) {
if (verbosity > 1) if (verbosity > 1)
{ {
p_tms = localtime(&temps); p_tms = localtime(&temps);
(void)strftime(ligne, 19, "%H:%M:%S", p_tms); (void)strftime(buff, 19, "%H:%M:%S", p_tms);
fprintf(stderr, "%6d %s\n", count, ligne); fprintf(stderr, "%s %6d / %d\n", buff, count, iters);
} }
//
foo = parse4values(ligne, 'T', datas); foo = parse4values(ligne, 'T', datas);
// //
if (foo >= 0) { if (foo >= 0) {