]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2000-12-07 20:47:54 by reinelt]
authorreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Thu, 7 Dec 2000 20:47:54 +0000 (20:47 +0000)
committerreinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Thu, 7 Dec 2000 20:47:54 +0000 (20:47 +0000)
first try for SIN bars

git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@75 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

SIN.c
TODO
lcd4linux.conf.sample

diff --git a/SIN.c b/SIN.c
index d5c8e46243f4c4a020565e13c982425333cecb76..0c2ebcb3e29c69b3cf7fe9d7c35d1e5232c17d18 100644 (file)
--- a/SIN.c
+++ b/SIN.c
@@ -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
  *
  *
  *
  * $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>
 #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 }
 };
diff --git a/TODO b/TODO
index d894a320ab4020932b36996b6b8c467fd71beba9..ef90d30d8bcbcee53034a81650057d8dcbe0a435 100644 (file)
--- a/TODO
+++ b/TODO
@@ -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 $
index fd4d0acf5b3bf521de42efb821cccea04152ac4d..fac0770e3b6d589dfc9aec71448e523020097f07 100644 (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"