From b43e3b0a1c66727ba5ce914be723506007daf172 Mon Sep 17 00:00:00 2001 From: tth Date: Thu, 24 Jan 2019 13:06:26 +0100 Subject: [PATCH] deux vumetres, est-ce assez ? --- .gitignore | 1 + viz/curses/Makefile | 21 +++++++++++++-------- viz/curses/ecran.h | 2 ++ viz/curses/t.c | 9 ++++----- viz/curses/vumetre.c | 40 +++++++++++++++++++++++++++++++++++++++- 5 files changed, 59 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 250ce90..3480d38 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ serial/*.png viz/curses/t viz/gnuplot/*.png +viz/*.a diff --git a/viz/curses/Makefile b/viz/curses/Makefile index bc75dcc..825e937 100644 --- a/viz/curses/Makefile +++ b/viz/curses/Makefile @@ -1,26 +1,31 @@ # --------------- *** -COPT = -Wall -g -DTRACE=0 +COPT = -Wall -g -fpic -DTRACE=0 +OBJS = ecran.o 7segments.o waterfall.o vumetre.o +ALIB = ../libdd2m-viz.a + +# --------------- *** + +${ALIB}: ${OBJS} + ar r $@ $? # --------------- *** ecran.o: ecran.c Makefile ecran.h gcc $(COPT) -c $< -7segments.o: 7segments.c Makefile +7segments.o: 7segments.c Makefile ecran.h gcc $(COPT) -c $< -waterfall.o: waterfall.c Makefile +waterfall.o: waterfall.c Makefile ecran.h gcc $(COPT) -c $< -vumetre.o: vumetre.c Makefile +vumetre.o: vumetre.c Makefile ecran.h gcc $(COPT) -c $< # --------------- *** -OBJ = ecran.o waterfall.o 7segments.o vumetre.o - -t: t.c Makefile $(OBJ) ecran.h - gcc $(COPT) $< $(OBJ) -lncurses -o $@ +t: t.c Makefile $(ALIB) ecran.h + gcc $(COPT) $< $(ALIB) -lncurses -o $@ # --------------- *** diff --git a/viz/curses/ecran.h b/viz/curses/ecran.h index 0ad0234..ceac133 100644 --- a/viz/curses/ecran.h +++ b/viz/curses/ecran.h @@ -10,4 +10,6 @@ WINDOW * open_waterfall(char *title, int flags); int plot_waterfall(WINDOW *wf, int flags, float values[4]); int close_waterfall(WINDOW *wf, int notused); + int vumetre_0(WINDOW * win, int lig, int col, float val, int larg); +int vumetre_1(WINDOW * win, int lig, int col, float val, int larg); diff --git a/viz/curses/t.c b/viz/curses/t.c index 7e21c0a..ba0fd62 100644 --- a/viz/curses/t.c +++ b/viz/curses/t.c @@ -22,14 +22,13 @@ for (loop=0; loop>> %s ( %p %d %d %f %d )\n", @@ -26,8 +27,11 @@ fprintf(stderr, ">>> %s ( %p %d %d %f %d )\n", posc = (int)(val * (float)larg); +sprintf(ligne, "%6.3f", val); +mvwaddstr(win, lig, 2, ligne); + for (foo=0; foo>> %s ( %p %d %d %f %d )\n", + __func__, win, lig, col, val, larg); +#endif + +posc = (int)(val * (float)larg); + +sprintf(ligne, "%6.3f", val); +mvwaddstr(win, lig, 2, ligne); + +for (foo=0; foo