|
|
#define | W UI_PANEL_W |
| | The panel's width, UI_PANEL_W px.
|
|
#define | H UI_BODY_H |
| | The body's height under the band, UI_BODY_H px.
|
| #define | SP_FONT (&gfx_font_10x20) |
| | The faces: SP_FONT, the type scale's LABEL face (10 x 20, cells of SP_CELL px), for every label, button, row, value and line; SP_FONT_CRUMB, the BODY face (12 x 24), for the crumb's trail; SP_FONT_HEAD (20 x 36) for a run's phase and a panel's title; SP_FONT_NUM (32 x 44) for the beeps counted. LINE_P is the pitch of the lines a page wraps in SP_FONT.
|
| #define | SP_CELL 10 |
| #define | SP_FONT_CRUMB (&gfx_font_12x24) |
| #define | SP_CRUMB_CELL 12 |
| #define | SP_FONT_HEAD (&gfx_font_20x36) |
| #define | SP_FONT_NUM (&gfx_font_num_32x44) |
| #define | LINE_P 20 |
| #define | PAD UI_MARGIN |
| | A full-width session's layout (prog_registry.h), in body pixels: MOTOR & ESC draws the output strip's line above PROG_FULL_Y and the pages lay out under it.
|
| #define | SP_FOOT (H - UI_ALERT_H - 4) |
| #define | CRUMB_Y (PROG_FULL_Y + 2) |
| #define | CRUMB_H UI_TAP_MIN |
| #define | BACK_W 120 |
| #define | BTN_H UI_BTN_H_TALL |
|
#define | BTN_Y (SP_FOOT - BTN_H) |
| | The foot row's top: 4px over the alert band, BTN_H tall.
|
| #define | FOOT_BTN_W 168 |
| #define | CARD_Y (CRUMB_Y + CRUMB_H + 6) |
| #define | CARD_B (BTN_Y - 8) |
| #define | PARM_W 660 |
| | A profile's page and TIMING: the parameter card on the left, PARM_W wide from CARD_Y to CARD_B, with ROWS_MAX rows of ROW_H at a ROW_P pitch, so 8px lie between the keys of two rows; the side column right of it (SIDE_X, SIDE_W) with the page keys' row at PAGE_Y, MANUAL INTERVENTION REQUIRED at HAND_Y, and the device lines and the help of the row picked under them.
|
| #define | ROW_Y0 (CARD_Y + 8) |
| #define | ROW_H UI_TAP_MIN |
| #define | ROW_P 56 |
| #define | ROWS_MAX 6 |
| #define | ROW_X (PAD + 8) |
| #define | ROW_TY ((ROW_H - 20) / 2) |
| #define | NAME_X (PAD + 46) |
| #define | STEP_W UI_TAP_MIN |
| #define | STEP_UP_X (PAD + PARM_W - 8 - STEP_W) |
| #define | STEP_DN_X (STEP_UP_X - 8 - STEP_W) |
| #define | CTRL_W 250 |
| #define | CTRL_X (STEP_DN_X - 8 - CTRL_W) |
| #define | SIDE_X (PAD + PARM_W + 8) |
| #define | SIDE_W (W - PAD - SIDE_X) |
| #define | SIDE_IN (SIDE_X + 12) |
| #define | SIDE_CELLS ((SIDE_W - 24) / SP_CELL) |
| #define | PAGE_Y (CARD_Y + 8) |
| #define | PAGE_KEY_W 48 |
| #define | HAND_Y (PAGE_Y + UI_TAP_MIN + 8) |
| #define | SIDE_B (CARD_B - 6) |
| #define | DEV_Y CARD_Y |
| | A run and its result: the device card across the body from DEV_Y, DEV_H tall, the run's card under it to HELP_Y - 6, and two help lines across the body from HELP_Y above the foot row.
|
| #define | DEV_H 48 |
| #define | RUN_Y (DEV_Y + DEV_H + 4) |
| #define | HELP_P 22 |
| #define | HELP_Y (BTN_Y - 4 - 20 - HELP_P) |
| #define | RUN_H (HELP_Y - 6 - RUN_Y) |
| #define | RUN_L0 (RUN_Y + 84) |
| #define | RUN_LINES 8 |
| #define | SP_PANEL_Y PROG_FULL_Y |
| #define | SP_PANEL_H (H - PAD - SP_PANEL_Y) |
| #define | SP_PBTN_H UI_TAP_MIN |
|
#define | SP_PBTN_Y (BTN_Y - 4 - SP_PBTN_H) |
| | A panel's buttons' top: they end 4px over the foot row.
|
|
#define | DRAWER __attribute__((noinline)) |
|
#define | TAP_SLOP 8 |
|
#define | SP_SHARED static __attribute__((unused)) |
|
|
SP_SHARED bool | hit (gfx_rect_t r, int px, int py) |
| SP_SHARED void | draw_crumb (gfx_canvas_t *c, const char *trail) |
| | The crumb row: BACK, and trail in SP_FONT_CRUMB beside it.
|
| 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.
|
|
SP_SHARED void | sp_cut (char *buf, size_t n, int max_chars) |
|
SP_SHARED void | sp_copy (char *dst, size_t n, const char *src) |
|
SP_SHARED size_t | sp_line_len (const char *at, int cells) |
|
SP_SHARED int | sp_wrap (gfx_canvas_t *c, int x, int y, int pitch, const char *text, int cells, int max_lines, gfx_color_t ink) |
|
static int | sp_wrap_lines (const char *text, int cells, int max_lines) |
| 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 their labels, or where it needs more, on two at LINE_P from 6px under their top.
|
|
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.
|
|
void | esc_stick_panel_enter (void) |
| | The host's entry.
|
|
void | esc_stick_panel_leave (void) |
| | The host is left: a run ends, the warning, the search's keyboard and TIMING's keypad close, and TIMING asks for a save of what it changed.
|
| void | esc_stick_panel_tick (float dt_s) |
| | A frame.
|
|
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 keypad is let go with what was typed kept, and a run whose arm is not yet in force ends.
|
| 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 nothing under it does.
|
| bool | esc_stick_panel_safe_at (int px, int py) |
| bool | esc_stick_panel_back (void) |
| | The home tag in the session: TIMING's keypad closes as CANCEL does; otherwise what covers the page closes, a run ends or the session climbs a level, as BACK does; from the makers it closes the session (STAGE_CLOSED).
|
| 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.
|
| 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 keypad.
|
|
void | esc_stick_panel_open (void) |
| | The session opens on the makers, from the top, the search as typed; TIMING and its keypad closed.
|
| 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, what covers the page, the keyboard and TIMING's keypad.
|
| 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 page.
|
ESC STICK's private seam between esc_stick_pages.c, the page set MOTOR & ESC opens from PROGRAM's list (the session's state, its tap walk and its hooks), and esc_stick_panel.c, the stick programmer's pages: the layout both draw on, the state both read and write, the tap walk, the text helpers both draw with, and the panel's side the page set calls. Nothing outside shared/ui includes this header; the interface is esc_stick_panel.h.
The helpers below are static, and marked unused for esc_stick_pages.c, which draws none of them: esc_stick_panel.c has its own copy, and GCC inlines them or not.
SPDX-License-Identifier: MIT
A profile's page and TIMING: the parameter card on the left, PARM_W wide from CARD_Y to CARD_B, with ROWS_MAX rows of ROW_H at a ROW_P pitch, so 8px lie between the keys of two rows; the side column right of it (SIDE_X, SIDE_W) with the page keys' row at PAGE_Y, MANUAL INTERVENTION REQUIRED at HAND_Y, and the device lines and the help of the row picked under them.
A row from the left: its number, the mark of a change, its name (the row's own tap, up to CTRL_X - 8), the value (CTRL_X, CTRL_W: 25 cells, TIMING's keypad), then "-" and "+" of UI_TAP_MIN, 8px apart. the parameter card