2019-01-24 08:39:03 +11:00
|
|
|
/*
|
|
|
|
* DD2 Monitoring
|
|
|
|
*
|
|
|
|
* ncurses seven segment display
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <strings.h>
|
|
|
|
#include <getopt.h>
|
|
|
|
#include <ncurses.h>
|
|
|
|
|
|
|
|
#include "ecran.h"
|
|
|
|
|
|
|
|
int verbosity;
|
|
|
|
|
|
|
|
/* ---------------------------------------------------------------- */
|
|
|
|
int vumetre_0(WINDOW *win, int lig, int col, float val, int larg)
|
|
|
|
{
|
2019-01-24 11:00:18 +11:00
|
|
|
int foo, posc;
|
2019-01-24 08:39:03 +11:00
|
|
|
|
|
|
|
#if DEBUG_LEVEL
|
|
|
|
fprintf(stderr, ">>> %s ( %p %d %d %f %d )\n",
|
|
|
|
__func__, win, lig, col, val, larg);
|
|
|
|
#endif
|
|
|
|
|
2019-01-24 11:00:18 +11:00
|
|
|
posc = (int)(val * (float)larg);
|
|
|
|
|
2019-01-24 08:39:03 +11:00
|
|
|
for (foo=0; foo<larg; foo++) {
|
2019-01-24 11:00:18 +11:00
|
|
|
mvwaddch(win, lig, col+foo, "-*"[foo < posc]);
|
|
|
|
if (foo & 1) {
|
|
|
|
mvwaddch(win, lig-1, col+foo, '\\');
|
|
|
|
mvwaddch(win, lig+1, col+foo, '/');
|
|
|
|
}
|
2019-01-24 08:39:03 +11:00
|
|
|
}
|
2019-01-24 11:00:18 +11:00
|
|
|
wrefresh(win);
|
2019-01-24 08:39:03 +11:00
|
|
|
|
2019-01-24 11:00:18 +11:00
|
|
|
return 0;
|
2019-01-24 08:39:03 +11:00
|
|
|
}
|
|
|
|
/* ---------------------------------------------------------------- */
|
|
|
|
/* ---------------------------------------------------------------- */
|
|
|
|
|