aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorentropy <entropy@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-09-14 20:36:39 +0000
committerentropy <entropy@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2006-09-14 20:36:39 +0000
commit5fb6f5e2592635ceb7fb9b0e2771968453234c12 (patch)
treea22477fea1df465b917ee29aba98eb96a00d34de
parentbebbbc7506b5edc95b0c7a891d4f4d04a09d635a (diff)
downloadlcd4linux-5fb6f5e2592635ceb7fb9b0e2771968453234c12.tar.gz
[lcd4linux @ 2006-09-14 20:36:39 by entropy]
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
-rw-r--r--usbhub.conf50
1 files changed, 45 insertions, 5 deletions
diff --git a/usbhub.conf b/usbhub.conf
index 0d9e8ad..f1ec71e 100644
--- a/usbhub.conf
+++ b/usbhub.conf
@@ -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'