46#define SP_FONT (&gfx_font_10x20)
48#define SP_FONT_CRUMB (&gfx_font_12x24)
49#define SP_CRUMB_CELL 12
50#define SP_FONT_HEAD (&gfx_font_20x36)
51#define SP_FONT_NUM (&gfx_font_num_32x44)
66#define SP_FOOT (H - UI_ALERT_H - 4)
67#define CRUMB_Y (PROG_FULL_Y + 2)
68#define CRUMB_H UI_TAP_MIN
70#define BTN_H UI_BTN_H_TALL
72#define BTN_Y (SP_FOOT - BTN_H)
74#define CARD_Y (CRUMB_Y + CRUMB_H + 6)
75#define CARD_B (BTN_Y - 8)
90#define ROW_Y0 (CARD_Y + 8)
91#define ROW_H UI_TAP_MIN
94#define ROW_X (PAD + 8)
95#define ROW_TY ((ROW_H - 20) / 2)
96#define NAME_X (PAD + 46)
97#define STEP_W UI_TAP_MIN
98#define STEP_UP_X (PAD + PARM_W - 8 - STEP_W)
99#define STEP_DN_X (STEP_UP_X - 8 - STEP_W)
101#define CTRL_X (STEP_DN_X - 8 - CTRL_W)
102#define SIDE_X (PAD + PARM_W + 8)
103#define SIDE_W (W - PAD - SIDE_X)
104#define SIDE_IN (SIDE_X + 12)
105#define SIDE_CELLS ((SIDE_W - 24) / SP_CELL)
106#define PAGE_Y (CARD_Y + 8)
108#define HAND_Y (PAGE_Y + UI_TAP_MIN + 8)
109#define SIDE_B (CARD_B - 6)
118#define RUN_Y (DEV_Y + DEV_H + 4)
120#define HELP_Y (BTN_Y - 4 - 20 - HELP_P)
121#define RUN_H (HELP_Y - 6 - RUN_Y)
122#define RUN_L0 (RUN_Y + 84)
130#define SP_PANEL_Y PROG_FULL_Y
131#define SP_PANEL_H (H - PAD - SP_PANEL_Y)
132#define SP_PBTN_H UI_TAP_MIN
134#define SP_PBTN_Y (BTN_Y - 4 - SP_PBTN_H)
137 "ROWS_MAX rows fit the parameter card");
139 "a run's lines fit its card");
143 "the foot row ends 4px above the alert band");
153#define DRAWER __attribute__((noinline))
157typedef enum { STAGE_CLOSED = 0, STAGE_LIST, STAGE_PAGE } prog_stage_t;
182#define SP_SHARED static __attribute__((unused))
183enum { PASS_PRESS = 0, PASS_TAP };
219SP_SHARED
bool hit(
gfx_rect_t r,
int px,
int py)
221 if (!gfx_rect_contains(r, px, py)) {
224 if (pg.pass == PASS_TAP) {
241 ui_button_font(c, pg.back, TR(LOG_BACK), ui_theme_color(UI_C_PANEL_HI),
258 text,
SP_FONT, ink, 1, GFX_ALIGN_RIGHT);
268SP_SHARED
void sp_cut(
char *buf,
size_t n,
int max_chars)
287SP_SHARED
void sp_copy(
char *dst,
size_t n,
const char *src)
290 while (src != NULL && i + 1u < n && src[i] !=
'\0') {
300SP_SHARED
size_t sp_line_len(
const char *at,
int cells)
302 cells = (cells > 0) ? cells : 1;
308 while (cut > 0u && at[cut] !=
' ') {
311 return (cut > 0u) ? cut : len;
322SP_SHARED
int sp_wrap(
gfx_canvas_t *c,
int x,
int y,
int pitch,
323 const char *text,
int cells,
int max_lines,
327 const char *at = (text != NULL) ? text :
"";
331 while (*at !=
'\0' && lines < max_lines) {
334 if (lines == max_lines) {
337 sp_copy(buf,
sizeof(buf), at);
338 sp_cut(buf,
sizeof(buf), cells);
343 const size_t rest = strlen(at);
344 size_t len = sp_line_len(at, cells);
345 len = (len < rest) ? len : rest;
346 const size_t n = (len <
sizeof(buf)) ? len : sizeof(buf) - 1u;
363static inline int sp_wrap_lines(
const char *text,
int cells,
int max_lines)
366 const char *at = (text != NULL) ? text :
"";
370 while (*at !=
'\0' && lines < max_lines) {
371 at += sp_line_len(at, cells);
393 const int cells = (right - x) /
SP_CELL;
394 const int y = (sp_wrap_lines(text, cells, 2) > 1) ?
BTN_Y + 6
396 (void)sp_wrap(c, x, y,
LINE_P, text, cells, 2, ink);
#define ROW_Y0
Definition analyser_screen.c:116
#define ROW_H
Definition analyser_screen.c:117
void esc_stick_panel_render(gfx_canvas_t *c)
Draws the page set by the stage: the manual steps, the prompt, the warning, the list or the profile's...
Definition esc_stick_draw.c:800
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
void gfx_text_in(gfx_canvas_t *c, gfx_rect_t box, const char *s, const gfx_font_t *font, gfx_color_t fg, int scale, gfx_align_t align)
Definition gfx_text.c:316
size_t gfx_text_prefix(const char *s, int cells)
Definition gfx_text.c:77
int gfx_text_cells(const char *s)
Definition gfx_text.c:65
int gfx_text(gfx_canvas_t *c, int x, int y, const char *s, const gfx_font_t *font, gfx_color_t fg, int scale)
Definition gfx_text.c:286
The registry of programmers and runs: one static table that the PROGRAM (and later TEST) lists of a w...
Definition esc_stick_int.h:190
A DOWN, MOVE or UP of one contact.
Definition touch_types.h:69
Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker....
SP_SHARED void widget_enum(gfx_canvas_t *c, int y, const char *text, gfx_color_t ink)
A row's value, right-aligned in the value column.
Definition esc_stick_int.h:254
#define SP_CELL
Definition esc_stick_int.h:47
uint32_t esc_stick_panel_showing(uint32_t h)
The panel's part of what decides which control lies under a point: the level, the pages' scrolls,...
Definition esc_stick_touch.c:220
void esc_stick_panel_open(void)
The session opens on the makers, from the top, the search as typed; TIMING and its keypad closed.
Definition esc_stick_panel.c:119
#define ROWS_MAX
Definition esc_stick_int.h:93
#define RUN_Y
Definition esc_stick_int.h:118
#define CTRL_W
Definition esc_stick_int.h:100
#define HELP_P
Definition esc_stick_int.h:119
SP_SHARED void draw_crumb(gfx_canvas_t *c, const char *trail)
The crumb row: BACK, and trail in SP_FONT_CRUMB beside it.
Definition esc_stick_int.h:239
void esc_stick_panel_reset(void)
The page set's init: the panel's state cleared and its controls laid out, TIMING's keypad closed.
Definition esc_stick_panel.c:77
#define CRUMB_Y
Definition esc_stick_int.h:67
#define CTRL_X
Definition esc_stick_int.h:101
void esc_stick_panel_enter(void)
The host's entry.
Definition esc_stick_panel.c:110
void esc_stick_panel_leave(void)
The host is left: a run ends, the warning, the search's keyboard and TIMING's keypad close,...
Definition esc_stick_panel.c:593
bool esc_stick_panel_down(const touch_event_t *evt)
A DOWN on the session's pages, in the walk of hit(). TIMING's keypad, while open, takes the DOWN and ...
Definition esc_stick_touch.c:336
#define ROW_P
Definition esc_stick_int.h:92
#define RUN_L0
Definition esc_stick_int.h:122
#define HELP_Y
Definition esc_stick_int.h:120
#define SP_FONT
The faces: SP_FONT, the type scale's LABEL face (10 x 20, cells of SP_CELL px), for every label,...
Definition esc_stick_int.h:46
#define ROW_TY
Definition esc_stick_int.h:95
#define BTN_H
Definition esc_stick_int.h:70
#define RUN_LINES
Definition esc_stick_int.h:123
void esc_stick_panel_follow(const touch_event_t *evt)
A MOVE or an UP: the search's keys, TIMING's keypad and the warning's hold follow it.
Definition esc_stick_touch.c:209
void esc_stick_panel_tick(float dt_s)
A frame.
Definition esc_stick_panel.c:510
bool esc_stick_panel_back(void)
The home tag in the session: TIMING's keypad closes as CANCEL does; otherwise what covers the page cl...
Definition esc_stick_touch.c:286
#define CARD_B
Definition esc_stick_int.h:75
#define LINE_P
Definition esc_stick_int.h:52
#define CRUMB_H
Definition esc_stick_int.h:68
bool esc_stick_panel_holds_press(uint8_t id)
Whether contact id holds the warning's hold, a key of the search's keyboard or a key of TIMING's keyp...
Definition esc_stick_touch.c:201
#define BTN_Y
The foot row's top: 4px over the alert band, BTN_H tall.
Definition esc_stick_int.h:72
#define RUN_H
Definition esc_stick_int.h:121
void esc_stick_panel_cancel(void)
Touches were lost: a press that may become a tap ends, a hold ends, a key held on the keyboard or the...
Definition esc_stick_panel.c:662
#define SP_FONT_CRUMB
Definition esc_stick_int.h:48
bool esc_stick_panel_safe_at(int px, int py)
Definition esc_stick_touch.c:321
SP_SHARED void sp_note(gfx_canvas_t *c, int x, int right, const char *text, gfx_color_t ink)
A note at the foot of a page, from x to right, left of the buttons there: on one line level with thei...
Definition esc_stick_int.h:390
The panel's geometry, in one place.
#define UI_BAND_H
The height of the band the router owns across the top, with STOP: 60px, 9.0mm.
Definition ui_layout.h:35
#define UI_ALERT_Y
The alert band's top in panel coordinates: UI_PANEL_H - UI_ALERT_H.
Definition ui_layout.h:47
The interface's words, one table per language.
The visual language of the bench, resolved at runtime.