rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
esc_stick_touch.c File Reference

The presses on ESC STICK's pages. More...

#include "esc_stick_panel.h"
#include <stdio.h>
#include <string.h>
#include "esc_profile.h"
#include "settings.h"
#include "ui_keypad.h"
#include "ui_setting_keypad.h"
#include "ui_text.h"
#include "ui_textkey.h"
#include "ui_widgets.h"
#include "esc_stick_panel_int.h"

Macros

#define SP_KP_H   (H - UI_ALERT_H - 4 - SP_PANEL_Y)
 TIMING's keypad: from under the output strip to 4px above the alert band, 1008 x 464px.

Functions

static bool hit_down (gfx_rect_t r, int px, int py)
 Returns whether a press at (px, py) is on rectangle r and nothing has claimed it yet.
static void sp_track (const touch_event_t *evt)
 Follows the warning's hold: the contact leaving the button ends it; a release ends it.
int sp_rows_shown (int total, int scroll)
 The rows a page of ROWS_MAX shows of total from scroll.
static gfx_rect_t sp_dock (void)
 The search's keyboard, docked right of the narrowed rows.
gfx_rect_t sp_row (int i)
 Profile row i, narrowed to the left of the keyboard while it is open.
void sp_find_close (void)
 The keyboard closes; the search stays as typed.
static void sp_find_event (const touch_event_t *evt)
 One event for the search's keyboard. Every key that changes the text filters the list at once; OK keeps the text, CANCEL goes back to the search the keyboard opened on.
static gfx_rect_t sp_value_rect (int i)
 Where TIMING's row i shows its value: the control column, over the row's height. A tap there opens the row's keypad.
static void sp_kp_open (int idx)
 The keypad of TIMING's setting idx, over the session's pages.
void sp_kp_close (void)
 TIMING's keypad closes, with nothing typed taken.
static void sp_kp_event (const touch_event_t *evt)
 One event for TIMING's keypad. OK sets the value through settings_set(), the call a step ends in, and CLOSE asks for the save as it does after a step; a value the steps never reach keeps the keypad open, refused.
const ui_keypad_t * esc_stick_panel_keypad (void)
 TIMING's keypad, which a tap on a row's value opens over the session's pages; for tests and the renderer.
int esc_stick_panel_keypad_setting (void)
 The setting TIMING's open keypad types; for tests.
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_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.
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.
static void sp_list_up (void)
 BACK on the list climbs a level: a maker's models to the makers, with the makers' scroll and the search kept; the makers close the session, back to PROGRAM's list. The keyboard closes, the search as typed.
static void sp_to_list (void)
 BACK on a profile's page: the list it was picked from, its scroll kept.
static void sp_timing_close (void)
 TIMING closes; what it changed is asked to be saved.
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).
bool esc_stick_panel_safe_at (int px, int py)
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.

Detailed Description

The presses on ESC STICK's pages.

The presses on ESC STICK's pages: the search field and its keyboard, the list's rows and pages, a profile's rows, TIMING and its keypad, the warning's hold, a run's ABORT and the manual steps, BACK and the home tag. The state and the seam are esc_stick_panel_int.h.

SPDX-License-Identifier: MIT

Function Documentation

◆ esc_stick_panel_back()

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).

Returns
True: it always acts.

◆ esc_stick_panel_down()

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.

Parameters
evtThe DOWN, or the press a tap replays.
Returns
True: the pages take every DOWN.

◆ esc_stick_panel_follow()

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.

Parameters
evtThe event.

◆ esc_stick_panel_holds_press()

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.

Parameters
idThe contact.
Returns
True when it does.

◆ esc_stick_panel_keypad()

const ui_keypad_t * esc_stick_panel_keypad ( void )

TIMING's keypad, which a tap on a row's value opens over the session's pages; for tests and the renderer.

Returns
The keypad, open or closed.

◆ esc_stick_panel_keypad_setting()

int esc_stick_panel_keypad_setting ( void )

The setting TIMING's open keypad types; for tests.

Returns
Its setting_id_t, or -1 while the keypad is closed.

◆ esc_stick_panel_safe_at()

bool esc_stick_panel_safe_at ( int px,
int py )

A DOWN at (x, y) lands on the ABORT of a run under way, which esc_stick_panel_down() acts on at the press.

◆ esc_stick_panel_showing()

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.

Parameters
hThe hash so far.
Returns
h hashed on with the panel's part.

◆ sp_kp_event()

void sp_kp_event ( const touch_event_t * evt)
static

One event for TIMING's keypad. OK sets the value through settings_set(), the call a step ends in, and CLOSE asks for the save as it does after a step; a value the steps never reach keeps the keypad open, refused.

Parameters
evtThe event.

◆ sp_kp_open()

void sp_kp_open ( int idx)
static

The keypad of TIMING's setting idx, over the session's pages.

Parameters
idxThe setting's place in sp_settings_list.

◆ sp_row()

gfx_rect_t sp_row ( int i)

Profile row i, narrowed to the left of the keyboard while it is open.

Parameters
ithe row on the page
Returns
the row's rectangle

◆ sp_rows_shown()

int sp_rows_shown ( int total,
int scroll )

The rows a page of ROWS_MAX shows of total from scroll.

Parameters
totalthe number of entries
scrollthe first entry shown
Returns
the number of rows shown

◆ sp_value_rect()

gfx_rect_t sp_value_rect ( int i)
static

Where TIMING's row i shows its value: the control column, over the row's height. A tap there opens the row's keypad.

Parameters
iThe row on the page, 0 to ROWS_MAX - 1.
Returns
The value's rectangle.