Browse Source

more eyecandy

master
phyto 3 years ago
parent
commit
824f805ef8
3 changed files with 20 additions and 2 deletions
  1. +8
    -0
      viz/curses/ecran.c
  2. +1
    -0
      viz/curses/ecran.h
  3. +11
    -2
      viz/curses/t.c

+ 8
- 0
viz/curses/ecran.c View File

@ -12,6 +12,14 @@
int verbosity;
/* ---------------------------------------------------------------- */
int message(char *txt)
{
standout();
mvaddstr(LINES, 2, txt);
standend();
refresh();
return 0;
}
/* ---------------------------------------------------------------- */
void barre_inverse(char c, int ligne)
{


+ 1
- 0
viz/curses/ecran.h View File

@ -3,6 +3,7 @@
*/
int fond_ecran(char *titre);
int message(char *);
WINDOW * open_waterfall(char *title, int flags);


+ 11
- 2
viz/curses/t.c View File

@ -2,6 +2,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <strings.h>
#include <time.h>
#include <getopt.h>
#include <ncurses.h>
@ -16,7 +17,10 @@ int loop, foo;
char line[100];
WINDOW *water;
static float rvals[4];
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 133 * 1000 * 1000;
water = open_waterfall("premier essai", 0);
@ -28,7 +32,7 @@ for (loop=0; loop<nbl; loop++) {
for (foo=0; foo<4; foo++) {
if (rand()%100<42) {
rvals[foo] += 3.97 * (foo + 1);
rvals[foo] += 4.04 * (foo + 1);
}
if (rvals[foo] > 1023.0) {
rvals[foo] = (float)(rand() % 25);
@ -37,7 +41,12 @@ for (loop=0; loop<nbl; loop++) {
plot_waterfall(water, 1, rvals);
if (rand()%10 < 1) sleep(1);
/* if (rand()%10 < 1) sleep(1); */
foo = nanosleep(&ts, NULL);
if (foo) {
/* got a signal ? */
message("err on nanosleep");
}
}
close_waterfall(water, 0);


Loading…
Cancel
Save