Browse Source

Code cleanup after last two commits.

Display reject percentage in a fixed-width field.
nfactor-troky
Noel Maersk 11 years ago
parent
commit
b4e36e69e8
  1. 12
      cgminer.c

12
cgminer.c

@ -2053,9 +2053,10 @@ static int dev_width;
static void curses_print_devstatus(struct cgpu_info *cgpu, int count) static void curses_print_devstatus(struct cgpu_info *cgpu, int count)
{ {
static int dawidth = 1, drwidth = 1, hwwidth = 1, wuwidth = 1; static int drwidth = 5, hwwidth = 1, wuwidth = 1;
char logline[256]; char logline[256];
char displayed_hashes[16], displayed_rolling[16]; char displayed_hashes[16], displayed_rolling[16];
float reject_pct = 0.0;
uint64_t dh64, dr64; uint64_t dh64, dr64;
struct timeval now; struct timeval now;
double dev_runtime, wu; double dev_runtime, wu;
@ -2104,15 +2105,12 @@ static void curses_print_devstatus(struct cgpu_info *cgpu, int count)
else else
cg_wprintw(statuswin, "%6s", displayed_rolling); cg_wprintw(statuswin, "%6s", displayed_rolling);
adj_fwidth(cgpu->diff_accepted, &dawidth);
adj_fwidth(cgpu->diff_rejected, &drwidth);
adj_width(cgpu->hw_errors, &hwwidth);
adj_width(wu, &wuwidth);
float reject_pct = 0.0;
if ((cgpu->diff_accepted + cgpu->diff_rejected) > 0) if ((cgpu->diff_accepted + cgpu->diff_rejected) > 0)
reject_pct = (cgpu->diff_rejected / (cgpu->diff_accepted + cgpu->diff_rejected)) * 100; reject_pct = (cgpu->diff_rejected / (cgpu->diff_accepted + cgpu->diff_rejected)) * 100;
adj_width(cgpu->hw_errors, &hwwidth);
adj_width(wu, &wuwidth);
cg_wprintw(statuswin, "/%6sh/s | R:%*.1f%% HW:%*d WU:%*.1f/m", cg_wprintw(statuswin, "/%6sh/s | R:%*.1f%% HW:%*d WU:%*.1f/m",
displayed_hashes, displayed_hashes,
drwidth, reject_pct, drwidth, reject_pct,

Loading…
Cancel
Save