Date:2013-02-01 03:24:24 (6 years 4 months ago)
Author:Werner Almesberger
Commit:5b050b4b360f86e72b89b5f4e2ba41850b9e2dcd
Message:ubb-la/gui.c (gui): move position display to show_position; add position in samples

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

Change Details

ubb-la/gui.c
7474
7575#define UNIT_GAP 2 /* space between number and unit */
7676
77#define POS_X 168
77#define POS_T_X 176
78#define POS_SAMP_X 264
7879#define POS_Y (MEAS_DIV_Y-8-3)
7980
8081#define MEAS_DIV_Y (FREQ_Y-3-1)
...... 
339340}
340341
341342
342/* ----- Display the sample frequency -------------------------------------- */
343/* ----- Display various settings ------------------------------------------ */
343344
344345
345346static void si_text(int x, int y, double v, const char *unit, int digits)
...... 
391392}
392393
393394
394/* ----- Show a divisions -------------------------------------------------- */
395static void show_position(double freq, int pos)
396{
397    si_text(POS_T_X, POS_Y, pos/freq, "s", 7);
398    hlineColor(surf, 0, XRES-1, MEAS_DIV_Y, DIV_RGBA);
399    si_text(POS_T_X, POS_Y, pos/freq, "s", 7);
400    hlineColor(surf, 0, XRES-1, MEAS_DIV_Y, DIV_RGBA);
401
402    textf(POS_SAMP_X, POS_Y, TEXT_RGBA, "%4d", pos);
403    textf(POS_SAMP_X+4*8+UNIT_GAP, POS_Y, UNIT_RGBA, "Sa", div);
404}
405
406
407/* ----- Show divisions ---------------------------------------------------- */
395408
396409
397410static void show_divisions(void)
...... 
436449            XCENTER+CENTER_W/2, CENTER_Y0, CENTER_RGBA);
437450        show_buffer(buf, skip, nibbles, CH_XOFF, XRES, zoom, pos);
438451        show_freq(freq, zoom);
439        si_text(POS_X, POS_Y, pos/freq, "s", 7);
440        hlineColor(surf, 0, XRES-1, MEAS_DIV_Y, DIV_RGBA);
452        show_position(freq, pos);
441453        update();
442454
443455        while (1) {

Archive Download the corresponding diff file

Branches:
master



interactive