c'est l'heure de l'apero

This commit is contained in:
tth 2019-01-27 12:12:49 +01:00
parent bc7e6379e6
commit 7b168e26bd
2 changed files with 24 additions and 18 deletions

View File

@ -14,7 +14,10 @@ int verbosity;
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
int message(char *txt) int message(char *txt)
{ {
static int pass = 0;
standout(); standout();
mvaddch(LINES-1, 0, "\\|/-"[(pass++)%4]);
mvaddstr(LINES-1, 2, txt); mvaddstr(LINES-1, 2, txt);
standend(); standend();
refresh(); refresh();
@ -33,13 +36,10 @@ standend();
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
int fond_ecran(char *title) int fond_ecran(char *title)
{ {
char *tp; char *tp;
struct utsname utsn; struct utsname utsn;
int foo; int foo;
char buffer[200];
#if TRACE
char buffer[200];
#endif
tp = " DD2 MONITORING by tTh 2019 "; tp = " DD2 MONITORING by tTh 2019 ";
if (NULL != title) tp = title; if (NULL != title) tp = title;
@ -47,11 +47,12 @@ if (NULL != title) tp = title;
barre_inverse(' ', 0); barre_inverse(' ', 0);
standout(); standout();
mvaddstr(0, 2, tp); mvaddstr(0, 2, tp);
#if TRACE
sprintf(buffer, " ecran %dx%d ", COLS, LINES); if (verbosity) {
foo = strlen(buffer); sprintf(buffer, " ecran %dx%d ", COLS, LINES);
mvaddstr(0, COLS-2-foo, buffer); foo = strlen(buffer);
#endif mvaddstr(0, COLS-2-foo, buffer);
}
/* get and display hostname */ /* get and display hostname */
foo = uname(&utsn); foo = uname(&utsn);

View File

@ -20,20 +20,25 @@ char ligne[100];
for (idx=0; idx<10; idx++) { for (idx=0; idx<10; idx++) {
c = '0'+idx; c = '0'+idx;
p = 1+(idx*9); p = 1+(idx*9);
aff7segs_digit(stdscr, 17, p, c); aff7segs_digit(stdscr, 4, p, c);
mvaddch(16, p, c); mvaddch(3, p, c);
} }
for (loop=0; loop<nbl; loop++) { for (loop=0; loop<nbl; loop++) {
sprintf(ligne, "%5d", loop); sprintf(ligne, "%5d", loop);
mvaddstr(15, 1, ligne);
for (idx=0; idx<strlen(ligne); idx++) { for (idx=0; idx<strlen(ligne); idx++) {
aff7segs_digit(stdscr, 5, 1+(idx*9), ligne[idx]); aff7segs_digit(stdscr, 16, 8+(idx*9), ligne[idx]);
} }
mvaddstr(3, 2, ligne); sprintf(ligne, "%.3f", drand48());
refresh(); mvaddstr(26, 1, ligne);
usleep(200*1000); for (idx=0; idx<strlen(ligne); idx++) {
aff7segs_digit(stdscr, 27, 8+(idx*9), ligne[idx]);
}
refresh();
usleep(400*1000);
} }
} }