Date:2013-01-31 06:57:27 (11 years 1 month ago)
Author:Werner Almesberger
Commit:159a128d2894792efa08f706c1e24173a283c6b8
Message:ubb-la.c/gui.c: show units in light blue to better separate them from numbers

Files: ubb-la/gui.c (3 diffs)

Change Details

ubb-la/gui.c
3333#define YRES 240 /* canvas height */
3434
3535#define TEXT_RGBA 0xffffffff /* general text */
36#define UNIT_RGBA 0xb0e0ffff /* units */
3637#define MAP_BUF_RGBA 0x808080ff /* buffer in the map */
3738#define MAP_VIEW_RGBA 0xffffffff /* current view in the map */
3839#define LEVEL_RGBA 0xffff00ff /* constant level or single change */
...... 
336337        pfx = "n";
337338    }
338339    if (v >= 10)
339        textf(x, y, TEXT_RGBA, "%3d%s%s", (int) (v+0.5), pfx, unit);
340        textf(x, y, TEXT_RGBA, "%3d", (int) (v+0.5));
340341    else
341        textf(x, y, TEXT_RGBA, "%3.1f%s%s", v, pfx, unit);
342        textf(x, y, TEXT_RGBA, "%3.1f", v);
343    textf(x+3*8, y, UNIT_RGBA, "%s%s", pfx, unit);
342344}
343345
344346
...... 
349351    si_text(FREQ_X, FREQ_Y, freq, "Sa/s");
350352    si_text(INTERVAL_X, INTERVAL_Y, 1/freq, "s/Sa");
351353    div = (DIV_X >> MAX_ZOOM) << (MAX_ZOOM-zoom);
352    textf(DIV_SAMP_X, DIV_SAMP_Y, TEXT_RGBA, "%4dSa/div", div);
354    textf(DIV_SAMP_X, DIV_SAMP_Y, TEXT_RGBA, "%4d", div);
355    textf(DIV_SAMP_X+4*8, DIV_SAMP_Y, UNIT_RGBA, "Sa/div", div);
353356    si_text(DIV_INT_X, DIV_INT_Y, div/freq, "s/div");
354357}
355358

Archive Download the corresponding diff file

Branches:
master



interactive