second version of ncurses waterfall

This commit is contained in:
tth 2019-01-10 20:35:03 +01:00
джерело ba9b0d993f
коміт efdf127033
5 змінених файлів з 20 додано та 12 видалено

1
.gitignore сторонній

@ -17,4 +17,5 @@ doc/*.ind
rrdb/*.png
serial/*.png
/viz/curses/t

@ -10,7 +10,6 @@
#include <getopt.h>
#include <ncurses.h>
#include "ecran.h"
int verbosity;

@ -1,4 +1,6 @@
/*
* interface ncurses pour dd2 monitoring
*/
int fond_ecran(char *titre);

@ -1,5 +1,5 @@
#include <stdio.h>
#include <unistd.h>
#include <unistd.h>
#include <stdlib.h>
#include <strings.h>
#include <getopt.h>
@ -77,7 +77,7 @@ keypad(stdscr, TRUE); /* acces aux touches 'curseur' */
fond_ecran(" Demonstrator ");
demo(9000, 0);
demo(90000, 0);
/*
* plop, on a fini, restaurer la console

@ -7,7 +7,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <string.h>
#include <getopt.h>
#include <ncurses.h>
@ -42,23 +42,22 @@ float coef_w;
static long iter;
if (0 == (iter%10)) {
memset(ligne, '-', TL);
memset(ligne, '.', TL);
}
else {
memset(ligne, ' ', TL);
}
for (foo=0; foo<500; foo+=10) {
ligne[foo] = '|';
for (foo=0; foo<500; foo+=20) {
ligne[foo] = '.';
}
ligne[COLS-4] = '\0';
iter++;
coef_w = (float)(COLS-2) / 1024.0;
coef_w = (float)(COLS-3) / 1024.0;
#if TRACE
sprintf(ligne, "coef_w = %f\n", coef_w);
waddstr(wf, ligne); waddch(wf, '\n');
#if TRACE > 1
fprintf(stderr, "COLS = %d, coef_w = %f\n", COLS, coef_w);
#endif
switch (mode) {
@ -76,8 +75,15 @@ switch (mode) {
tag = "ATOX"[foo];
idx = (int)(values[foo]*coef_w);
ligne[idx] = tag;
#if TRACE
fprintf(stderr, "%c %3d ", tag, idx);
#endif
}
ligne[COLS-4] = '\0';
#if TRACE
fprintf(stderr, "\n"); fflush(stderr);
#endif
break;
}