]> git.webhop.me Git - lcd4linux.git/commitdiff
[lcd4linux @ 2006-09-14 20:36:39 by entropy]
authorentropy <entropy@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Thu, 14 Sep 2006 20:36:39 +0000 (20:36 +0000)
committerentropy <entropy@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Thu, 14 Sep 2006 20:36:39 +0000 (20:36 +0000)
Improved example showing how to display network and hdd activity on an usb hub

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

usbhub.conf

index 0d9e8addb4fc5bb3db7704afb778b211f446ec9b..f1ec71e6383277be720ddb32e2ac7450d619f2d5 100644 (file)
@@ -1,7 +1,7 @@
 Variables {
-   tick 500
-   tack 100
-   minute 60000
+   tick 50
+   netstep 0.5
+   diskstep 1.5
 }
 
 Display SitecomHUB {
@@ -38,6 +38,39 @@ Widget GPO_Test600 {
     update 600
 }
 
+
+# Display network activity as pulse duration on the hub leds.
+# currently configured to
+#
+#   0 % pulse width : traffic < exp(10) == 22kbyte/sec
+#  50 % pulse width : traffic about exp(13.5) == 730kbyte/sec
+# 100 % pulse width : traffic > exp(16) == 8886kbyte/sec
+#
+# Which is quite suitable for a 100mbit network.
+
+Widget Net_RX {
+    class 'GPO'
+    expression (exp(10+test::bar(1,6,0,0.5)) < netdev('eth0', 'Rx_bytes', (6/netstep)*2*tick))?2:3
+    update tick
+}  
+Widget Net_TX {
+    class 'GPO'
+    expression (exp(10+test::bar(2,6,0,0.5)) < netdev('eth0', 'Tx_bytes', (6/netstep)*2*tick))?2:3
+    update tick
+}  
+
+# As above, but for disk read/writes, pwm for 0bytes/sec .. 33MB/sec (e^9 * 4096)
+Widget SDA_read {
+    class 'GPO'
+    expression (exp(test::bar(3,9,0,diskstep)) < diskstats('sda', 'read_sectors', (9/diskstep)*2*tick))?2:3
+    update tick
+}
+Widget SDA_write{
+    class 'GPO'
+    expression (exp(test::bar(4,9,0,diskstep)) < diskstats('sda', 'write_sectors', (9/diskstep)*2*tick))?2:3
+    update tick
+}
+
 Layout TestHUB {
    GPO1        'GPO_Test300'
    GPO2        'GPO_Test400'
@@ -45,7 +78,14 @@ Layout TestHUB {
    GPO4        'GPO_Test600'
 }
 
+Layout NetAndHDD {
+  GPO1 'Net_RX'
+  GPO2 'Net_TX'
+  GPO3 'SDA_read'
+  GPO4 'SDA_write'
+}
+
 #Display 'SitecomHUB'
 Display 'TyphoonHUB'
-Layout  'TestHUB'
-
+#Layout  'TestHUB'
+Layout 'NetAndHDD'