33#define SCREEN_W UI_PANEL_W
37#define SCREEN_H UI_BODY_H
52#define LV_FONT_LABEL (&gfx_font_10x20)
53#define LV_FONT_BODY UI_FONT_BODY
54#define LV_FONT_FINE UI_FONT_FINE
61#define LV_R (SCREEN_W - UI_MARGIN)
62#define LV_W (LV_R - LV_L)
76#define FOOT_Y (SCREEN_H - UI_ALERT_H - 4 - FOOT_H)
93#define BR_PG_H UI_TAP_MIN
98#define BR_TABS gfx_rect_make(LV_L + 3, BR_PG_Y + 4, \
99 3 * BR_TAB_W + 2 * 4, BR_TAB_H)
101#define BR_HEAD_TY (BR_PG_Y + (BR_PG_H - 20) / 2)
102#define BR_PREV gfx_rect_make(LV_R - 2 * BR_PG_W - 8, BR_PG_Y, BR_PG_W, \
105#define BR_NEXT gfx_rect_make(LV_R - BR_PG_W, BR_PG_Y, BR_PG_W, BR_PG_H)
106#define BR_HEAD_END (LV_R - 2 * BR_PG_W - 8 - 8)
107#define BR_HEAD_FAR LV_R
120#define BR_LIST gfx_rect_make(LV_L, BR_LIST_Y, LV_W, \
121 FOOT_Y - FOOT_GAP - BR_LIST_Y)
136#define BR_BAR gfx_rect_make(LV_R - 8 - BR_BAR_W, BR_LIST_Y + 30, \
137 BR_BAR_W, BR_ROWS * BR_ROW_H - 4)
138#define BR_ROW_X (LV_L + 8)
139#define BR_ROW_W (LV_R - 8 - BR_BAR_W - 8 - BR_ROW_X)
151#define BR_SIZE_IN (BR_ROW_W - 16 - BR_SIZE_W)
152#define BR_DATE_IN (BR_SIZE_IN - 16 - BR_DATE_W)
160#define BR_RESCAN gfx_rect_make(LV_L, FOOT_Y, BR_PG_W, FOOT_H)
161#define BR_SMALL_W 100
163#define BR_WIFI gfx_rect_make(LV_L + BR_PG_W + 8, FOOT_Y, BR_SMALL_W, FOOT_H)
165#define BR_FILES gfx_rect_make(LV_L + BR_PG_W + 8 + BR_SMALL_W + 8, FOOT_Y, \
168#define BR_OPEN gfx_rect_make(LV_R - BR_PG_W, FOOT_Y, BR_PG_W, FOOT_H)
169#define BR_DELETE gfx_rect_make(LV_R - 2 * BR_PG_W - 8, FOOT_Y, BR_PG_W, \
176#define BR_MSG_X (LV_L + BR_PG_W + 8 + 2 * (BR_SMALL_W + 8) + 8)
181#define BR_EMPTY gfx_rect_make(104, 150, 816, 160)
195#define TX_ROW_X (BR_ROW_X + 8)
197#define TX_BACK gfx_rect_make(LV_L, FOOT_Y, 140, FOOT_H)
204#define DQ_BOX gfx_rect_make(162, 100, 700, 280)
205#define DQ_CANCEL gfx_rect_make(186, 304, 300, 56)
206#define DQ_DELETE gfx_rect_make(538, 304, 300, 56)
220#define IM_LEFT gfx_rect_make(LV_L, IM_TOP, 400, FOOT_Y - FOOT_GAP - IM_TOP)
222#define IM_RIGHT gfx_rect_make(LV_L + 408, IM_TOP, LV_W - 408, \
223 FOOT_Y - FOOT_GAP - IM_TOP)
228#define IM_BTN_Y FOOT_Y
229#define IM_BTN_H FOOT_H
230#define IM_BTN_W ((LV_W - 3 * 8) / 4)
232#define IM_BTN(i) gfx_rect_make(LV_L + (i) * (IM_BTN_W + 8), IM_BTN_Y, \
236#define IM_FAIL gfx_rect_make(44, 150, 936, 160)
255#define PV_TOP (CHIP_Y + CHIP_H + 8)
256#define PV_PANEL_H (FOOT_Y - FOOT_GAP - 16 - 4 - PV_TOP)
258#define PV_PANEL gfx_rect_make(LV_L, PV_TOP, LV_W, PV_PANEL_H)
259#define PV_X (LV_L + 8)
260#define PV_Y (PV_TOP + 8)
261#define PV_W (LV_W - 16)
262#define PV_H (PV_PANEL_H - 16)
267#define PV_POS_Y (PV_Y + PV_H + 2)
274#define PV_PAN_SLOP 10
281#define PV_BACK gfx_rect_make(LV_L, FOOT_Y, 140, FOOT_H)
282#define PV_PREV gfx_rect_make(LV_L + 148, FOOT_Y, 96, FOOT_H)
283#define PV_NEXT gfx_rect_make(LV_L + 252, FOOT_Y, 96, FOOT_H)
284#define PV_LINE_X (LV_L + 364)
287#define PV_NONE gfx_rect_make(104, 150, 816, 120)
290 "the footer ends 4px above the alert band");
291_Static_assert(
FOOT_H >=
UI_TAP_MIN,
"the footer's buttons are a finger tall");
295 "the file list's rows fit its panel");
297 "PREV and NEXT end 8px above the list");
299 "the tabs end before the header's text");
301 "the header's text ends at PREV");
303 "a footer message's 28 cells stand between FILES and DELETE");
305 "WI-FI and FILES hold DATEIEN's 7 cells of 10 x 20");
307 "a row's size box holds LOG_DIR's 10 cells");
308_Static_assert(
BR_DATE_W >= 16 * 10,
"a row's date box holds 16 cells");
310 "a row's name ends 16px before its date");
312 "a name of LOG_VIEWER_NAME_CELLS fits its array");
314 "the scroll bar's thumb is 32px or more on a full page");
316 "the text's rows fit beside the scroll bar");
318 "a text row fits the browse row's box");
320 "the column list's rows fit its panel");
322 "the position bar is inside the plot's panel");
324 "the four chips stand in the screen's width");
327typedef enum { VIEW_BROWSE = 0, VIEW_IMPORT, VIEW_PLOT, VIEW_TEXT }
view_t;
331#define LV_MSG_MAX 160
377 char name[LOG_VIEWER_NAME_MAX];
562void lv_bar_thumb_of(
int total,
int visible,
int scroll,
int *y,
int *h);
What the panel's SD (Secure Digital) card slot holds, as the last mount found it: no card,...
card_state_t
Mount state of the SD card.
Definition card_state.h:17
#define SCREEN_H
The body's height, 540px: the router owns the band and hands this screen the body.
Definition files_int.h:36
#define FOOT_Y
Definition files_int.h:118
#define FOOT_H
The footer, body y 440 to 492, ending 4px above the router's alert band (y 496), in LOGS' order: RESC...
Definition files_int.h:117
#define FOOT_GAP
Definition files_int.h:121
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
log_err_t
Result of a CSV import step.
Definition log_csv.h:171
#define LOG_MAX_SERIES
Most series the build materialises.
Definition log_csv.h:42
log_conv_t
Decimal convention of a file.
Definition log_numbers.h:48
A text file as LOGS shows it: read whole, broken into rows.
void lv_render(gfx_canvas_t *c, int buffer_index)
Draws the view on screen into frame buffer buffer_index.
Definition log_viewer_draw.c:785
void lv_event(const touch_event_t *e)
Takes a touch event for the view on screen.
Definition log_viewer_events.c:804
int lv_bar_scroll_at(int top)
The browse list's scroll for a thumb at top (lv_bar_scroll_of()).
Definition log_viewer_screen.c:493
float lv_hi[LOG_MAX_SERIES]
Per series, the highest value in the window.
Definition log_viewer_screen.c:64
#define PV_TOP
Definition log_viewer_int.h:255
bool lv_can_prev(void)
Returns whether a page precedes this one.
Definition log_viewer_screen.c:395
#define BR_ROW_W
Definition log_viewer_int.h:139
void lv_point(log_viewer_tab_t tab)
Points the I/O at the folder of tab, for the call that follows.
Definition log_viewer_screen.c:191
void lv_close_text(void)
Leave the TEXT view for the list and free the report's text.
Definition log_viewer_screen.c:503
#define TX_ROW_H
The TEXT view: a report's rows in the browse list's panel, TX_ROW_H px apart under its 30px heading,...
Definition log_viewer_int.h:192
#define BR_PG_Y
The header row, body y 4 to 52: ROOT / USER / BENCH, the folder and the card's name,...
Definition log_viewer_int.h:92
#define LV_R
Definition log_viewer_int.h:61
#define PV_PANEL_H
Definition log_viewer_int.h:256
#define IM_TOP
The import: the file's name over two panels, DETECTED 400px wide and the column list 600px,...
Definition log_viewer_int.h:218
#define BR_NAME_IN
Definition log_viewer_int.h:150
void lv_open_selected(void)
Opens the selected row: a CSV file to the import view, a report to the TEXT view; a folder or an over...
Definition log_viewer_load.c:419
void lv_read_page(log_page_dir_t dir, const char *key)
Read the page dir and key name, and select its newest run.
Definition log_viewer_screen.c:296
#define BR_ROWS
Definition log_viewer_int.h:123
#define CHIP_X
Definition log_viewer_int.h:252
void lv_say(ui_text_id_t id, const char *name)
The footer message says id, a refusal or a failure.
Definition log_viewer_load.c:52
#define BR_DATE_IN
Definition log_viewer_int.h:152
void lv_quiet(void)
The footer message says nothing.
Definition log_viewer_load.c:72
#define TX_ROWS
Definition log_viewer_int.h:193
#define BR_LIST_Y
The file list under the header row, BR_ROWS rows at a pitch of BR_ROW_H under its 30px heading.
Definition log_viewer_int.h:118
int lv_bar_scroll_of(int total, int visible, int top)
The scroll that puts a thumb's top on BR_BAR nearest top.
Definition log_viewer_screen.c:467
gfx_color_t lv_band[PV_W *PV_BAND]
One band of PV_BAND rows of the plot, drawn at a time.
Definition log_viewer_screen.c:62
#define TX_COLS
Definition log_viewer_int.h:194
void lv_rescan(void)
Reads the page on screen again: the first page from the top, any other from its first entry; another ...
Definition log_viewer_screen.c:379
const char * lv_message(char *buf, size_t n)
The footer message in the language showing.
Definition log_viewer_load.c:78
view_t
The view on screen.
Definition log_viewer_int.h:327
void lv_say_err(log_err_t err)
The footer message says the reader's verdict err, a failure.
Definition log_viewer_load.c:63
#define CHIP_W
Definition log_viewer_int.h:253
#define BR_PG_H
Definition log_viewer_int.h:93
const char * lv_volume_now(void)
Returns the card's name as the I/O reports it now.
Definition log_viewer_screen.c:199
lv_msg_kind_t
What the footer message holds.
Definition log_viewer_int.h:334
@ LV_MSG_TEXT
Definition log_viewer_int.h:336
@ LV_MSG_ERR
Definition log_viewer_int.h:337
@ LV_MSG_NONE
Definition log_viewer_int.h:335
void lv_bar_thumb(int *y, int *h)
The browse list's thumb (lv_bar_thumb_of()).
Definition log_viewer_screen.c:462
#define BR_HEAD_X
Definition log_viewer_int.h:100
const log_viewer_tab_t lv_tab_at[LOG_TAB_COUNT]
Folder tab shown for each tab index.
Definition log_viewer_screen.c:511
const char * lv_delim_text(char delimiter)
Returns a delimiter's name in the language showing.
Definition log_viewer_load.c:111
const char * lv_page_edge(int sign)
Returns the entry on the page that log_name_rank() puts first or last: the edges PREV,...
Definition log_viewer_screen.c:221
#define PV_W
Definition log_viewer_int.h:261
#define IM_ROWS
Definition log_viewer_int.h:225
#define IM_ROW_H
Definition log_viewer_int.h:224
#define PV_POS_Y
The bar under the plot that shows where a zoomed view sits.
Definition log_viewer_int.h:267
#define MAX_FBS
Frame buffers the router renders into.
Definition log_viewer_int.h:39
void lv_run_analysis(void)
Analyses the open file with the chosen delimiter and number convention, keeping the picked columns by...
Definition log_viewer_load.c:132
#define BR_TAB_W
Definition log_viewer_int.h:95
void lv_drop_data(void)
Frees the plot's samples and clears the cursor.
Definition log_viewer_screen.c:418
#define BR_DATE_W
Definition log_viewer_int.h:149
int lv_text_total(void)
Rows the TEXT view scrolls through: the text's, and the line that says it was cut.
Definition log_viewer_screen.c:498
float lv_lo[LOG_MAX_SERIES]
Per series, the lowest value in the window.
Definition log_viewer_screen.c:63
unsigned lv_mounts_now(void)
Returns the I/O's mount number now.
Definition log_viewer_screen.c:206
bool lv_can_next(void)
Returns whether a page follows this one.
Definition log_viewer_screen.c:400
bool lv_paged(void)
Returns whether the card holds more than the page shows, either side of it.
Definition log_viewer_screen.c:389
void lv_bar_thumb_of(int total, int visible, int scroll, int *y, int *h)
The thumb of a scroll bar on BR_BAR: the whole track while every row shows.
Definition log_viewer_screen.c:439
bool lv_can_delete(void)
Returns whether DELETE is offered: the I/O can delete and a file is selected.
Definition log_viewer_screen.c:433
void lv_compute_spans(void)
Reduces the window's samples to a minimum and maximum row per pixel column and series,...
Definition log_viewer_load.c:215
#define BR_MSG_X
A message's left edge in the footer: two lines of 28 cells of the 12 x 24 face from FILES to DELETE,...
Definition log_viewer_int.h:176
#define PV_POS_H
Definition log_viewer_int.h:268
#define CHIP_GAP
Definition log_viewer_int.h:254
#define BR_ROW_H
Definition log_viewer_int.h:122
#define BR_HEAD_END
Definition log_viewer_int.h:106
#define BR_SMALL_W
Definition log_viewer_int.h:161
#define LV_L
The screen's columns: UI_MARGIN (8px) in from either edge, LV_W (1008px) between.
Definition log_viewer_int.h:60
#define BR_SIZE_W
A row's three columns of the 10 x 20 face, as offsets from the row's left: the name from 16px,...
Definition log_viewer_int.h:148
#define PV_BAND
Definition log_viewer_int.h:263
lv_state_t lv_s
The viewer's state, in log_viewer_screen.c.
Definition log_viewer_screen.c:56
#define BR_PG_W
Definition log_viewer_int.h:94
const ui_color_id_t lv_series_color[LOG_MAX_SERIES]
Colour id of each plot series.
Definition log_viewer_screen.c:51
int16_t lv_span[LOG_MAX_SERIES][PV_W][2]
Per series and pixel column, the plot's minimum and maximum row, filled by lv_compute_spans().
Definition log_viewer_screen.c:61
void lv_load_data(void)
Loads the picked columns of the open file into the plot's samples.
Definition log_viewer_load.c:346
Log viewer: browse the card, review the import, plot the file.
log_viewer_tab_t
Definition log_viewer_screen.h:115
#define LOG_VIEWER_NAME_CELLS
The cells a row's name takes: a longer name, of up to LOG_VIEWER_NAME_MAX - 1 (63) bytes,...
Definition log_viewer_screen.h:72
log_page_dir_t
Definition log_viewer_screen.h:104
Result of the analysis of a whole file.
Definition log_csv.h:209
Materialised data of the selected columns.
Definition log_csv.h:315
One file's text and its rows. The fields are log_text.c's.
Definition log_text.h:51
Definition log_viewer_screen.h:59
Definition log_viewer_screen.h:137
The log viewer's state: the browse list and its page of the card, the footer message,...
Definition log_viewer_int.h:345
bool bar_drag
Definition log_viewer_int.h:374
char doomed[LOG_VIEWER_NAME_MAX]
Name of the file DELETE asked about; "" while no question is open.
Definition log_viewer_int.h:395
int text_scroll
Definition log_viewer_int.h:416
int pan_win0
Definition log_viewer_int.h:445
log_conv_t conv
Definition log_viewer_int.h:406
int sel
Definition log_viewer_int.h:364
int bar_grab
Definition log_viewer_int.h:375
unsigned written_seen
Definition log_viewer_int.h:356
bool pressing
Definition log_viewer_int.h:449
unsigned open_mounts
Definition log_viewer_int.h:370
int first
Definition log_viewer_int.h:361
ui_tabs_t tabs
Definition log_viewer_int.h:351
int16_t pinch_x[2]
Definition log_viewer_int.h:432
ui_text_id_t msg_id
Definition log_viewer_int.h:381
float pinch_n0
Definition log_viewer_int.h:435
uint8_t q_id
Definition log_viewer_int.h:401
int press_y0
Definition log_viewer_int.h:451
log_err_t msg_err
Definition log_viewer_int.h:382
uint8_t pinch_id[2]
Definition log_viewer_int.h:431
bool dragged
Definition log_viewer_int.h:453
log_viewer_io_t io
Definition log_viewer_int.h:347
unsigned mounts
Definition log_viewer_int.h:369
log_viewer_tab_t tab
Definition log_viewer_int.h:350
lv_msg_kind_t msg_kind
Definition log_viewer_int.h:380
int press_row
Definition log_viewer_int.h:450
int press_scroll0
Definition log_viewer_int.h:452
int press_btn
Definition log_viewer_int.h:454
int n_picked
Definition log_viewer_int.h:408
card_state_t card
Definition log_viewer_int.h:363
log_data_t data
Definition log_viewer_int.h:411
char msg_name[LOG_VIEWER_NAME_MAX]
Definition log_viewer_int.h:383
int listed
Definition log_viewer_int.h:362
int delim_index
Definition log_viewer_int.h:405
bool have_data
Definition log_viewer_int.h:412
int col_scroll
Definition log_viewer_int.h:409
int16_t tap_y0
Definition log_viewer_int.h:465
char volume[LOG_VIEWER_NAME_MAX]
Definition log_viewer_int.h:368
log_viewer_tab_t open_tab
Definition log_viewer_int.h:354
int16_t tap_x0
Definition log_viewer_int.h:464
int n_card
Definition log_viewer_int.h:360
bool panning
Definition log_viewer_int.h:443
log_text_t text
Definition log_viewer_int.h:415
uint64_t doomed_size
Definition log_viewer_int.h:396
int win0
Definition log_viewer_int.h:422
bool pinch
Definition log_viewer_int.h:430
int16_t press_x
Definition log_viewer_int.h:456
float pinch_s0
Definition log_viewer_int.h:434
bool valid[MAX_FBS]
Definition log_viewer_int.h:467
int picked[LOG_MAX_SERIES]
Definition log_viewer_int.h:407
view_t view
Definition log_viewer_int.h:346
float pinch_d0
Definition log_viewer_int.h:433
bool tap_moved
Definition log_viewer_int.h:462
log_viewer_file_t files[LOG_VIEWER_MAX_FILES]
Definition log_viewer_int.h:358
log_analysis_t an
Definition log_viewer_int.h:403
char name[LOG_VIEWER_NAME_MAX]
Definition log_viewer_int.h:377
bool tap_have
Definition log_viewer_int.h:461
uint8_t tap_id
Definition log_viewer_int.h:463
bool message_ok
Whether the message reports a result rather than a failure.
Definition log_viewer_int.h:385
uint8_t press_id
Definition log_viewer_int.h:455
int win_n
Definition log_viewer_int.h:423
int cursor
Definition log_viewer_int.h:413
int n_files
Definition log_viewer_int.h:359
int scroll
Definition log_viewer_int.h:365
int16_t pan_x0
Definition log_viewer_int.h:444
bool q_down
Whether the contact that counts is down on the question.
Definition log_viewer_int.h:400
bool have_analysis
Definition log_viewer_int.h:404
int pan_cursor0
Definition log_viewer_int.h:446
A DOWN, MOVE or UP of one contact.
Definition touch_types.h:69
A row of tabs: their labels, where they are, which is selected and the press under way.
Definition ui_tabs.h:27
Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker....
#define UI_TAP_MIN
The smallest touch target for a control, in pixels: 48px, 7.2mm.
Definition ui_layout.h:71
#define UI_ALERT_H
The alert band the router draws across the bottom of the panel while an alert shows.
Definition ui_layout.h:43
The pane selector: one bench, several views of it.
The interface's words, one table per language.
ui_text_id_t
The screens' strings, TX_<ID> for each UI_TEXT() of ui_text.def.
Definition ui_text.h:43
The visual language of the bench, resolved at runtime.