ubb-la/gui.c |
74 | 74 | |
75 | 75 | #define UNIT_GAP 2 /* space between number and unit */ |
76 | 76 | |
77 | | #define POS_X 168 |
| 77 | #define POS_T_X 176 |
| 78 | #define POS_SAMP_X 264 |
78 | 79 | #define POS_Y (MEAS_DIV_Y-8-3) |
79 | 80 | |
80 | 81 | #define MEAS_DIV_Y (FREQ_Y-3-1) |
... | ... | |
339 | 340 | } |
340 | 341 | |
341 | 342 | |
342 | | /* ----- Display the sample frequency -------------------------------------- */ |
| 343 | /* ----- Display various settings ------------------------------------------ */ |
343 | 344 | |
344 | 345 | |
345 | 346 | static void si_text(int x, int y, double v, const char *unit, int digits) |
... | ... | |
391 | 392 | } |
392 | 393 | |
393 | 394 | |
394 | | /* ----- Show a divisions -------------------------------------------------- */ |
| 395 | static 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 ---------------------------------------------------- */ |
395 | 408 | |
396 | 409 | |
397 | 410 | static void show_divisions(void) |
... | ... | |
436 | 449 | XCENTER+CENTER_W/2, CENTER_Y0, CENTER_RGBA); |
437 | 450 | show_buffer(buf, skip, nibbles, CH_XOFF, XRES, zoom, pos); |
438 | 451 | 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); |
441 | 453 | update(); |
442 | 454 | |
443 | 455 | while (1) { |