rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
ui_screen_t Struct Reference

Data Fields

const char * title
void(*) reset (void)
void(*) enter (void)
void(*) leave (void)
void(*) tick (float dt_s)
void(*) event (const touch_event_t *evt)
void(*) cancel (void)
void(*) render (gfx_canvas_t *c, int buffer_index)
bool(*) back (void)
bool(*) hold (ui_screen_id_t to)
bool(*) safe_at (int x, int y)

Field Documentation

◆ back

bool(*) ui_screen_t::back(void)

The home tag was tapped. Return true when the screen went up a level of its own, such as SETUP from a settings list to its tiles, or closed a question or a pop-up that covers it; the router has released every contact the screen owned, as at a change of screen. False, or NULL, leaves the screen for ui_router_parent(). A level is what an in-screen BACK climbs out of, and the home tag climbs one.

◆ cancel

void(*) ui_screen_t::cancel(void)

The touch stream broke: at least one event between the last frame and this one never reached this screen. Drop any gesture in progress.

A screen whose controls all act on a release can leave this NULL – losing an event there costs a highlight. A screen with a gesture that completes on a timer cannot: a press whose release went missing goes on being held, and the timer finishes it with nothing on the glass.

◆ event

void(*) ui_screen_t::event(const touch_event_t *evt)

Coordinates are relative to the screen's own area, not the panel.

◆ hold

bool(*) ui_screen_t::hold(ui_screen_id_t to)

The home tag leaves the screen, for to: back() returned false or is NULL. Return true to hold the navigation; the screen stays on top and later resumes it with ui_router_goto(to) or drops it. False, or NULL, leaves at once. Only the home tag asks: ui_router_goto() never does, so STOP, a safety route and every route the application takes leave at once. SETUP holds it while settings are unsaved.

◆ leave

void(*) ui_screen_t::leave(void)

a bench screen disarms here

◆ reset

void(*) ui_screen_t::reset(void)

Return the screen to its initial state. ui_router_init() calls this on every screen, because selection and scroll position are static state.

◆ safe_at

bool(*) ui_screen_t::safe_at(int x, int y)

Whether a press coming down at (x, y), in the screen's own coordinates, lands on a control that stops what the bench drives and acts on it now: DISARM on an armed bench, a run's ABORT or STOP. The answer follows what the control shows, so ARM on a disarmed bench is none. The router hands such a press to the screen even where the alert band or the band's help bubble covers it, and closes what covered it; every other press there stays the router's. NULL: the screen has no such control.

◆ title

const char* ui_screen_t::title

shown in the band


The documentation for this struct was generated from the following file: