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

The SERVO screen's private seam between servo_screen*.c, the screen, servo_workbench.c, its task strip, TEST page and TARGET row (servo_workbench_int.h), servo_settings_panel.c, its settings pages and the panels they open, servo_test_panel.c, its automatic test, and servo_limit_panel.c, its limit run: the layout they draw on, the profiles, the pages' rows and presses, the state they read and write, the functions each calls of the others, and the small helpers they inline. Nothing outside shared/ui includes this header; the screen's interface is servo_screen.h. More...

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "gfx.h"
#include "kst_panel.h"
#include "servo_limrun.h"
#include "servo_screen.h"
#include "servo_sweep.h"
#include "settings.h"
#include "supply_screen.h"
#include "touch_types.h"
#include "ui_keypad.h"
#include "ui_plot.h"
#include "ui_slider.h"
#include "ui_tabs.h"
#include "ui_textkey.h"
#include "ui_target_row.h"
#include "ui_value_gate.h"
#include "ui_widgets.h"
#include "ui_workbench.h"
#include "servo_workbench_int.h"

Go to the source code of this file.

Data Structures

struct  servo_type_t
struct  ov_row_t
struct  servo_map_t
struct  sweep_drain_t
struct  start_rec_t
struct  svs_drag_filter_t
 The drag's filtered target (svs_drag_tick()). More...
struct  servo_screen_state_t

Macros

#define W   UI_PANEL_W
#define H   UI_BODY_H
#define PAD   UI_MARGIN
#define LCARD_W   620
 The left card's width, px: the page area under the strip, where the dial, TEST's run cards, SETTINGS' pages and PROGRAM's list are, and the panels and the programmer's sessions over them.
#define RCARD_X   (PAD + LCARD_W + 8)
#define RCARD_W   (W - RCARD_X - PAD)
#define SV_STRIP_X   UI_WB_STRIP_X
 SERVO's task strip at the 1024 x 600 sizes: four tabs of 150 x 40px, 4px apart, from y 8, and the page from y 56.
#define SV_STRIP_Y   (UI_WB_STRIP_Y + 2)
#define SV_STRIP_H   (UI_WB_STRIP_H + 16)
#define SV_TAB_W   (UI_WB_TAB_W + 38)
#define SV_TAB_GAP   UI_WB_TAB_GAP
#define SV_PAGE_Y   (UI_WB_PAGE_Y + 18)
#define CARD_Y   SV_PAGE_Y
 The left card's top: the page area under SERVO's strip.
#define CARD_H   (H - CARD_Y - PAD)
#define RCARD_Y   PAD
 The output card's top: the body's margin. The strip spans the left card only, so the output card, the same on every task, runs from the top margin to the bottom one beside it.
#define RCARD_H   (H - 2 * PAD)
#define STOP_FLOOR   (UI_ALERT_Y - UI_BAND_H - 4)
 The lowest row a control that stops what the bench drives may reach, in the screen's coordinates: 4px above the alert band.
#define SV_FONT_LABEL   (&gfx_font_10x20)
 The faces of the 1024 x 600 type scale this screen draws in.
#define SV_FONT_BODY   UI_FONT_BODY
#define SV_FONT_HEAD   (&gfx_font_20x36)
#define SV_FONT_NUM   (&gfx_font_num_32x44)
#define SV_CELL   10
#define RC_X   (RCARD_X + 12)
#define RC_W   (RCARD_W - 24)
#define TAG_Y   (RCARD_Y + 12)
#define TAG_H   44
#define PWR_TXT_Y   (TAG_Y + TAG_H + 8)
 The line over the plot: the meter's name and three readings.
#define PWR_LAB_W   90
 The meter's name before the readings (k_line_w): 90px for PD MINI, 134px for "INA 0x41 CH2", 12 cells of 10px and a gap.
#define PWR_LAB_W_INA   134
#define PWR_Y   (PWR_TXT_Y + 24)
#define PWR_H   70
#define SUP_Y   (PWR_Y + PWR_H + 8)
 The supply's set points, each a value the keypad opens on, and OUTPUT ON and OFF: the same set points and switch as SUPPLY's, not a copy. SET (SOLL) takes the first 48px, each value 84px, 8px apart, and the switch the rest, 124px: AUSGANG AUS is 11 cells.
#define SUP_H   UI_TAP_MIN
#define SUP_VAL_X   (RC_X + 48)
#define SUP_VAL_W   84
#define SUP_GAP   8
#define SUP_OUT_X   (SUP_VAL_X + 2 * (SUP_VAL_W + SUP_GAP))
 OUTPUT ON and OFF, after the two set points.
#define SPEED_Y   (SUP_Y + SUP_H + 10)
#define SLIDER_Y   (SPEED_Y + 24)
#define SLIDER_H   40
#define TARGET_Y   (SLIDER_Y + SLIDER_H + UI_SLIDER_OVERHANG + 7)
 The TARGET row, what the tester drives and the control that picks it, clear of SPEED's thumb and its shadow, which paint UI_SLIDER_OVERHANG + 2px below the track.
#define TARGET_H   UI_TAP_MIN
#define BTN_Y   (TARGET_Y + TARGET_H + 10)
#define BTN_H   UI_TAP_MIN
#define BTN_GAP   8
#define ARM_Y   (BTN_Y + BTN_H + 10)
#define ARM_H   60
#define READ_W   ((LCARD_W - 24) / 3)
#define READ_X(k)
 Reading k's column (0 COMMANDED, 1 MEASURED, 2 CURRENT).
#define READ_NUM_H   44
#define READ_NUM_Y   (H - PAD - 12 - READ_NUM_H)
#define READ_LBL_Y   (READ_NUM_Y - 26)
#define SEG_X   (PAD + 16)
#define SEG_Y   (CARD_Y + 14)
#define ARM_NOTE_Y   (CARD_Y + 58)
#define STD_SERVO_V_MAX   6.0f
 The top of a standard servo's rating. A set point raised past it is applied only after the HV warning is held for two seconds.
#define OV_X   PAD
#define OV_Y   PAD
#define OV_W   LCARD_W
#define OV_H   (H - 2 * PAD)
#define OV_TAB_Y   (CARD_Y + 8)
#define OV_TAB_H   40
#define OV_TAB_W   (OV_W - 20)
#define OV_ROW0   (CARD_Y + 52)
#define OV_PITCH   52
#define OV_ROW_H   UI_TAP_MIN
#define OV_COL_W   ((OV_W - 30) / 2)
#define OV_VAL_W   140
#define OV_NOTE_Y   (OV_ROW0 + 4 * OV_PITCH + OV_ROW_H + 2)
 The OUTPUT page's notes, 2px under its fifth row.
#define NOTE_PITCH   21
#define RL_ROW0   (CARD_Y + 56)
#define RL_PITCH   71
#define RL_LBL_H   21
#define RL_COL_W   ((OV_W - 40) / 3)
#define RL_ROWS   5
#define RL_NOTE_Y   (RL_ROW0 + RL_ROWS * RL_PITCH + 2)
 A run's note under its rows: the automatic test's stall note, 4px under the last value.
#define OV_SAVE_Y   (STOP_FLOOR - 20)
 The save line under SETTINGS' rows and notes, 20px tall, ending 4px above the alert band.
#define PWM_MIN_PAUSE_US   1000u
#define HELI_MIN_PAUSE_US   500u
#define SAFE_RATE_HZ   60u
#define TYPE_COUNT   5
#define CHOICE_MAX   10
#define SV_DRAG_TAU_MS   20.0f
 The drag's time constant, ms: the dial's target follows the finger through a one-pole filter this slow.
#define SV_DRAG_SNAP_DEG   0.01f
 How close the filtered target comes to the finger's before it is set to it, degrees: well under a pulse's microsecond.
#define WARN_BTN_Y   (STOP_FLOOR - 56)
 The bottom row of a warning or the question: its buttons' top, so they end with ARM above the alert band.
#define BOX_W   346
 The run's box on LIVE's card, left, under the horn's angle and ARM FIRST: four lines of BOX_CELLS cells of SV_FONT_LABEL, BOX_PITCH px apart, over its one button, STOP TEST while it runs, CLOSE after. Its right edge stays 36px left of the shaft, so the horn, its boss and its rings show at every angle while the box is up; it covers the case's left half.
#define BOX_CELLS   ((BOX_W - 20) / SV_CELL)
#define BOX_PITCH   24
#define BOX_BTN_DY   112

Enumerations

enum  {
  PG_OUTPUT = 0 , PG_SWEEP , PG_DUT , PG_COUNT ,
  PG_AUTO = PG_COUNT , PG_LIMRUN
}
enum  { RL_NONE = 0 , RL_AUTO , RL_LIMIT }
enum  {
  R_TYPE = 0 , R_RATE , R_MIN , R_CENTRE ,
  R_MAX , R_TRIM , R_TRAVEL , R_REVERSE ,
  R_SETTING , R_TEXT , R_HV , R_ENC_CENTRE ,
  R_LIM_MODE , R_LIM_PULSES
}
enum  {
  OP_NONE = 0 , OP_TAB , OP_ROW , OP_TRIM_DN ,
  OP_TRIM_UP , OP_KEYPAD , OP_TEXT , OP_CHOICE ,
  OP_CHOICE_CANCEL , OP_WARN_APPLY , OP_WARN_CANCEL , OP_SUP_V ,
  OP_SUP_I , OP_ASK_APPLY , OP_ASK_CANCEL , OP_TEST_START ,
  OP_LIM_START , OP_RUN_SET , OP_RUN_CLOSE
}
enum  { CH_NONE = 0 , CH_TYPE , CH_RATE , CH_ENUM }
enum  {
  KT_NONE = 0 , KT_MIN , KT_CENTRE , KT_MAX ,
  KT_TRAVEL , KT_RATE , KT_SETTING , KT_SUP_V ,
  KT_SUP_I , KT_TRIM
}
enum  { ASK_SET = 0 , ASK_ON , ASK_TEST }
enum  { RS_OFF_POSTED = 0 , RS_OFF_SENT , RS_SAMPLE , RS_OFF_SEEN }

Functions

void apply_profile (int t, uint16_t hz)
 A profile goes into force: a type with its own pulse widths when it is a different type, and a frame rate no faster than its pulses allow.
void ask_profile (int t, uint16_t hz)
 A profile asked for: one that can destroy a servo not made for it opens the warning, and goes into force only once that has been held; any other goes into force at once.
void reissue (void)
int wrap_text (gfx_canvas_t *c, int x, int y, int pitch, const char *text, int cells, gfx_color_t ink, const gfx_font_t *f)
 text in lines of at most cells cells of face f, from (x, y) down by pitch px, each broken at the last double space that keeps it within them, or else at the last single space.
float us_to_deg_f (float us)
void post (servo_cmd_kind_t kind, uint16_t us)
void release (void)
void stop_sweep (void)
 The sweep ended, running or paused. A pause is ended by the command that follows; the button reads SWEEP from now.
sweep_cfg_t sweep_cfg_now (void)
 The sweep the SWEEP page describes, under the profile in force: CURVE, SPEED and DWELL as they are, and RANGE as a share of the travel the servo may make – TRAVEL, and the nearer of PULSE MIN and MAX, so a sweep about the centre reaches neither end it may not. In the command units of the range a command carries (cmd_range()), centred on PULSE CENTRE. Trim is not applied: the sweep turns about the centre a release rests at.
void test_tell (void)
servo_test_reading_t test_reading_of (const supply_state_t *st)
 Gives the servo test the supply's reading.
void value_edge (ui_value_edge_t edge, servo_test_abort_t why)
 What an edge of the value's state does, in one place.
static void close_panels (void)
static void close_alone (void)
gfx_rect_t row_rect (int i)
 Row i's rectangle: on SETTINGS' pages its column, or both for a wide one, UI_TAP_MIN tall; on a run's, its label over its value.
gfx_rect_t value_rect (int i)
 Where row i's value is drawn: right in its row on SETTINGS' pages, under its label on a run's.
gfx_rect_t trim_rect (int i, bool up)
 TRIM's two steps, inside its value, UI_TAP_MIN px wide each.
gfx_rect_t choice_rect (int i)
 The list's choice i: two columns of CHOICE_MAX / 2.
gfx_rect_t choice_cancel_rect (void)
 The list's CANCEL, bottom right.
gfx_rect_t warn_cancel_rect (void)
 A warning's or the question's CANCEL, bottom right.
int decimals_of (setting_id_t id)
 The decimals a setting's value is typed and drawn with.
bool target_locked (const ov_row_t *r)
 Whether a row is a TARGET or PORT PWM setting under its lock.
void ask_hv_on (void)
void ask_apply (void)
void ov_down (const touch_event_t *evt)
 A press on a page of rows or a panel: on whichever is up; on TRIM, beside its steps, the row.
void ov_rest (const touch_event_t *evt)
void draw_overlay (gfx_canvas_t *c)
 The panel open over the left column, if any: the keypad, the keyboard, the question or the HV warning, the profile warning, or the list.
void draw_save_line (gfx_canvas_t *c)
 Whether the settings reached the card, along the bottom of a page.
void draw_warn_apply (gfx_canvas_t *c)
 The profile warning's HOLD TO APPLY.
void draw_ask_apply (gfx_canvas_t *c)
 The HV warning's HOLD TO APPLY.
int test_blocked (void)
float test_top_v (void)
void test_begin (void)
void test_end_now (servo_test_abort_t why)
void ask_hv_test (void)
void draw_test_start (gfx_canvas_t *c)
 START TEST: green, fading to the danger red across its hold, as ARM; STOP TEST in red while a run is under way.
void draw_test_lines (gfx_canvas_t *c)
 The AUTOMATIC TEST card's lines: over START TEST the steps and the length of each, and under it why a run cannot start or what it does now, the last result and its file, and a STALL AT no reading can pass.
void draw_test_stall (gfx_canvas_t *c, int x, int y)
 A STALL AT the run's readings cannot pass, in the warning colour: the current limit first, then the meter's range. Nothing when it can.
void test_meter_follow (servo_source_id_t id, uint32_t changes)
void test_restore_service (void)
uint32_t test_signature (void)
void test_tick (void)
void draw_test_box (gfx_canvas_t *c)
 The run on LIVE's card: the step and phase while it runs, with STOP TEST; PASS, FAIL or ABORTED and why, and the files, after it, with CLOSE.
static void test_ended (void)
const char * lim_prog_why (void)
const char * lim_blocked (void)
void lim_end_now (servo_test_abort_t why)
void lim_begin (void)
void lim_tick (void)
void lim_leave_follow (void)
void lim_meter_follow (servo_source_id_t id, uint32_t changes)
uint32_t lim_signature (void)
void draw_lim_box (gfx_canvas_t *c)
 The limit run on the left card, in the automatic test's place: while it runs, the values written, the phase with the end and the pulse, and the output it drives; after it, the verdict, the ends or the values, and the report. Its button is STOP RUN while it runs and CLOSE after. The box, its lines and its button are the automatic test's (test_box_rect()).
void draw_lim_start (gfx_canvas_t *c)
 START LIMIT RUN, on the LIMIT RUN card under the AUTOMATIC TEST one: green, fading to the danger red across its hold; STOP RUN in red while the run is under way.
void draw_lim_lines (gfx_canvas_t *c)
 The LIMIT RUN card's lines: over START LIMIT RUN the mode, and under it what the run drives and reads, why it cannot start or what it does now, the last result and its report, and the mode's note.
void draw_lim_mode_note (gfx_canvas_t *c, int x, int y)
 Why SEARCH+PROG is not offered, or what the mode does: the LIMIT RUN settings' note, one line of SV_FONT_LABEL.
static const servo_type_t * type (void)
static void cmd_range (uint16_t *lo, uint16_t *hi)
static uint16_t cmd_top (void)
static float us_to_deg (uint16_t us)
static float clamp_travel (float deg)
static bool value_live (void)
static uint16_t max_rate_for (int t, uint16_t max_us)
static bool dangerous (int t, uint16_t hz)
static bool in_force_dangerous (void)
static bool enc_shown (void)
static gfx_rect_t overlay_area (void)
static gfx_rect_t sup_val_rect (int k)
 The voltage's value or the current limit's on the SET row.
static gfx_rect_t warn_apply_rect (void)
 HOLD TO APPLY, or APPLY, bottom left of a warning or the question.
static uint32_t test_now (void)
static servo_test_abort_t test_abort_of (servo_source_why_t why)
static gfx_rect_t test_box_rect (void)
 The run's box.
static gfx_rect_t test_btn_rect (void)
 The box's button.
static bool test_needs_hv (void)
static bool lim_reads (void)
static bool row_hidden (const ov_row_t *r)
static bool lim_programs (void)
static bool hv_set_point (void)
static bool ask_stands (void)
static void ov_take (const touch_event_t *evt, int code, int which)
static void ov_let_go (void)
static uint8_t save_state (void)
static float enc_deg_now (void)
static bool bench_arming (void)

Variables

const servo_type_t k_types [TYPE_COUNT]
servo_screen_state_t s
const ov_row_t k_rows []
 The rows of the pages, page by page, and their count.
const int k_row_count
 The rows k_rows holds.

Detailed Description

The SERVO screen's private seam between servo_screen*.c, the screen, servo_workbench.c, its task strip, TEST page and TARGET row (servo_workbench_int.h), servo_settings_panel.c, its settings pages and the panels they open, servo_test_panel.c, its automatic test, and servo_limit_panel.c, its limit run: the layout they draw on, the profiles, the pages' rows and presses, the state they read and write, the functions each calls of the others, and the small helpers they inline. Nothing outside shared/ui includes this header; the screen's interface is servo_screen.h.

The state is one object, s, defined in servo_screen.c, so its .bss stays where psram_bss.lf puts servo_screen's. The helpers below are static inline, as they were static in the one file the screen was: GCC inlines them in each file as it did. test_ended() is static inline as well. The one file inlined it in servo_screen_service() and called it out of line from three places; servo_test_panel.c inlines it at those.

SPDX-License-Identifier: MIT

Macro Definition Documentation

◆ ARM_H

#define ARM_H   60

ARM's height, px: 9.0mm.

◆ ARM_NOTE_Y

#define ARM_NOTE_Y   (CARD_Y + 58)

ARM FIRST under it, px.

◆ ARM_Y

#define ARM_Y   (BTN_Y + BTN_H + 10)

ARM and DISARM, px.

◆ BOX_BTN_DY

#define BOX_BTN_DY   112

Its button's top, in it.

◆ BOX_CELLS

#define BOX_CELLS   ((BOX_W - 20) / SV_CELL)

A line of the box: 32.

◆ BOX_PITCH

#define BOX_PITCH   24

Its line pitch, px.

◆ BTN_GAP

#define BTN_GAP   8

Between two of them, px.

◆ BTN_H

#define BTN_H   UI_TAP_MIN

Their height, px.

◆ BTN_Y

#define BTN_Y   (TARGET_Y + TARGET_H + 10)

CENTRE, SWEEP, RELEASE.

◆ CARD_H

#define CARD_H   (H - CARD_Y - PAD)

The left card's height, px.

◆ H

#define H   UI_BODY_H

The body's height under the band, px.

◆ NOTE_PITCH

#define NOTE_PITCH   21

A note's line pitch, px.

◆ OV_COL_W

#define OV_COL_W   ((OV_W - 30) / 2)

A column of SETTINGS: 295px.

◆ OV_H

#define OV_H   (H - 2 * PAD)

Their height, px.

◆ OV_PITCH

#define OV_PITCH   52

From row to row, px.

◆ OV_ROW0

#define OV_ROW0   (CARD_Y + 52)

SETTINGS' first row, px.

◆ OV_ROW_H

#define OV_ROW_H   UI_TAP_MIN

A row's height, px.

◆ OV_TAB_H

#define OV_TAB_H   40

Their height, px.

◆ OV_TAB_W

#define OV_TAB_W   (OV_W - 20)

Their row: three of 200px.

◆ OV_TAB_Y

#define OV_TAB_Y   (CARD_Y + 8)

SETTINGS' page tabs, px.

◆ OV_VAL_W

#define OV_VAL_W   140

A row's value, px.

◆ OV_W

#define OV_W   LCARD_W

Their width, px.

◆ OV_X

#define OV_X   PAD

The left column's panels, px.

◆ OV_Y

#define OV_Y   PAD

Their top, px.

◆ PAD

#define PAD   UI_MARGIN

The screen's outer margin, px.

◆ PWR_H

#define PWR_H   70

The power plot's height, px.

◆ PWR_LAB_W_INA

#define PWR_LAB_W_INA   134

The same beside an INA3221 channel's name.

◆ PWR_Y

#define PWR_Y   (PWR_TXT_Y + 24)

The power plot's top, px.

◆ RC_W

#define RC_W   (RCARD_W - 24)

Its width: 356px.

◆ RC_X

#define RC_X   (RCARD_X + 12)

The output card's inner column, px.

◆ RCARD_H

#define RCARD_H   (H - 2 * PAD)

The output card's height, px.

◆ RCARD_W

#define RCARD_W   (W - RCARD_X - PAD)

The output card's width: 380px.

◆ RCARD_X

#define RCARD_X   (PAD + LCARD_W + 8)

The output card's left edge, px.

◆ READ_LBL_Y

#define READ_LBL_Y   (READ_NUM_Y - 26)

The label and unit row.

◆ READ_NUM_H

#define READ_NUM_H   44

A reading's numerals, px.

◆ READ_NUM_Y

#define READ_NUM_Y   (H - PAD - 12 - READ_NUM_H)

Their top, px.

◆ READ_W

#define READ_W   ((LCARD_W - 24) / 3)

A reading's column: 198px.

◆ READ_X

#define READ_X ( k)
Value:
(PAD + 12 + (k) * READ_W)
#define PAD
Definition analyser_screen.c:26
#define k
Short name for kst_panel_k inside the overlay's seven files.
Definition kst_panel_int.h:238
#define READ_W
Definition servo_screen_int.h:169

Reading k's column (0 COMMANDED, 1 MEASURED, 2 CURRENT).

◆ RL_COL_W

#define RL_COL_W   ((OV_W - 40) / 3)

A column of a run's: 193px.

◆ RL_LBL_H

#define RL_LBL_H   21

A run's row's label over its value.

◆ RL_PITCH

#define RL_PITCH   71

From row to row: label and value.

◆ RL_ROW0

#define RL_ROW0   (CARD_Y + 56)

A run's first row, px.

◆ RL_ROWS

#define RL_ROWS   5

The rows a column holds.

◆ SEG_X

#define SEG_X   (PAD + 16)

The horn's angle, top left.

◆ SEG_Y

#define SEG_Y   (CARD_Y + 14)

Its top, px.

◆ SLIDER_H

#define SLIDER_H   40

SPEED's track's height, px.

◆ SLIDER_Y

#define SLIDER_Y   (SPEED_Y + 24)

SPEED's track, px.

◆ SPEED_Y

#define SPEED_Y   (SUP_Y + SUP_H + 10)

SPEED's label row, px.

◆ SUP_GAP

#define SUP_GAP   8

Between the SET row's boxes.

◆ SUP_H

#define SUP_H   UI_TAP_MIN

The SET row's height, px.

◆ SUP_VAL_W

#define SUP_VAL_W   84

A set point's box, px.

◆ SUP_VAL_X

#define SUP_VAL_X   (RC_X + 48)

The voltage's value box, px.

◆ SV_CELL

#define SV_CELL   10

SV_FONT_LABEL's cell width, px.

◆ SV_DRAG_TAU_MS

#define SV_DRAG_TAU_MS   20.0f

The drag's time constant, ms: the dial's target follows the finger through a one-pole filter this slow.

The GT911 is read every 10.5ms and the panel draws every 16.6ms, so a finger moving at a steady 90deg a second reaches the screen as 0.5 to 2.1deg a frame where 1.5 is right; the servo is sent the same beat. 20ms is about one touch read and one frame: the steps even out, and the command lags a steady drag by 20ms, 1.8deg at 90deg a second.

◆ SV_FONT_BODY

#define SV_FONT_BODY   UI_FONT_BODY

12 x 24: warnings, run results.

◆ SV_FONT_HEAD

#define SV_FONT_HEAD   (&gfx_font_20x36)

20 x 36: a warning's title.

◆ SV_FONT_LABEL

#define SV_FONT_LABEL   (&gfx_font_10x20)

The faces of the 1024 x 600 type scale this screen draws in.

SV_FONT_LABEL (10 x 20) for every label, button, row and value; SV_FONT_BODY (12 x 24) for prose read at a distance: the warnings and their lines; SV_FONT_HEAD (20 x 36) for a warning's title and the question's values; SV_FONT_NUM (32 x 44, digits, sign, point and space only) for LIVE's three readings.

◆ SV_FONT_NUM

#define SV_FONT_NUM   (&gfx_font_num_32x44)

32 x 44: LIVE's readings.

◆ SV_PAGE_Y

#define SV_PAGE_Y   (UI_WB_PAGE_Y + 18)

The page's top: 56px.

◆ SV_STRIP_H

#define SV_STRIP_H   (UI_WB_STRIP_H + 16)

A tab's height: 40px.

◆ SV_STRIP_X

#define SV_STRIP_X   UI_WB_STRIP_X

SERVO's task strip at the 1024 x 600 sizes: four tabs of 150 x 40px, 4px apart, from y 8, and the page from y 56.

The shared UI_WB_ figures stay at their 24px strip for MOTOR & ESC and SUPPLY until those are laid out at the new sizes; these are SERVO's own, the shared figures plus the difference. SV_PAGE_Y is the top of the page area a task and PROGRAM's sessions draw in.

◆ SV_STRIP_Y

#define SV_STRIP_Y   (UI_WB_STRIP_Y + 2)

The strip's top: 8px.

◆ SV_TAB_GAP

#define SV_TAB_GAP   UI_WB_TAB_GAP

Between two tabs: 4px.

◆ SV_TAB_W

#define SV_TAB_W   (UI_WB_TAB_W + 38)

A tab's width: 150px.

◆ TAG_H

#define TAG_H   44

The type pill's height, px.

◆ TAG_Y

#define TAG_Y   (RCARD_Y + 12)

The type pill's top, px.

◆ TARGET_H

#define TARGET_H   UI_TAP_MIN

The TARGET row's height, px.

◆ W

#define W   UI_PANEL_W

The panel's width, px: the screen's own.

Function Documentation

◆ apply_profile()

void apply_profile ( int t,
uint16_t hz )

A profile goes into force: a type with its own pulse widths when it is a different type, and a frame rate no faster than its pulses allow.

Parameters
tthe profile's index in k_types
hzthe frame rate asked for

◆ ask_profile()

void ask_profile ( int t,
uint16_t hz )

A profile asked for: one that can destroy a servo not made for it opens the warning, and goes into force only once that has been held; any other goes into force at once.

Parameters
tthe profile's index in k_types
hzthe frame rate asked for

◆ choice_cancel_rect()

gfx_rect_t choice_cancel_rect ( void )

The list's CANCEL, bottom right.

Returns
the button

◆ choice_rect()

gfx_rect_t choice_rect ( int i)

The list's choice i: two columns of CHOICE_MAX / 2.

Parameters
ithe choice
Returns
its button

◆ decimals_of()

int decimals_of ( setting_id_t id)

The decimals a setting's value is typed and drawn with.

Parameters
idthe setting
Returns
2 for a float stepping under 1, else 0

◆ draw_ask_apply()

void draw_ask_apply ( gfx_canvas_t * c)

The HV warning's HOLD TO APPLY.

Parameters
cthe canvas

◆ draw_lim_box()

void draw_lim_box ( gfx_canvas_t * c)

The limit run on the left card, in the automatic test's place: while it runs, the values written, the phase with the end and the pulse, and the output it drives; after it, the verdict, the ends or the values, and the report. Its button is STOP RUN while it runs and CLOSE after. The box, its lines and its button are the automatic test's (test_box_rect()).

Parameters
cthe canvas

◆ draw_lim_lines()

void draw_lim_lines ( gfx_canvas_t * c)

The LIMIT RUN card's lines: over START LIMIT RUN the mode, and under it what the run drives and reads, why it cannot start or what it does now, the last result and its report, and the mode's note.

Parameters
cthe canvas

◆ draw_lim_mode_note()

void draw_lim_mode_note ( gfx_canvas_t * c,
int x,
int y )

Why SEARCH+PROG is not offered, or what the mode does: the LIMIT RUN settings' note, one line of SV_FONT_LABEL.

Parameters
cthe canvas
xthe line's left edge
yits top

◆ draw_lim_start()

void draw_lim_start ( gfx_canvas_t * c)

START LIMIT RUN, on the LIMIT RUN card under the AUTOMATIC TEST one: green, fading to the danger red across its hold; STOP RUN in red while the run is under way.

Parameters
cthe canvas

◆ draw_overlay()

void draw_overlay ( gfx_canvas_t * c)

The panel open over the left column, if any: the keypad, the keyboard, the question or the HV warning, the profile warning, or the list.

Parameters
cthe canvas

◆ draw_save_line()

void draw_save_line ( gfx_canvas_t * c)

Whether the settings reached the card, along the bottom of a page.

Parameters
cthe canvas

◆ draw_test_box()

void draw_test_box ( gfx_canvas_t * c)

The run on LIVE's card: the step and phase while it runs, with STOP TEST; PASS, FAIL or ABORTED and why, and the files, after it, with CLOSE.

Parameters
cthe canvas

◆ draw_test_lines()

void draw_test_lines ( gfx_canvas_t * c)

The AUTOMATIC TEST card's lines: over START TEST the steps and the length of each, and under it why a run cannot start or what it does now, the last result and its file, and a STALL AT no reading can pass.

Parameters
cthe canvas

◆ draw_test_stall()

void draw_test_stall ( gfx_canvas_t * c,
int x,
int y )

A STALL AT the run's readings cannot pass, in the warning colour: the current limit first, then the meter's range. Nothing when it can.

Parameters
cthe canvas
xthe line's left edge, px
yits top, px

◆ draw_test_start()

void draw_test_start ( gfx_canvas_t * c)

START TEST: green, fading to the danger red across its hold, as ARM; STOP TEST in red while a run is under way.

Parameters
cthe canvas

◆ draw_warn_apply()

void draw_warn_apply ( gfx_canvas_t * c)

The profile warning's HOLD TO APPLY.

Parameters
cthe canvas

◆ ov_down()

void ov_down ( const touch_event_t * evt)

A press on a page of rows or a panel: on whichever is up; on TRIM, beside its steps, the row.

Parameters
evtThe DOWN.

◆ row_rect()

gfx_rect_t row_rect ( int i)

Row i's rectangle: on SETTINGS' pages its column, or both for a wide one, UI_TAP_MIN tall; on a run's, its label over its value.

Parameters
ithe row in k_rows
Returns
the row: a tap anywhere on it edits it

◆ sup_val_rect()

gfx_rect_t sup_val_rect ( int k)
inlinestatic

The voltage's value or the current limit's on the SET row.

Parameters
k0 the voltage, 1 the current limit
Returns
the box a tap opens the keypad from

◆ sweep_cfg_now()

sweep_cfg_t sweep_cfg_now ( void )

The sweep the SWEEP page describes, under the profile in force: CURVE, SPEED and DWELL as they are, and RANGE as a share of the travel the servo may make – TRAVEL, and the nearer of PULSE MIN and MAX, so a sweep about the centre reaches neither end it may not. In the command units of the range a command carries (cmd_range()), centred on PULSE CENTRE. Trim is not applied: the sweep turns about the centre a release rests at.

Returns
the curve

◆ target_locked()

bool target_locked ( const ov_row_t * r)

Whether a row is a TARGET or PORT PWM setting under its lock.

Parameters
rthe row
Returns
true when it takes no tap now

◆ test_box_rect()

gfx_rect_t test_box_rect ( void )
inlinestatic

The run's box.

Returns
the box, in the screen's coordinates

◆ test_btn_rect()

gfx_rect_t test_btn_rect ( void )
inlinestatic

The box's button.

Returns
STOP TEST or CLOSE, 150 x 48px

◆ test_reading_of()

servo_test_reading_t test_reading_of ( const supply_state_t * st)

Gives the servo test the supply's reading.

Parameters
stthe supply's state
Returns
the reading

◆ trim_rect()

gfx_rect_t trim_rect ( int i,
bool up )

TRIM's two steps, inside its value, UI_TAP_MIN px wide each.

Parameters
iTRIM's row in k_rows
uptrue for +, false for -
Returns
the step

◆ value_edge()

void value_edge ( ui_value_edge_t edge,
servo_test_abort_t why )

What an edge of the value's state does, in one place.

Into LIVE: the value is the rest.

Out of LIVE, to LEAVING or to OFF: everything that drives the servo by itself ends – a run, ended as why, a sweep, a pause, a drag, and a held position, which a change of SPEED or of the profile would otherwise say again – and a motion command not yet taken is not sent. The value shown stays where it was last driven: the release a run ends with moves none, because the value is no longer live (release()).

Parameters
edgethe edge of the value's state
whywhy a run ended, when one does

◆ value_rect()

gfx_rect_t value_rect ( int i)

Where row i's value is drawn: right in its row on SETTINGS' pages, under its label on a run's.

Parameters
ithe row in k_rows
Returns
the value's box

◆ warn_apply_rect()

gfx_rect_t warn_apply_rect ( void )
inlinestatic

HOLD TO APPLY, or APPLY, bottom left of a warning or the question.

Returns
the button, 240 x 56px

◆ warn_cancel_rect()

gfx_rect_t warn_cancel_rect ( void )

A warning's or the question's CANCEL, bottom right.

Returns
the button

◆ wrap_text()

int wrap_text ( gfx_canvas_t * c,
int x,
int y,
int pitch,
const char * text,
int cells,
gfx_color_t ink,
const gfx_font_t * f )

text in lines of at most cells cells of face f, from (x, y) down by pitch px, each broken at the last double space that keeps it within them, or else at the last single space.

Parameters
cthe canvas, or NULL to count the lines only
xthe lines' left edge, px
ythe first line's top, px
pitchfrom line to line, px
textthe text
cellsthe cells a line holds
inkthe text's colour
fthe face
Returns
the lines it takes

Variable Documentation

◆ k_row_count

const int k_row_count
extern

The rows k_rows holds.

The rows k_rows holds.

◆ k_rows

const ov_row_t k_rows[]
extern

The rows of the pages, page by page, and their count.

The settings rows, page by page. SETTINGS' pages in two columns; the automatic test's in three of five rows: the steps, the pass/fail limits and the brown-out, the length and timing. The length rule tops the right column, under TEST's SETTINGS: a second tap there opens its list and changes nothing.

The rows of the pages, page by page, and their count.