Browse Source

Rearrange TUI a bit, including menu at the top (+1 log line) and hashrate total closer to device summaries

Luke Dashjr 12 years ago
parent
commit
85b33bd3e9
2 changed files with 34 additions and 27 deletions
  1. 15 15
      README
  2. 19 12
      miner.c

+ 15 - 15
README

@@ -392,17 +392,12 @@ dedicated to this program,
 	https://bitcointalk.org/?topic=78192
 	https://bitcointalk.org/?topic=78192
 	https://bitcointalk.org/?topic=168174
 	https://bitcointalk.org/?topic=168174
 
 
-The output line shows the following:
- 5s:1713.6 avg:1707.8 u:1710.2 Mh/s | A:729 R:8+0(.01%) HW:0/.81%
+The block display shows:
+Block: ...1b89f8d3 #217364  Diff:7.67M (54.93Th/s)  Started: [17:17:22]
 
 
-Each column is as follows:
-5s:  A 5 second exponentially decaying average hash rate
-avg: An all time average hash rate
-u:   An all time average hash rate based on actual accepted shares
-A:   The number of Accepted shares
-R:   The number of Rejected shares, stale shares discarded (never submitted),
-     and the percentage these are of total found.
-HW:  The number of HardWare errors, and percentage invalid of nonces returned
+This shows a short stretch of the current block, the next block's height and
+difficulty (including the network hashrate that difficulty represents), and when
+the search for the new block started.
 
 
 The BFGMiner status line shows:
 The BFGMiner status line shows:
  ST:1  F:0  NB:1  AS:0  BW:[ 75/241 B/s]  E:2.42  U:22.53/m  BS:2.71k
  ST:1  F:0  NB:1  AS:0  BW:[ 75/241 B/s]  E:2.42  U:22.53/m  BS:2.71k
@@ -417,12 +412,17 @@ E  is Efficiency defined as number of shares accepted (multiplied by their
 U  is Utility defined as the number of shares / minute
 U  is Utility defined as the number of shares / minute
 BS is the all time Best Share difficulty you've found
 BS is the all time Best Share difficulty you've found
 
 
-The block display shows:
-Block: ...1b89f8d3 #217364  Diff:7.67M (54.93Th/s)  Started: [17:17:22]
+The output line shows the following:
+ 5s:1713.6 avg:1707.8 u:1710.2 Mh/s | A:729 R:8+0(.01%) HW:0/.81%
 
 
-This shows a short stretch of the current block, the next block's height and
-difficulty (including the network hashrate that difficulty represents), and when
-the search for the new block started.
+Each column is as follows:
+5s:  A 5 second exponentially decaying average hash rate
+avg: An all time average hash rate
+u:   An all time average hash rate based on actual accepted shares
+A:   The number of Accepted shares
+R:   The number of Rejected shares, stale shares discarded (never submitted),
+     and the percentage these are of total found.
+HW:  The number of HardWare errors, and percentage invalid of nonces returned
 
 
 Each device shows:
 Each device shows:
  BFL 2: 74.0C | 51.97/58.90/57.17Gh/s | A:847 R:15+0(.54%) HW:496/.91%
  BFL 2: 74.0C | 51.97/58.90/57.17Gh/s | A:847 R:15+0(.54%) HW:496/.91%

+ 19 - 12
miner.c

@@ -2656,6 +2656,8 @@ static void text_print_status(int thr_id)
 }
 }
 
 
 #ifdef HAVE_CURSES
 #ifdef HAVE_CURSES
+static int menu_attr = A_REVERSE;
+
 /* Must be called with curses mutex lock held and curses_active */
 /* Must be called with curses mutex lock held and curses_active */
 static void curses_print_status(void)
 static void curses_print_status(void)
 {
 {
@@ -2688,14 +2690,13 @@ static void curses_print_status(void)
 		);
 		);
 	}
 	}
 	wattroff(statuswin, A_BOLD);
 	wattroff(statuswin, A_BOLD);
-	mvwhline(statuswin, 1, 0, '-', 80);
-	mvwprintw(statuswin, 2, 0, " %s", statusline);
+	mvwprintw(statuswin, 5, 0, " %s", statusline);
 	wclrtoeol(statuswin);
 	wclrtoeol(statuswin);
 
 
 	utility = total_accepted / total_secs * 60;
 	utility = total_accepted / total_secs * 60;
 
 
 	char bwstr[12];
 	char bwstr[12];
-	mvwprintw(statuswin, 3, 0, " ST:%d  F:%d  NB:%d  AS:%d  BW:[%s]  E:%.2f  U:%.1f/m  BS:%s",
+	mvwprintw(statuswin, 4, 0, " ST:%d  F:%d  NB:%d  AS:%d  BW:[%s]  E:%.2f  U:%.1f/m  BS:%s",
 		__total_staged(),
 		__total_staged(),
 		total_go + total_ro,
 		total_go + total_ro,
 		new_blocks,
 		new_blocks,
@@ -2708,21 +2709,24 @@ static void curses_print_status(void)
 		best_share);
 		best_share);
 	wclrtoeol(statuswin);
 	wclrtoeol(statuswin);
 	if ((pool_strategy == POOL_LOADBALANCE  || pool_strategy == POOL_BALANCE) && total_pools > 1) {
 	if ((pool_strategy == POOL_LOADBALANCE  || pool_strategy == POOL_BALANCE) && total_pools > 1) {
-		mvwprintw(statuswin, 4, 0, " Connected to multiple pools with%s LP",
+		mvwprintw(statuswin, 2, 0, " Connected to multiple pools with%s LP",
 			have_longpoll ? "": "out");
 			have_longpoll ? "": "out");
 	} else if (pool->has_stratum) {
 	} else if (pool->has_stratum) {
-		mvwprintw(statuswin, 4, 0, " Connected to %s diff %s with stratum as user %s",
+		mvwprintw(statuswin, 2, 0, " Connected to %s diff %s with stratum as user %s",
 			pool->sockaddr_url, pool->diff, pool->rpc_user);
 			pool->sockaddr_url, pool->diff, pool->rpc_user);
 	} else {
 	} else {
-		mvwprintw(statuswin, 4, 0, " Connected to %s diff %s with%s LP as user %s",
+		mvwprintw(statuswin, 2, 0, " Connected to %s diff %s with%s LP as user %s",
 			pool->sockaddr_url, pool->diff, have_longpoll ? "": "out", pool->rpc_user);
 			pool->sockaddr_url, pool->diff, have_longpoll ? "": "out", pool->rpc_user);
 	}
 	}
 	wclrtoeol(statuswin);
 	wclrtoeol(statuswin);
-	mvwprintw(statuswin, 5, 0, " Block: %s  Diff:%s (%s)  Started: %s",
+	mvwprintw(statuswin, 3, 0, " Block: %s  Diff:%s (%s)  Started: %s",
 		  current_hash, block_diff, net_hashrate, blocktime);
 		  current_hash, block_diff, net_hashrate, blocktime);
 	mvwhline(statuswin, 6, 0, '-', 80);
 	mvwhline(statuswin, 6, 0, '-', 80);
 	mvwhline(statuswin, statusy - 1, 0, '-', 80);
 	mvwhline(statuswin, statusy - 1, 0, '-', 80);
-	mvwprintw(statuswin, devcursor - 1, 1, "[M]anage devices [P]ool management [S]ettings [D]isplay options [Q]uit");
+	
+	wattron(statuswin, menu_attr);
+	mvwprintw(statuswin, 1, 0, " [M]anage devices [P]ool management [S]ettings [D]isplay options [Q]uit         ");
+	wattroff(statuswin, menu_attr);
 }
 }
 
 
 static void adj_width(int var, int *length)
 static void adj_width(int var, int *length)
@@ -2753,7 +2757,7 @@ static void curses_print_devstatus(struct cgpu_info *cgpu)
 	ypos += devsummaryYOffset;
 	ypos += devsummaryYOffset;
 	if (ypos < 0)
 	if (ypos < 0)
 		return;
 		return;
-	ypos += devcursor;
+	ypos += devcursor - 1;
 	if (ypos >= statusy - 1)
 	if (ypos >= statusy - 1)
 		return;
 		return;
 
 
@@ -2845,11 +2849,11 @@ static void switch_logsize(void)
 {
 {
 	if (curses_active_locked()) {
 	if (curses_active_locked()) {
 		if (opt_compact) {
 		if (opt_compact) {
-			logstart = devcursor + 1;
+			logstart = devcursor - 1;
 			logcursor = logstart + 1;
 			logcursor = logstart + 1;
 		} else {
 		} else {
 			total_lines = (opt_show_procs ? total_devices : device_line_id_count);
 			total_lines = (opt_show_procs ? total_devices : device_line_id_count);
-			logstart = devcursor + total_lines + 1;
+			logstart = devcursor + total_lines;
 			logcursor = logstart;
 			logcursor = logstart;
 		}
 		}
 		unlock_curses();
 		unlock_curses();
@@ -8744,6 +8748,9 @@ void enable_curses(void) {
 	}
 	}
 
 
 	mainwin = initscr();
 	mainwin = initscr();
+	start_color();
+	if (has_colors() && ERR != init_pair(1, COLOR_WHITE, COLOR_BLUE))
+		menu_attr = COLOR_PAIR(1);
 	keypad(mainwin, true);
 	keypad(mainwin, true);
 	getmaxyx(mainwin, y, x);
 	getmaxyx(mainwin, y, x);
 	statuswin = newwin(logstart, x, 0, 0);
 	statuswin = newwin(logstart, x, 0, 0);
@@ -9230,7 +9237,7 @@ int main(int argc, char *argv[])
 #endif
 #endif
 
 
 	devcursor = 8;
 	devcursor = 8;
-	logstart = devcursor + 1;
+	logstart = devcursor;
 	logcursor = logstart;
 	logcursor = logstart;
 
 
 	block = calloc(sizeof(struct block), 1);
 	block = calloc(sizeof(struct block), 1);