aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/picoLCD/lcd4linux.conf.mrtg
blob: b74506b09a641663956cd9ee15b6afa5768ae15f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
pre { line-height: 125%; margin: 0; }
td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
td.linenos pre.special { color: #000000; background-col
Display picoLCD {
    Driver   'picoLCDGraphic'
    Size     '256x64'
    Update    200
    Contrast  230
    Backlight 1
    Inverted   1
    Icons     1
}


Variables {
   n 0
   nkey 0
   currentImage 'http://192.168.12.113/mrtg/127.0.0.1_2-month.png'
   mrtgDayImageURL 'http://192.168.12.113/mrtg/127.0.0.1_2-day.png'
   mrtgWeekImageURL 'http://192.168.12.113/mrtg/127.0.0.1_2-week.png'
   #currentFile '/tmp/127.0.0.1_2-day.png'
   currentFile ' '
   tick 500
   tack 100
   minute 60000
}

Widget TimerW {
    class 'Timer'
    expression n=LCD::GPI(1);nkey=n!=0?n:nkey
    active 1
    update 100
}
                        

# export PYTHONPATH which should point to the scripts usually /etc/picoLCDGraphic/Scripts
Widget MRTGMinute {
    class 'Text'
    expression currentFile=python::exec('mrtg', 'saveimage', currentImage)
    width 42
    #update minute
    update 100
}

Widget test {
    class 'Text'
    expression currentFile
    width 42
    #update minute
    update 100
}

# Python script will save the filename as taken from the URL above in the /etc/picoLCDGraphic/Images path
# Modify mrtg.py to save in another path and also change file tag below
Widget BandwidthImage {
    class 'Image'
    file currentFile
    visible 1
    inverted 0
    reload 1
    #update minute
    update 100
    #update tick
}

Widget GPO_kup {
   class 'GPO'
   expression currentImage=nkey==5?mrtgDayImageURL:currentImage;nkey==5?1:0
   update 300
}
         
  Widget GPO_kdown {
  class 'GPO'
  expression currentImage=nkey==7?mrtgWeekImageURL:currentImage;nkey==7?1:0
  update 300
}
                  

Layout picoLCD {
    Row1 {
	Col1 'MRTGMinute'
    }
    
    Layer 1 {
        X0.Y0 'BandwidthImage'
    }
    
    Timer1 'TimerW'
    GPO2       'GPO_kup'
    GPO3       'GPO_kdown'
       
}

Display 'picoLCD'
Layout  'picoLCD'
> * - use qprintf() where appropriate * - save CPU cycles on gettimeofday() * - add quit() functions to free allocated memory * - fixed lots of memory leaks * * Revision 1.3 2004/01/29 04:40:02 reinelt * every .c file includes "config.h" now * * Revision 1.2 2004/01/11 18:26:02 reinelt * further widget and layout processing * * Revision 1.1 2003/12/19 05:50:34 reinelt * added plugin_math.c and plugin_string.c * */ /* * exported functions: * * int plugin_init_string (void) * adds some handy string functions * */ #include "config.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #include "debug.h" #include "plugin.h" static void my_strlen(RESULT * result, RESULT * arg1) { double value = strlen(R2S(arg1)); SetResult(&result, R_NUMBER, &value); } int plugin_init_string(void) { /* register some basic string functions */ AddFunction("strlen", 1, my_strlen); return 0; } void plugin_exit_string(void) { /* empty */ }