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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
|
patch to fix OSD Font Problems with VDR-1.5.3
and fix kill VDR by call the plugin on OSD
based on fix, found on linuxtv ML
Joerg Bornkessel <hd_brummy@gentoo.org> 03 Jul 2007
diff -Naur sysinfo-0.1.0a.orig/sysinfoosd.c sysinfo-0.1.0a/sysinfoosd.c
--- sysinfo-0.1.0a.orig/sysinfoosd.c 2007-07-03 23:48:48.943355433 +0200
+++ sysinfo-0.1.0a/sysinfoosd.c 2007-07-03 23:51:42.181449172 +0200
@@ -81,7 +81,11 @@
int iHalfWidth = (int)(iWidth/2);
int iHalfHeight = (int)(iHeight/2);
asprintf(&cTemp, tr("PLEASE WAIT..."));
+#if VDRVERSNUM >=10503
+ osd->DrawText(iHalfWidth-100, iHalfHeight-20, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+#else
osd->DrawText(iHalfWidth-100, iHalfHeight-20, cTemp, pal[3],pal[1],font);
+#endif
free (cTemp);
DisplayBitmap();
}
@@ -140,15 +144,39 @@
osd->DrawRectangle(iWidth-129, 0, 2, 33, pal[2]);
// Draw test
asprintf(&cTemp, "SysInfo %s", VERSION);
+#if VDRVERSNUM >=10503
+ osd->DrawText(10, 3, cTemp, pal[2],pal[3],cFont::GetFont(fontOsd));
+ free (cTemp);
+ osd->DrawText(iWidth-120, 3, "by Kikko77", pal[2],pal[3],cFont::GetFont(fontOsd));
+#else
osd->DrawText(10, 3, cTemp, pal[2],pal[3],font);
free (cTemp);
osd->DrawText(iWidth-120, 3, "by Kikko77", pal[2],pal[3],font);
+#endif
}
void cSysInfoOsd::SensorData(int iTop) {
// Temperature
char cTemp[100]; // 2DO
sprintf(cTemp, tr("CPU temperature:"));
+#if VDRVERSNUM >=10503
+ osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ sprintf(cTemp, tr("M/B temperature:"));
+ osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ ExecShellCmd("/usr/share/vdr/sysinfo/sysinfo.sh cputemp", cTemp);
+ osd->DrawText(270, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ ExecShellCmd("/usr/share/vdr/sysinfo/sysinfo.sh mbtemp", cTemp);
+ osd->DrawText(270, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ // Fan rpm
+ sprintf(cTemp, tr("Fan1:"));
+ osd->DrawText(((iWidth/2)+20), iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ sprintf(cTemp, tr("Fan2:"));
+ osd->DrawText(((iWidth/2)+20), iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ ExecShellCmd("/usr/share/vdr/sysinfo/sysinfo.sh cpufan", cTemp);
+ osd->DrawText(((iWidth/2)+170), iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ ExecShellCmd("/usr/share/vdr/sysinfo/sysinfo.sh mbfan", cTemp);
+ osd->DrawText(((iWidth/2)+170), iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+#else
osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],font);
sprintf(cTemp, tr("M/B temperature:"));
osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],font);
@@ -165,6 +193,7 @@
osd->DrawText(((iWidth/2)+170), iTop+10, cTemp, pal[3],pal[1],font);
ExecShellCmd("/usr/share/vdr/sysinfo/sysinfo.sh mbfan", cTemp);
osd->DrawText(((iWidth/2)+170), iTop+40, cTemp, pal[3],pal[1],font);
+#endif
// Draw line separator
osd->DrawRectangle(iTop+74, 0, iWidth, 1, pal[2]);
}
@@ -173,9 +202,15 @@
void cSysInfoOsd::VideoSpace(int iTop) {
char cTemp[100]; // 2DO
sprintf(cTemp, tr("Video disk free space:"));
+#if VDRVERSNUM >=10503
+ osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ ExecShellCmd("/usr/share/vdr/sysinfo/sysinfo.sh vidspace", cTemp);
+ osd->DrawText(285, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+#else
osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],font);
ExecShellCmd("/usr/share/vdr/sysinfo/sysinfo.sh vidspace", cTemp);
osd->DrawText(285, iTop+10, cTemp, pal[3],pal[1],font);
+#endif
// Draw line separator
osd->DrawRectangle(iTop+46, 0, iWidth, 1, pal[2]);
}
@@ -184,6 +219,22 @@
char cTemp[100]; // 2DO
sprintf(cTemp, tr("Linux kernel:"));
+#if VDRVERSNUM >=10503
+ osd->DrawText(15, 40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ sprintf(cTemp, tr("CPU type:"));
+ osd->DrawText(15, 70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ // Kernel and cpu type
+ ExecShellCmd("uname -r", cTemp);
+ osd->DrawText(160, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ ExecShellCmd("cat /proc/cpuinfo | grep 'processor' |grep '1'", cTemp);
+ if (cTemp[0]=='\0') {
+ ExecShellCmd("cat /proc/cpuinfo | grep 'model name' | cut -c 14-58 | uniq", cTemp);
+ osd->DrawText(160, iTop+70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ } else {
+ ExecShellCmd("cat /proc/cpuinfo | grep 'model name' | cut -c 14-58 | uniq", cTemp);
+ osd->DrawText(160, iTop+70, "2 x ", pal[3],pal[1],cFont::GetFont(fontOsd));
+ osd->DrawText(200, iTop+70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+#else
osd->DrawText(15, 40, cTemp, pal[3],pal[1],font);
sprintf(cTemp, tr("CPU type:"));
osd->DrawText(15, 70, cTemp, pal[3],pal[1],font);
@@ -198,6 +249,7 @@
ExecShellCmd("cat /proc/cpuinfo | grep 'model name' | cut -c 14-58 | uniq", cTemp);
osd->DrawText(160, iTop+70, "2 x ", pal[3],pal[1],font);
osd->DrawText(200, iTop+70, cTemp, pal[3],pal[1],font);
+#endif
}
// Draw line separator
osd->DrawRectangle(iTop+104, 0, iWidth, 1, pal[2]);
@@ -214,10 +266,17 @@
// Cpu Speed
sprintf(cTemp, tr("CPU speed:"));
+#if VDRVERSNUM >=10503
+ osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ ExecShellCmd("cat /proc/cpuinfo | grep 'cpu MHz' | cut -c 12-60", cTemp);
+ asprintf(&cTmp, "%d MHz", atoi(cTemp));
+ osd->DrawText(190, iTop+10, cTmp, pal[3],pal[1],cFont::GetFont(fontOsd), 110, 0, taRight);
+#else
osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],font);
ExecShellCmd("cat /proc/cpuinfo | grep 'cpu MHz' | cut -c 12-60", cTemp);
asprintf(&cTmp, "%d MHz", atoi(cTemp));
osd->DrawText(190, iTop+10, cTmp, pal[3],pal[1],font, 110, 0, taRight);
+#endif
free(cTmp);
// Calculate cpu free
@@ -226,16 +285,28 @@
iPerCentCpu=atoi(cTemp);
if (iPerCentCpu>100) iPerCentCpu=100;
sprintf(cTemp, tr("CPU used:"));
+#if VDRVERSNUM >=10503
+ osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ asprintf(&cTmp, "%d%%", iPerCentCpu);
+ osd->DrawText(215, iTop+40, cTmp, pal[3],pal[1],cFont::GetFont(fontOsd), 85, 0, taRight);
+#else
osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],font);
asprintf(&cTmp, "%d%%", iPerCentCpu);
osd->DrawText(215, iTop+40, cTmp, pal[3],pal[1],font, 85, 0, taRight);
+#endif
free(cTmp);
// CPU free
sprintf(cTemp, tr("CPU free:"));
+#if VDRVERSNUM >=10503
+ osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ asprintf(&cTmp, "%d%%", 100-iPerCentCpu);
+ osd->DrawText(215, iTop+40, cTmp, pal[3],pal[1],cFont::GetFont(fontOsd), 85, 0, taRight);
+#else
osd->DrawText(15, iTop+70, cTemp, pal[3],pal[1],font);
asprintf(&cTmp, "%d%%", 100-iPerCentCpu);
osd->DrawText(215, iTop+70, cTmp, pal[3],pal[1],font, 85, 0, taRight);
+#endif
free(cTmp);
// Cpu Graph
@@ -259,30 +330,55 @@
// total memory
sprintf(cTemp, tr("Total memory:"));
+#if VDRVERSNUM >=10503
+ osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ ExecShellCmd("cat /proc/meminfo | grep -i 'MEMTOTAL' | cut -c 16-23 | tr -d ' '", cTemp);
+ dTemp=atof(cTemp);
+ int iMemTotal=(int)(dTemp/1024);
+ asprintf(&cTmp, "%d MB", iMemTotal);
+ osd->DrawText(215, iTop+10, cTmp, pal[3],pal[1],cFont::GetFont(fontOsd), 85, 0, taRight);
+#else
osd->DrawText(15, iTop+10, cTemp, pal[3],pal[1],font);
ExecShellCmd("cat /proc/meminfo | grep -i 'MEMTOTAL' | cut -c 16-23 | tr -d ' '", cTemp);
dTemp=atof(cTemp);
int iMemTotal=(int)(dTemp/1024);
asprintf(&cTmp, "%d MB", iMemTotal);
osd->DrawText(215, iTop+10, cTmp, pal[3],pal[1],font, 85, 0, taRight);
+#endif
free(cTmp);
// Free memory
sprintf(cTemp, tr("Free memory:"));
+#if VDRVERSNUM >=10503
+ osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ ExecShellCmd("cat /proc/meminfo | grep -i 'MEMFREE' | cut -c 16-23 | tr -d ' '", cTemp);
+ dTemp=atof(cTemp);
+ int iMemFree=(int)(dTemp/1024);
+ asprintf(&cTmp, "%d MB", iMemFree);
+ osd->DrawText(215, iTop+40, cTmp, pal[3],pal[1],cFont::GetFont(fontOsd), 85, 0, taRight);
+#else
osd->DrawText(15, iTop+40, cTemp, pal[3],pal[1],font);
ExecShellCmd("cat /proc/meminfo | grep -i 'MEMFREE' | cut -c 16-23 | tr -d ' '", cTemp);
dTemp=atof(cTemp);
int iMemFree=(int)(dTemp/1024);
asprintf(&cTmp, "%d MB", iMemFree);
osd->DrawText(215, iTop+40, cTmp, pal[3],pal[1],font, 85, 0, taRight);
+#endif
free(cTmp);
// Used memory
sprintf(cTemp, tr("Used memory:"));
+#if VDRVERSNUM >=10503
+ osd->DrawText(15, iTop+70, cTemp, pal[3],pal[1],cFont::GetFont(fontOsd));
+ int iMemUsed=iMemTotal-iMemFree;
+ asprintf(&cTmp, "%d MB", iMemUsed);
+ osd->DrawText(215, iTop+70, cTmp, pal[3],pal[1],cFont::GetFont(fontOsd), 85, 0, taRight);
+#else
osd->DrawText(15, iTop+70, cTemp, pal[3],pal[1],font);
int iMemUsed=iMemTotal-iMemFree;
asprintf(&cTmp, "%d MB", iMemUsed);
osd->DrawText(215, iTop+70, cTmp, pal[3],pal[1],font, 85, 0, taRight);
+#endif
free(cTmp);
// Mem Graph
@@ -336,7 +432,11 @@
//static const cFont *font = cFont::GetFont(fontOsd);
char *cTmp;
asprintf(&cTmp, "%d %%", iValue);
+#if VDRVERSNUM >=10503
+ osd->DrawText(iTextLeft, iTextTop, cTmp, pal[3], pal[2], cFont::GetFont(fontOsd));
+#else
osd->DrawText(iTextLeft, iTextTop, cTmp, pal[3], pal[2], font);
+#endif
free(cTmp);
//oProgressOsd->DrawText(iTextLeft, iTextTop, cTemp, pal[3], pal[2], font);
diff -Naur sysinfo-0.1.0a.orig/sysinfoosd.h sysinfo-0.1.0a/sysinfoosd.h
--- sysinfo-0.1.0a.orig/sysinfoosd.h 2007-07-03 23:48:48.963354060 +0200
+++ sysinfo-0.1.0a/sysinfoosd.h 2007-07-03 23:49:21.531115750 +0200
@@ -5,8 +5,10 @@
#include <vdr/menuitems.h>
#include <ctype.h>
+#if VDRVERSNUM <10503
static const cFont *font = cFont::GetFont(fontOsd);
static const int LINEHEIGHT = font->Height();
+#endif
#define NBLINES 4
class cSysInfoOsd : public cThread, public cOsdObject {
|