|
From: <cza...@us...> - 2010-04-08 16:38:48
|
Revision: 531
http://g15daemon.svn.sourceforge.net/g15daemon/?rev=531&view=rev
Author: czarnyckm
Date: 2010-04-08 16:38:37 +0000 (Thu, 08 Apr 2010)
Log Message:
-----------
- Fix time info
- Improve Fan / Temperature Screens leading labels position
- Improve Fan / Temperature Screens height calculation
- Improve Summary Screen multi bar (temperature and network)
Modified Paths:
--------------
trunk/g15daemon-clients/g15stats/ChangeLog
trunk/g15daemon-clients/g15stats/configure.in
trunk/g15daemon-clients/g15stats/g15stats.c
Modified: trunk/g15daemon-clients/g15stats/ChangeLog
===================================================================
--- trunk/g15daemon-clients/g15stats/ChangeLog 2010-02-17 11:34:11 UTC (rev 530)
+++ trunk/g15daemon-clients/g15stats/ChangeLog 2010-04-08 16:38:37 UTC (rev 531)
@@ -65,3 +65,8 @@
- Change bottom info bar content to the component default one
- Activate variable CPUs count with the option -vc
- Improve Fan bottom info
+SVN 531 (1.9.4)
+- Fix time info
+- Improve Fan / Temperature Screens leading labels position
+- Improve Fan / Temperature Screens height calculation
+- Improve Summary Screen multi bar (temperature and network)
Modified: trunk/g15daemon-clients/g15stats/configure.in
===================================================================
--- trunk/g15daemon-clients/g15stats/configure.in 2010-02-17 11:34:11 UTC (rev 530)
+++ trunk/g15daemon-clients/g15stats/configure.in 2010-04-08 16:38:37 UTC (rev 531)
@@ -1,7 +1,7 @@
-AC_INIT(g15stats,[1.9.3], [mla...@us...])
+AC_INIT(g15stats,[1.9.4], [mla...@us...])
PACKAGE=g15stats
-VERSION=1.9.3
+VERSION=1.9.4
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
Modified: trunk/g15daemon-clients/g15stats/g15stats.c
===================================================================
--- trunk/g15daemon-clients/g15stats/g15stats.c 2010-02-17 11:34:11 UTC (rev 530)
+++ trunk/g15daemon-clients/g15stats/g15stats.c 2010-04-08 16:38:37 UTC (rev 531)
@@ -566,6 +566,7 @@
time(&now);
sprintf(tmpstr,"%s",ctime(&now));
+ tmpstr[(strlen(tmpstr) - 1)] = '\0';
g15r_renderString (canvas, (unsigned char*)tmpstr, 0, G15_TEXT_SMALL, 80-(strlen(tmpstr)*4)/2, INFO_ROW);
}
@@ -627,17 +628,23 @@
if (count) {
int j = 0;
- int rest;
- int step = (int) (y2 / count);
+ int rest, step;
+ step = y2 / count;
rest = y2 - (step * count);
int y = cur_shift + y1;
int last_y;
for (j = 0; j < count; j++) {
last_y = y;
+ if( j ) last_y++;
y += step;
if (rest > 0) {
- rest--;
- y++;
+ if ((j+1) < count) {
+ y++;
+ rest--;
+ } else {
+ y += rest;
+ rest = 0;
+ }
}
drawBar_both(canvas, last_y + move, y + move, sensors[j].cur + 1, tot_max, tot_max - sensors[j].cur, tot_max);
}
@@ -687,11 +694,10 @@
y = y2 / 2;
drawLine_both(canvas, cur_shift + y1 + move, cur_shift + y2 + move);
+
drawBar_both(canvas, cur_shift + y1 + move, cur_shift + y + move, net_cur_in + 1, net_max_in, net_max_in - net_cur_in, net_max_in);
+ drawBar_both(canvas, cur_shift + y + move + 1, cur_shift + y2 + move, net_cur_out + 1, net_max_out, net_max_out - net_cur_out, net_max_out);
-
- drawBar_both(canvas, cur_shift + y + move, cur_shift + y2 + move, net_cur_out + 1, net_max_out, net_max_out - net_cur_out, net_max_out);
-
if (net_cur_in > net_cur_out) {
sprintf(tmpstr, "IN %s", show_bytes_short((int) net_cur_in));
} else {
@@ -1266,36 +1272,56 @@
int j = 0;
- int shift;
- shift = 32 / count;
+ if (all) {
+ int shift;
+ int info_shift;
- if (count) {
- if (all) {
- g15r_clearScreen(canvas, G15_COLOR_WHITE);
- print_vert_label(canvas, vert_label);
+ shift = BAR_BOTTOM / count;
- for (j = 0; j < count; j++) {
- register int bar_top = (j * shift) + 1 + j;
- register int bar_bottom = ((j + 1)*shift) + j;
- sprintf(tmpstr, format_main, j + 1, probes[j].cur);
- g15r_renderString(canvas, (unsigned char*) tmpstr, 0, G15_TEXT_MED, 1, bar_top + 1);
- drawBar_both(canvas, bar_top, bar_bottom, probes[j].cur + 1, tot_max, tot_max - probes[j].cur, tot_max);
- }
- drawLine_both(canvas, 1, ((j*shift) + j-1));
+ switch (count) {
+ case 1:
+ info_shift = 14;
+ shift = 33;
+ break;
+ case 2:
+ info_shift = 5;
+ break;
+ case 3:
+ info_shift = 2;
+ shift = 10;
+ break;
+ default:
+ info_shift = 1;
+ break;
}
- if ((!all) || (info_cycle == screen_type)) {
- char extension[16];
- tmpstr[0] = '\0';
- for (j = 0; j < count; j++) {
- sprintf(extension, format_bottom, j + 1, probes[j].cur);
- if (j) {
- strcat(tmpstr, "| ");
- }
- strcat(tmpstr, extension);
+ g15r_clearScreen(canvas, G15_COLOR_WHITE);
+ print_vert_label(canvas, vert_label);
+
+ int bar_top, bar_bottom;
+ bar_bottom = BAR_BOTTOM;
+ for (j = 0; j < count; j++) {
+ bar_top = (j * shift) + 1 + j;
+ bar_bottom = ((j + 1)*shift) + j;
+
+ sprintf(tmpstr, format_main, j + 1, probes[j].cur);
+ g15r_renderString(canvas, (unsigned char*) tmpstr, 0, G15_TEXT_MED, 1, bar_top + info_shift);
+ drawBar_both(canvas, bar_top, bar_bottom, probes[j].cur + 1, tot_max, tot_max - probes[j].cur, tot_max);
+ }
+ drawLine_both(canvas, 1, bar_bottom);
+ }
+
+ if ((!all) || (info_cycle == screen_type)) {
+ char extension[16];
+ tmpstr[0] = '\0';
+ for (j = 0; j < count; j++) {
+ sprintf(extension, format_bottom, j + 1, probes[j].cur);
+ if (j) {
+ strcat(tmpstr, "| ");
}
- g15r_renderString(canvas, (unsigned char*) tmpstr, 0, G15_TEXT_SMALL, 80 - (strlen(tmpstr)*4) / 2, INFO_ROW);
+ strcat(tmpstr, extension);
}
+ g15r_renderString(canvas, (unsigned char*) tmpstr, 0, G15_TEXT_SMALL, 80 - (strlen(tmpstr)*4) / 2, INFO_ROW);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|