28#include "ui_card_text.h"
48#define TAB_H UI_TAP_MIN
52#define ROW_H UI_TAP_MIN
64#define KP_FONT (&gfx_font_10x20)
65#define KP_TITLE_FONT (&gfx_font_20x36)
74#define REPEAT_DELAY_S 0.45f
75#define REPEAT_SLOW_HZ 8.0f
76#define REPEAT_FAST_S 1.8f
77#define REPEAT_FAST_HZ 30.0f
79enum { PG_SERVO = 0, PG_TUNE, PG_PULSE, PG_FAILSAFE, PG_LOCKED, PG_COUNT };
81enum { K_FIELD = 0, K_STEP, K_LOCKED, K_ACT };
84 A_PORT = 0, A_READ, A_FILES, A_RESTORE, A_MORE, A_ENABLE,
109extern const int16_t
kpn_rule[KST_RULE_COUNT];
114 P_NONE = 0, P_TAB, P_CLOSE, P_ROW, P_MINUS, P_PLUS, P_KEYPAD, P_CHOICE,
115 P_CHOICE_CANCEL, P_APPLY, P_CANCEL, P_TEXTKEY, P_NOTES
118enum { C_STRETCH = 0, C_RESTORE, C_MORE, C_FILES };
119#define FILES_SAVE (-1)
123#define FILES_NEXT (-2)
124enum { MORE_VERIFY = 0, MORE_DISCARD, MORE_RELEASE, MORE_VOLTAGE,
125 MORE_CURRENT, MORE_WAIT };
127#define RESTORE_FORGET ((int)KST_PROG_FROM_COUNT)
129enum { W_SOFT = 0, W_ENABLE, W_WRITE, W_RESTORE, W_RELEASE, W_LEAVE,
133#define KP_VOLTAGE (-1)
135#define KP_CURRENT (-2)
434void kpn_write_n(
char *out,
size_t size,
unsigned n);
#define s
Short name for esc_stick_s inside the five stick-class files.
Definition esc_stick_panel_int.h:295
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
void kpn_fmt_value(kst_field_id_t id, uint16_t raw, char *out, size_t n, bool unit)
A field's value as its row shows it.
Definition kst_panel.c:217
bool kpn_programming(void)
Whether the port is in programming.
Definition kst_panel.c:138
gfx_rect_t kpn_step_rect(const row_t *r, bool up)
Row r's plus key (up) or minus key.
Definition kst_panel.c:386
gfx_rect_t kpn_value_rect(const row_t *r)
Row r's value, between its keys where it has them.
Definition kst_panel.c:375
void kpn_fmt_field(kst_field_id_t id, uint16_t raw, char *out, size_t n)
kpn_fmt_value() with the unit.
Definition kst_panel.c:252
const char * kpn_field_name(unsigned id)
The name a field has on its row; NULL for one without a row.
Definition kst_panel.c:172
int kpn_notes_foot(void)
Where the notes and the message under a page end.
Definition kst_panel.c:347
uint8_t kpn_port_no(void)
The programming port the overlay works on: the SERVO screen's target, and the first port while that i...
Definition kst_panel.c:120
bool kpn_on_port(void)
Whether the SERVO screen's tester drives a programming port.
Definition kst_panel.c:128
int kpn_decimals_of(kst_field_id_t id)
Digits after the point a field's displayed value has.
Definition kst_panel.c:203
bool kpn_in_set(kst_field_set_t set, unsigned id)
Whether field id is in set.
Definition kst_panel.c:182
const char * kpn_unit_of(kst_field_id_t id)
A field's unit as its value shows it; "" for none.
Definition kst_panel.c:187
const char * kpn_shown(const char *name)
A file name as a line shows it: whole up to KST_PANEL_NAME_TYPED characters, else its start and "....
Definition kst_panel.c:466
const char * kpn_row_label(const row_t *r)
A row's label: its text, or for PORT and SERVO what they hold now.
Definition kst_panel.c:149
bool kpn_changed(kst_field_id_t id)
Whether the draft holds another value of id than the servo.
Definition kst_panel.c:257
gfx_rect_t kpn_tabs_rect(void)
The tabs.
Definition kst_panel.c:332
const row_t * kpn_row_at(int page, int row, int col)
The row at (row, col) of page page, or NULL.
Definition kst_panel.c:394
bool kpn_flag(uint16_t f)
Whether flag f is set in the port's report.
Definition kst_panel.c:133
gfx_rect_t kpn_row_rect(const row_t *r)
Row r, its label and its control.
Definition kst_panel.c:355
unsigned kpn_servo_type(void)
The servo's type as the card names it; 0 without a servo.
Definition kst_panel.c:143
ui_text_id_t kpn_card_text_id(ui_card_at_t at)
The card's words for at, for the slot as the feed says it.
Definition kst_panel.c:96
const char * kpn_card_tr(ui_card_at_t at)
The same words, translated.
Definition kst_panel.c:101
int kpn_foot(void)
Where a control at the area's foot ends.
Definition kst_panel.c:339
unsigned kpn_ones(uint64_t v)
The bits set in v.
Definition kst_panel.c:108
int kpn_text_rows(gfx_canvas_t *c, int x, int y, const char *s, gfx_color_t color)
s in rows of the area's width, a row each LINE_H.
Definition kst_panel.c:315
kst_panel_state_t kst_panel_k
The state, kst_panel_k, in kst_panel.c, so its .bss stays where psram_bss.lf puts kst_panel's....
Definition kst_panel.c:86
const row_t kpn_rows[]
The overlay's rows, ROW_COUNT of them.
Definition kst_panel.c:38
The KST and Chaservo programmer's overlay on SERVO: its interface.
bool kpn_notes_paged_at(int x, int y)
Whether (x, y) is on notes that take more than one page.
Definition kst_panel_draw.c:632
void kpn_close_editors(void)
Every editor shut: the keypad, the keyboard, the list and the page; a soft limit's edit is cancelled.
Definition kst_panel_edit.c:33
bool kpn_row_live(const row_t *r)
Whether row r's control takes a tap now.
Definition kst_panel_edit.c:509
bool kpn_leave_waits(const kst_prog_t *p)
Whether a LEAVE's wait runs: an abort keeps the session.
Definition kst_panel_edit.c:345
void kpn_step(const row_t *r, bool up)
One step of a plus (up) or minus key on row r.
Definition kst_panel_edit.c:332
void kpn_options_keep(void)
The programmer's options into the settings.
Definition kst_panel_edit.c:253
void kpn_card_moved(void)
What the card's side brought: the list, the name again, a file's warnings.
Definition kst_panel_edit.c:146
void kpn_edit_field(const row_t *r)
Row r's editor: a toggle, the list or the keypad.
Definition kst_panel_edit.c:185
void kpn_keypad_done(float v)
The keypad's value v for the row or the supply it edits.
Definition kst_panel_edit.c:282
void kpn_act(const row_t *r)
The action of row r of the SERVO page.
Definition kst_panel_edit.c:351
void kpn_name_done(const char *name)
A file's name typed: the save, or the keyboard again for a name the card's side does not take.
Definition kst_panel_edit.c:90
void kpn_options_load(void)
The programmer's options from the settings.
Definition kst_panel_edit.c:267
void kpn_choice_done(int value)
The list's choice value for what the list was opened for.
Definition kst_panel_edit.c:440
const int16_t kpn_rule[KST_RULE_COUNT]
A soft limit's words, by rule, in kst_panel_text.c.
Definition kst_panel_text.c:181
void kpn_warn_file(void)
The page of a file whose values pass soft limits: its warnings, and the draft takes it after the hold...
Definition kst_panel_warn.c:332
#define CHOICE_MAX
The entries a list holds: the fullest, FILES, has KST_PROG_FILES_MAX files between the entry that sav...
Definition kst_panel_int.h:141
void kpn_warn_release(void)
The page of RELEASE.
Definition kst_panel_warn.c:427
void kpn_warn_leave(void)
The page of the way back to PWM, with and without a PD mini.
Definition kst_panel_warn.c:438
void kpn_stay_line(char *out, unsigned n)
Into out, KST_PANEL_LINE bytes: how many values stay as they are, n.
Definition kst_panel_text.c:250
void kpn_warn_apply(void)
The hold completed: what the page asked for.
Definition kst_panel_warn.c:467
void kpn_journal_line(char *out, int text, unsigned arg)
Into out: a line of the interrupted write's record, the GPIO or the port of kst_prog_journal_arg() in...
Definition kst_panel_text.c:262
void kpn_supply_sync(void)
The supply's own controls follow the port: while one is out of PWM they offer an OFF and nothing else...
Definition kst_panel_touch.c:294
void kpn_warn_enable(void)
The page of ENABLE WRITE TO SERVO.
Definition kst_panel_warn.c:235
void kpn_warn_soft(const row_t *r)
The page of an edit of row r that passes a soft limit.
Definition kst_panel_warn.c:224
void kpn_warn_check(const kst_prog_restore_t *plan)
The page of a backup whose values pass soft limits the servo keeps: its warnings first,...
Definition kst_panel_warn.c:418
void kpn_write_n(char *out, size_t size, unsigned n)
Into out, size bytes: the title of a write of n values.
Definition kst_panel_text.c:316
int kpn_warn_rows(void)
The rows the page's lines take.
Definition kst_panel_warn.c:129
void kpn_warn_hv(uint16_t mv)
The page of a programming voltage mv, mV, above what a standard servo is rated for.
Definition kst_panel_warn.c:453
#define WARN_LINES
Lines a warning page holds, WARN_LINES of KST_PANEL_LINE bytes.
Definition kst_panel_int.h:143
void kpn_warn_restore(const kst_prog_restore_t *plan)
The page of a restore by plan.
Definition kst_panel_warn.c:389
int kpn_warn_room(void)
The rows a warning page's lines may take in the area: those that fit between WARN_TOP and 8px above t...
Definition kst_panel_warn.c:120
#define ROW_COUNT
The rows of the five pages, in kst_panel.c, and their count.
Definition kst_panel_int.h:104
void kpn_warn_write(void)
The page of WRITE: the values, the horn and the card.
Definition kst_panel_warn.c:354
ui_text_id_t kpn_from_text(unsigned from)
The words for where a restore's values come from.
Definition kst_panel_warn.c:382
void kpn_kind_line(char *out, int text)
Into out: what an edited file is, with the fields it gives a value for where the card's side counted ...
Definition kst_panel_text.c:289
The programmer for KST and Chaservo servos as the SERVO screen runs it: what is read from a servo,...
kst_prog_state_t
Where the programmer is.
Definition kst_prog.h:142
#define KST_PROG_NAME_MAX
A file's name with its terminator.
Definition kst_prog.h:139
uint64_t kst_field_set_t
A set of fields, bit n for field n.
Definition kst_reg.h:110
kst_field_id_t
Every bit of the 32 registers belongs to exactly one field.
Definition kst_reg.h:61
char labels[CHOICE_MAX][KST_PANEL_LINE]
kst_field_id_t want_id[2]
char lines[WARN_LINES][KST_PANEL_LINE]
uint8_t level[WARN_LINES]
The overlay's state.
Definition kst_panel_int.h:160
ui_tabs_t tabs
Definition kst_panel_int.h:167
bool open
Definition kst_panel_int.h:163
uint8_t note_page
Definition kst_panel_int.h:164
kst_prog_t prog
Definition kst_panel_int.h:161
bool files_wait
Definition kst_panel_int.h:179
uint32_t hold_rev
Definition kst_panel_int.h:217
gfx_rect_t area
Definition kst_panel_int.h:162
ui_textkey_t tk
Definition kst_panel_int.h:176
bool loaded
Definition kst_panel_int.h:169
bool hv
Definition kst_panel_int.h:168
bool have
Definition kst_panel_int.h:207
uint8_t id
Definition kst_panel_int.h:208
char name[KST_PROG_NAME_MAX]
Definition kst_panel_int.h:177
uint32_t sig
Definition kst_panel_int.h:214
int pressed
Definition kst_panel_int.h:209
int row
Definition kst_panel_int.h:210
ui_keypad_t kp
Definition kst_panel_int.h:172
kst_prog_state_t state_seen
Definition kst_panel_int.h:213
bool name_wait
Definition kst_panel_int.h:178
uint32_t note_sig
Signature of the notes' places and rows the page is of.
Definition kst_panel_int.h:166
int kp_row
Row the keypad edits, or KP_VOLTAGE, KP_CURRENT, KP_WAIT.
Definition kst_panel_int.h:174
uint32_t files_seq
Definition kst_panel_int.h:180
uint32_t rev
Revision, counted up when the overlay's picture changes.
Definition kst_panel_int.h:216
float held_s
Definition kst_panel_int.h:211
bool card_look
Definition kst_panel_int.h:170
A restore as kst_prog_restore_plan() prepared it.
Definition kst_prog.h:314
The state of the servo programmer.
Definition kst_prog.h:536
One row of the overlay: where it sits, what its control does and what it is called.
Definition kst_panel_int.h:92
int16_t label
Definition kst_panel_int.h:99
uint8_t row
Definition kst_panel_int.h:94
const char * name
Definition kst_panel_int.h:100
uint8_t wide
Definition kst_panel_int.h:96
uint8_t col
Definition kst_panel_int.h:95
uint8_t page
Definition kst_panel_int.h:93
uint8_t what
Definition kst_panel_int.h:98
uint8_t kind
Definition kst_panel_int.h:97
Definition ui_widgets.h:415
A numeric keypad: what it was opened with, what is typed, and the press it holds.
Definition ui_keypad.h:61
A row of tabs: their labels, where they are, which is selected and the press under way.
Definition ui_tabs.h:27
A keyboard: what it was opened for, what is typed, and the press it holds.
Definition ui_textkey.h:114
Plain data types shared by the touch controller driver, the coordinate mapper and the event tracker....
A numeric keypad over part of a screen, for a value a slider is too coarse to place.
The panel's geometry, in one place.
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
An on-screen keyboard for a short name: capitals, digits, space and the marks a name or a file needs,...