Subversion Repositories Kolibri OS

Rev

Rev 8353 | Rev 8383 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8353 Rev 8381
Line 1... Line 1...
1
/*
1
/*
2
 * System Monitor
2
 * System Monitor
3
 * version 1.35
3
 * version 1.36
4
 * Author: Leency
4
 * Author: Leency
5
*/
5
*/
Line 6... Line 6...
6
 
6
 
Line 41... Line 41...
41
#define RIGHT_X PROCESS_LIST_W + GAP + GAP + 22
41
#define RIGHT_X PROCESS_LIST_W + GAP + GAP + 22
42
#define ICONGAP 26
42
#define ICONGAP 26
43
#define BOTPANEL_H 36
43
#define BOTPANEL_H 36
Line 44... Line 44...
44
 
44
 
45
#ifdef LANG_RUS
-
 
46
	#define T_CPU_AND_RAM    "à®æ¥áá®à ¨ Ž‡“"
-
 
47
	#define T_DRIVES         "„¨áª¨"
-
 
48
	#define T_PROCESSES      "à®æ¥ááë"
45
#ifdef LANG_RUS
49
	#define T_APP_TITLE      "‘¨á⥬­ë© ¬®­¨â®à"
46
	#define T_APP_TITLE      "‘¨á⥬­ë© ¬®­¨â®à"
50
	#define T_SHOW_SYSTEM    "‘¨á⥬­ë¥"
47
	#define T_SHOW_SYSTEM    "‘¨á⥬­ë¥"
51
	#define T_DETAILS        "®¤à®¡­¥¥"
48
	#define T_DETAILS        "®¤à®¡­¥¥"
52
	#define T_PROC_KILL      "‘­ïâì § ¤ çã"
49
	#define T_PROC_KILL      "‘­ïâì § ¤ çã"
Line 55... Line 52...
55
	#define T_CPU_LOAD       "‡ £à㧪  ¯à®æ¥áá®à  %i%%   "
52
	#define T_CPU_LOAD       "‡ £à㧪  ¯à®æ¥áá®à  %i%%   "
56
	#define T_RAM_USAGE      " ¬ïâì Ž‡“: %i Œ¡ ᢮¡®¤­® ¨§ %i Œ¡"
53
	#define T_RAM_USAGE      " ¬ïâì Ž‡“: %i Œ¡ ᢮¡®¤­® ¨§ %i Œ¡"
57
	#define T_RD_USAGE       "‘¨á⥬­ë© ¤¨áª: %i Š¡ ᢮¡®¤­® ¨§ 1.4 Œ¡"
54
	#define T_RD_USAGE       "‘¨á⥬­ë© ¤¨áª: %i Š¡ ᢮¡®¤­® ¨§ 1.4 Œ¡"
58
	#define T_TMP_USAGE      "TMP%i ¤¨áª: %i Œ¡ ᢮¡®¤­® ¨§ %i Œ¡"
55
	#define T_TMP_USAGE      "TMP%i ¤¨áª: %i Œ¡ ᢮¡®¤­® ¨§ %i Œ¡"
59
#else
56
#else
60
	#define T_CPU_AND_RAM    "CPU & RAM"
-
 
61
	#define T_DRIVES         "Drives"
-
 
62
	#define T_PROCESSES      "Processes"
-
 
63
	#define T_APP_TITLE      "System Monitor"
57
	#define T_APP_TITLE      "System Monitor"
64
	#define T_SHOW_SYSTEM    "System"
58
	#define T_SHOW_SYSTEM    "System"
65
	#define T_DETAILS        "Details"
59
	#define T_DETAILS        "Details"
66
	#define T_PROC_KILL      "Terminate"
60
	#define T_PROC_KILL      "Terminate"
67
	#define T_PROC_INFO      "Info"
61
	#define T_PROC_INFO      "Info"
Line 116... Line 110...
116
{
110
{
117
	int btn;
111
	int btn;
118
	//dword cpu_frequency = GetCpuFrequency()/1000;
112
	//dword cpu_frequency = GetCpuFrequency()/1000;
119
	load_lib();
113
	load_lib();
120
	SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
114
	SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
121
	loop() switch(@WaitEventTimeout(120))
115
	loop() switch(@WaitEventTimeout(50))
122
	{
116
	{
123
	   	case evMouse:
117
	   	case evMouse:
124
			SelectList_ProcessMouse();
118
			SelectList_ProcessMouse();
125
			break;
119
			break;
126
		case evKey:
120
		case evKey:
Line 173... Line 167...
173
			//WriteText(RIGHT_X, WIN_CONTENT_Y+25, 0x90, sc.work, "Update period: 5 seconds");
167
			//WriteText(RIGHT_X, WIN_CONTENT_Y+25, 0x90, sc.work, "Update period: 5 seconds");
174
			cpu.set_size(RIGHT_X, WIN_CONTENT_Y+25, right_w, 100);
168
			cpu.set_size(RIGHT_X, WIN_CONTENT_Y+25, right_w, 100);
175
			ram.set_size(RIGHT_X, WIN_CONTENT_Y+170, right_w, 23);
169
			ram.set_size(RIGHT_X, WIN_CONTENT_Y+170, right_w, 23);
176
			rd.set_size(RIGHT_X, WIN_CONTENT_Y+240, right_w, 23);
170
			rd.set_size(RIGHT_X, WIN_CONTENT_Y+240, right_w, 23);
177
		default:
171
		default:
178
			SelectList_LineChanged();
-
 
179
			MonitorCpu();
172
			MonitorCpu();
180
			MonitorRam();
173
			MonitorRam();
-
 
174
			SelectList_LineChanged();
181
			MonitorRd();
175
			MonitorRd();
182
			MonitorTmp();
176
			MonitorTmp();
183
	}
177
	}
184
}
178
}
Line 341... Line 335...
341
	if (cpu_stack[pos]<=2) || (cpu_stack[pos]>cpu.h) cpu_stack[pos]=2;
335
	if (cpu_stack[pos]<=2) || (cpu_stack[pos]>cpu.h) cpu_stack[pos]=2;
Line 342... Line 336...
342
	
336
	
343
	sprintf(#param, T_CPU_LOAD, cpu_stack[pos]);
337
	sprintf(#param, T_CPU_LOAD, cpu_stack[pos]);
Line -... Line 338...
-
 
338
	DrawIconWithText(RIGHT_X, cpu.y - 25, 48, #param);
344
	DrawIconWithText(RIGHT_X, cpu.y - 25, 48, #param);
339
	
345
	
340
	#define LINEW 8
346
	for (i=0; i
341
	for (i=0; i
347
		DrawBar(i+cpu.x, cpu.y, 1, cpu.h-cpu_stack[i], PROGRESS_BG);
-
 
348
		DrawBar(i+cpu.x, cpu.h-cpu_stack[i]+cpu.y, 1, cpu_stack[i], LOAD_CPU);
342
		DrawBar(i+cpu.x, cpu.y, LINEW, cpu.h-cpu_stack[i], PROGRESS_BG);
349
 
343
		DrawBar(i+cpu.x, cpu.h-cpu_stack[i]+cpu.y, LINEW, cpu_stack[i], 0xDFA13B);
Line 350... Line 344...
350
		DrawBar(i+1+cpu.x, cpu.y, 1, cpu.h, PROGRESS_BG);
344
		//DrawBar(i+LINEW+cpu.x, cpu.y, 1, cpu.h, PROGRESS_BG);
351
	}
345
	}
352
 
346