|
| #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 |
|
| 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
} |
|
| 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) |
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