From c52b1659b592e86a9c4374965faec8d74503f2d2 Mon Sep 17 00:00:00 2001 From: tth Date: Tue, 29 Jan 2019 23:25:59 +0100 Subject: [PATCH] more improvment on seven segments --- viz/curses/7segments.c | 35 +++++++++++++++++++++++++++++++++-- viz/curses/ecran.c | 3 +++ viz/curses/ecran.h | 2 ++ viz/curses/t.c | 38 +++++++++++++++++++++++++++++++++----- 4 files changed, 71 insertions(+), 7 deletions(-) diff --git a/viz/curses/7segments.c b/viz/curses/7segments.c index 6b52458..ad94fed 100644 --- a/viz/curses/7segments.c +++ b/viz/curses/7segments.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -110,8 +110,9 @@ switch (digit) { case ' ': bits = 0; break; case '.': bits = 0x80; break; + case '-': bits = 0x40; break; - default: bits = 0x09; break; + default: bits = 0x49; break; } aff7segs_base(win, lig, col, bits, 0); @@ -119,4 +120,34 @@ aff7segs_base(win, lig, col, bits, 0); return 0; } /* ---------------------------------------------------------------- */ +int aff7segs_short(WINDOW * win, int lig, int col, short value) +{ +char buff[10]; +int idx; +sprintf(buff, "%6d", value); +mvwaddstr(win, lig-1, col, buff); +for (idx=0; idx