#define TICS_AS_SECS 0
#define TICS_AS_MINS 1
#define TICS_AS_HOUR 2
+#define TICS_AS_DAYS 3
+#define TICS_AS_WEEK 4
/*
* Do some scaling stuff.
days = (nt /= 24); // totat days
week = (nt / 7); // total week
+ if (Rc.tics_scaled > target)
+ target += Rc.tics_scaled - target;
+
switch (target) {
case TICS_AS_SECS:
if (mins < mmLIMIT + 1) {
if (width >= snprintf(buf, sizeof(buf), "%lu,%02lu", hour, mins % 60))
goto end_justifies;
}
- default: // fall through
+ case TICS_AS_DAYS: // fall through
if (days < ddLIMIT + 1) {
if (width >= snprintf(buf, sizeof(buf), DD "+" HH, days, hour % 24))
goto end_justifies;
if (width >= snprintf(buf, sizeof(buf), DD, days))
goto end_justifies;
}
+ case TICS_AS_WEEK: // fall through
if (width >= snprintf(buf, sizeof(buf), WW "+" DD, week, days % 7))
goto end_justifies;
#ifdef SCALE_POSTFX
#endif
if (width >= snprintf(buf, sizeof(buf), WW, week))
goto end_justifies;
+ default: // fall through
break;
}
#undef mmLIMIT
w->rc.double_up = w->rc.combine_cpus = 0;
// fall through
case 'j': // this is release 3.3.17
+ Rc.tics_scaled = 0;
case 'k': // current RCF_VERSION_ID
default:
if (strlen(w->rc.fieldscur) != sizeof(DEF_FIELDS) - 1)
} // end: for (GROUPSMAX)
// any new addition(s) last, for older rcfiles compatibility...
- (void)fscanf(fp, "Fixed_widest=%d, Summ_mscale=%d, Task_mscale=%d, Zero_suppress=%d\n"
- , &Rc.fixed_widest, &Rc.summ_mscale, &Rc.task_mscale, &Rc.zero_suppress);
+ (void)fscanf(fp, "Fixed_widest=%d, Summ_mscale=%d, Task_mscale=%d, Zero_suppress=%d, Tics_scaled=%d\n"
+ , &Rc.fixed_widest, &Rc.summ_mscale, &Rc.task_mscale, &Rc.zero_suppress, &Rc.tics_scaled);
if (Rc.fixed_widest < -1 || Rc.fixed_widest > SCREENMAX)
Rc.fixed_widest = 0;
if (Rc.summ_mscale < 0 || Rc.summ_mscale > SK_Eb)
Rc.task_mscale = 0;
if (Rc.zero_suppress < 0 || Rc.zero_suppress > 1)
Rc.zero_suppress = 0;
+ if (Rc.tics_scaled < 0 || Rc.tics_scaled > TICS_AS_WEEK)
+ Rc.tics_scaled = 0;
// prepare to warn that older top can no longer read rcfile ...
if (Rc.id != RCF_VERSION_ID)
#else
q->rc.maxtasks = q->usrseltyp = q->begpflg = q->begtask = q->begnext = q->focus_pid = 0;
#endif
+ // these next two are global, not really windows based
Monpidsidx = 0;
+ Rc.tics_scaled = 0;
+
osel_clear(q);
q->findstr[0] = '\0';
#ifndef USE_X_COLHDR
}
// any new addition(s) last, for older rcfiles compatibility...
- fprintf(fp, "Fixed_widest=%d, Summ_mscale=%d, Task_mscale=%d, Zero_suppress=%d\n"
- , Rc.fixed_widest, Rc.summ_mscale, Rc.task_mscale, Rc.zero_suppress);
+ fprintf(fp, "Fixed_widest=%d, Summ_mscale=%d, Task_mscale=%d, Zero_suppress=%d, Tics_scaled=%d\n"
+ , Rc.fixed_widest, Rc.summ_mscale, Rc.task_mscale, Rc.zero_suppress, Rc.tics_scaled);
if (Winstk[0].osel_tot + Winstk[1].osel_tot
+ Winstk[2].osel_tot + Winstk[3].osel_tot) {
case '0':
Rc.zero_suppress = !Rc.zero_suppress;
break;
+ case kbd_CtrlE:
+#ifndef SCALE_FORMER
+ Rc.tics_scaled++;
+ if (Rc.tics_scaled > TICS_AS_WEEK)
+ Rc.tics_scaled = 0;
+#endif
+ break;
case kbd_ENTER: // these two have the effect of waking us
case kbd_SPACE: // from 'pselect', refreshing the display
break; // and updating any hot-plugged resources
{ keys_global,
{ '?', 'B', 'd', 'E', 'e', 'f', 'g', 'H', 'h'
, 'I', 'k', 'r', 's', 'X', 'Y', 'Z', '0'
- , kbd_ENTER, kbd_SPACE, '\0' } },
+ , kbd_CtrlE, kbd_ENTER, kbd_SPACE, '\0' } },
{ keys_summary,
{ '!', '1', '2', '3', '4', 'C', 'l', 'm', 't', '\0' } },
{ keys_task,
#define kbd_INS 138
#define kbd_DEL 139
#define kbd_CtrlO '\017'
+#define kbd_CtrlE '\005'
/* Special value in Pseudo_row to force an additional procs refresh
-- used at startup and for task/thread mode transitions */
int summ_mscale; // 'E' - scaling of summary memory values
int task_mscale; // 'e' - scaling of process memory values
int zero_suppress; // '0' - suppress scaled zeros toggle
+ int tics_scaled; // ^E - scale TIME and/or TIME+ columns
} RCF_t;
/* This structure stores configurable information for each window.
{ EU_UEN, ALT_WINFLGS, 0, ALT_GRAPHS2, 0, 0, \
COLOR_YELLOW, COLOR_YELLOW, COLOR_GREEN, COLOR_YELLOW, \
"Usr", USR_FIELDS } \
- }, 0, DEF_SCALES2, 0 }
+ }, 0, DEF_SCALES2, 0, 0 }
/* Summary Lines specially formatted string(s) --
see 'show_special' for syntax details + other cautions. */