Commit 9829d2794b7e0fff700e9d56786bec674fb70d16

Kano 2014-02-19T16:38:21

avalon, bab, drillbit, klondike use more screen space rather than truncating info

diff --git a/driver-avalon.c b/driver-avalon.c
index 1533ae9..1d00a5f 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -1479,7 +1479,7 @@ static void get_avalon_statline_before(char *buf, size_t bufsiz, struct cgpu_inf
 			temp = 99;
 		if (temp < 0)
 			temp = 0;
-		tailsprintf(buf, bufsiz, "%2dC %3d %4dmV", temp, info->frequency, info->core_voltage);
+		tailsprintf(buf, bufsiz, "%2dC %3dMHz %4dmV", temp, info->frequency, info->core_voltage);
 	} else {
 		/* Find the lowest fan speed of the ASIC cooling fans. */
 		if (info->fan1 >= 0 && info->fan1 < lowfan)
diff --git a/driver-bab.c b/driver-bab.c
index c7c46e8..2d28f8e 100644
--- a/driver-bab.c
+++ b/driver-bab.c
@@ -2970,33 +2970,34 @@ static void bab_get_statline_before(char *buf, size_t bufsiz, struct cgpu_info *
 #if UPDATE_HISTORY
 	struct timeval now;
 	double elapsed;
-	int i, dead = 0;
+	int i, bad = 0;
 
 	cgtime(&now);
 	elapsed = tdiff(&now, &(babcgpu->dev_start_tv));
 
-	// At least get 15s of nonces before saying anything is dead
+	// At least get 15s of nonces before saying anything is bad
 	if (elapsed > 15.0) {
 		K_RLOCK(babinfo->nfree_list);
 		for (i = 0; i < babinfo->chips; i++) {
-			if (babinfo->disabled[i] ||
-			    (babinfo->good_nonces[i]->count == 0 &&
-			     babinfo->bad_nonces[i]->count > 1))
-				dead++;
+			if (babinfo->good_nonces[i]->count == 0 &&
+			     babinfo->bad_nonces[i]->count > 1)
+				bad++;
 		}
 		K_RUNLOCK(babinfo->nfree_list);
 	}
 
-	tailsprintf(buf, bufsiz, "%d.%02d.%03d D:%03d",
+	tailsprintf(buf, bufsiz, "%d.%02d.%03d B:%03d D:%03d",
 				 babinfo->banks,
 				 babinfo->boards,
 				 babinfo->chips,
-				 dead);
+				 bad,
+				 babinfo->total_disabled);
 #else
-	tailsprintf(buf, bufsiz, "B:%d B:%02d C:%03d",
+	tailsprintf(buf, bufsiz, "%d.%02d.%03d D:%03d",
 				 babinfo->banks,
 				 babinfo->boards,
-				 babinfo->chips);
+				 babinfo->chips,
+				 babinfo->total_disabled);
 #endif
 }
 #endif
diff --git a/driver-drillbit.c b/driver-drillbit.c
index 9550a57..08bc997 100644
--- a/driver-drillbit.c
+++ b/driver-drillbit.c
@@ -422,27 +422,17 @@ static void drillbit_updatetemps(struct thr_info *thr)
 static void drillbit_get_statline_before(char *buf, size_t bufsiz, struct cgpu_info *drillbit)
 {
 	struct drillbit_info *info = drillbit->device_data;
-	int temp, max_temp, space = 0;
-
-	temp = (int)(info->temp);
-
-	tailsprintf(buf, bufsiz, "%c%d", info->product[0], info->num_chips);
-	if (info->num_chips < 10)
-		space++;
-
-	if ((info->capabilities & CAP_TEMP) && temp != 0) {
-		if (temp > 999) // Fixed display space
-			temp = 999;
-		max_temp = (int)(info->max_temp);
-		if (max_temp > 999) // Fixed display space
-			max_temp = 999;
-		if (max_temp < 100)
-			space++;
-		tailsprintf(buf, bufsiz, " %2d max%d.%d%*s",
-					 temp / 10, max_temp / 10, max_temp % 10, space, "");
+
+	if ((info->capabilities & CAP_TEMP) && info->temp != 0) {
+		tailsprintf(buf, bufsiz, "%c%2d %.1fC max%.1fC",
+					 info->product[0],
+					 info->num_chips,
+					 (float)(info->temp/10.0),
+					 (float)(info->max_temp/10.0));
 	} else {
-		// Space out to the same width as if there was a temp field in place
-		tailsprintf(buf, bufsiz, "           %*s", space, "");
+		tailsprintf(buf, bufsiz, "%c%2d",
+					 info->product[0],
+					 info->num_chips);
 	}
 }
 
diff --git a/driver-klondike.c b/driver-klondike.c
index 43adbae..a619309 100644
--- a/driver-klondike.c
+++ b/driver-klondike.c
@@ -1417,7 +1417,6 @@ static void get_klondike_statline_before(char *buf, size_t siz, struct cgpu_info
 	uint16_t fan = 0;
 	uint16_t clock = 0;
 	int dev, slaves;
-	char tmp[16];
 
 	if (klninfo->status == NULL) {
 		blank_get_statline_before(buf, siz, klncgpu);
@@ -1436,17 +1435,13 @@ static void get_klondike_statline_before(char *buf, size_t siz, struct cgpu_info
 	fan /= slaves + 1;
 	//fan *= 100/255; // <-- You can't do this because int 100 / int 255 == 0
         fan = 100 * fan / 255;
-	if (fan > 99) // short on screen space
-		fan = 99;
+	if (fan > 100)
+		fan = 100;
 	clock /= slaves + 1;
 	if (clock > 999) // error - so truncate it
 		clock = 999;
 
-	snprintf(tmp, sizeof(tmp), "%2.0fC", cvtKlnToC(temp));
-	if (strlen(tmp) < 4)
-		strcat(tmp, " ");
-
-	tailsprintf(buf, siz, "%3dMHz %2d%% %s", (int)clock, fan, tmp);
+	tailsprintf(buf, siz, "%3dMHz %3d%% %.1fC", (int)clock, fan, cvtKlnToC(temp));
 }
 
 static struct api_data *klondike_api_stats(struct cgpu_info *klncgpu)