[lcd4linux @ 2000-12-07 20:47:54 by reinelt]

first try for SIN bars

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@75 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
This commit is contained in:
reinelt
2000-12-07 20:47:54 +00:00
parent 1c777e24c1
commit fa39c49d89
3 changed files with 55 additions and 10 deletions
+40 -8
View File
@@ -1,4 +1,4 @@
/* $Id: SIN.c,v 1.4 2000/12/01 20:42:37 reinelt Exp $
/* $Id: SIN.c,v 1.5 2000/12/07 20:47:54 reinelt Exp $
*
* driver for SIN router displays
*
@@ -20,6 +20,10 @@
*
*
* $Log: SIN.c,v $
* Revision 1.5 2000/12/07 20:47:54 reinelt
*
* first try for SIN bars
*
* Revision 1.4 2000/12/01 20:42:37 reinelt
*
* added debugging of SIN driver output, probably found the positioning bug (format %02x instead of %2x)
@@ -43,8 +47,7 @@
*
* exported fuctions:
*
* struct LCD SIN[]
*
* struct LCD SIN[] *
*/
#include <stdlib.h>
@@ -61,11 +64,11 @@
#include "lock.h"
#include "display.h"
#define XRES 5
#define YRES 8
// FIXME: 6x8
#define XRES 1
#define YRES 1
// Fixme: Bar Support disabled
#define BARS 0
#define BARS ( BAR_L | BAR_R )
static LCD Lcd;
static char *Port=NULL;
@@ -193,6 +196,35 @@ int SIN_put (int row, int col, char *text)
return 0;
}
int SIN_bar (int type, int row, int col, int max, int len, int dummy)
{
int rev=0;
if (len<1) len=1;
else if (len>max) len=max;
switch (type) {
case BAR_L:
len=max-len;
rev=1;
case BAR_R:
while (max>0 && col<=Lcd.cols) {
if (len>=XRES) {
Txt[row][col]=rev?0x19:0x18;
len-=XRES;
} else {
Txt[row][col]=rev?0x18:0x19;
len=0;
}
max-=XRES;
col++;
}
break;
}
return 0;
}
int SIN_flush (void)
{
char buffer[256]="\015\033T"; // place text
@@ -223,6 +255,6 @@ int SIN_quit (void)
}
LCD SIN[] = {
{ "SIN", 8, 40, XRES, YRES, BARS, SIN_init, SIN_clear, SIN_put, NULL, SIN_flush, SIN_quit },
{ "SIN", 8, 40, XRES, YRES, BARS, SIN_init, SIN_clear, SIN_put, SIN_bar, SIN_flush, SIN_quit },
{ NULL }
};
+14 -1
View File
@@ -13,4 +13,17 @@ show partition information (used, free, ...)
2000-04-25 Michael Mueller <m.mueller@netsystec.de>
show process information
$Id: TODO,v 1.2 2000/04/28 05:19:55 reinelt Exp $
2000-12-03 Ghassan Matar <gmatar@hexapods.com>
show other sensors than temperature
we have to use libsensors instead of parsing the proc files directly
2000-12-03 Ghassan Matar <gmatar@hexapods.com>
show contents of any text file
the file should only contain one line, with a fixed format
there are two possibilities: text and numbers
numbers can be used for bars, too
2000-12-03 Ghassan Matar <gmatar@hexapods.com>
accept data from external sources (fifo?)
$Id: TODO,v 1.3 2000/12/07 20:47:54 reinelt Exp $
+1 -1
View File
@@ -42,7 +42,7 @@
#background \#a0d000
Display SIN
Port /dev/ttyS1
Port /dev/tty9
Row1 "Disk%dm $R10dr+dw"
Row2 "Net %nm $R10nr+nw"