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

View File

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