Browse Source

patching and testing again...

tth 1 year ago
parent
commit
f3dfe77e3a
2 changed files with 7 additions and 6 deletions
  1. 3
    3
      serial/essai.sh
  2. 4
    3
      serial/t.c

+ 3
- 3
serial/essai.sh View File

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

+ 4
- 3
serial/t.c View File

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

Loading…
Cancel
Save