45#define RIGHT_X (LEFT_X + LEFT_W + 8)
46#define RIGHT_W (W - PAD - RIGHT_X)
47#define RC_X (RIGHT_X + 12)
48#define RC_W (RIGHT_W - 24)
55#define SU_STRIP_X UI_WB_STRIP_X
56#define SU_STRIP_Y (UI_WB_STRIP_Y + 2)
57#define SU_STRIP_H (UI_WB_STRIP_H + 16)
58#define SU_TAB_W (UI_WB_TAB_W + 38)
59#define SU_TAB_GAP UI_WB_TAB_GAP
60#define SU_PAGE_Y (UI_WB_PAGE_Y + 18)
66#define STOP_FLOOR (UI_ALERT_Y - UI_BAND_H - 4)
77#define SU_FONT_LABEL (&gfx_font_10x20)
78#define SU_FONT_FINE UI_FONT_FINE
79#define SU_FONT_BODY UI_FONT_BODY
80#define SU_FONT_HEAD (&gfx_font_20x36)
81#define SU_FONT_NUM (&gfx_font_num_32x44)
91#define TASKS (UI_WB_HAS(UI_WB_LIVE) | UI_WB_HAS(UI_WB_SETTINGS))
93#define INFO_X (SU_STRIP_X + 2 * SU_TAB_W + SU_TAB_GAP + 3 + 12)
95#define INFO_Y (SU_STRIP_Y + (SU_STRIP_H - LINE_H) / 2)
105#define RAIL_Y SU_PAGE_Y
109#define CTL_Y (RAIL_Y + 4 * CARD_H + 3 * CARD_GAP + 8)
110#define CTL_H (H - PAD - CTL_Y)
111#define BTN_H UI_TAP_MIN
112#define RESET_Y (CTL_Y + TITLE_H + 14)
113#define OUT_Y (RESET_Y + BTN_H + 10)
116 "OUTPUT OFF ends above the alert band");
124#define UP_Y SU_PAGE_Y
126#define LO_Y (UP_Y + UP_H + 8)
127#define LO_H (H - PAD - LO_Y)
129#define TAB_X (LEFT_X + INNER)
130#define TAB_Y (UP_Y + TITLE_H + 6)
133#define LEG_Y (TAB_Y + TAB_H + 4)
135#define PLOT_X (LEFT_X + INNER)
136#define PLOT_W (LEFT_W - 2 * INNER)
137#define PLOT_Y (LEG_Y + LEG_H + 4)
138#define PLOT_H (UP_Y + UP_H - INNER - PLOT_Y)
140#define TBL_SET_DX 150
141#define TBL_NOW_DX 300
142#define TBL_UNIT_DX 400
157#define SET_Y0 (LO_Y + TITLE_H + 4)
158#define SET_TEXT_H LINE_H
159#define SET_CTRL_DY 26
160#define SET_CTRL_H UI_TAP_MIN
164#define SET_VAL_X (LEFT_X + LEFT_W - INNER - SET_VAL_W)
166#define SET_UP_X (SET_VAL_X - 8 - NUDGE_W)
167#define SET_TRACK_X (LEFT_X + INNER + NUDGE_W + 8)
168#define SET_TRACK_W (SET_UP_X - 8 - SET_TRACK_X)
173 "the current limit's row ends above the alert band");
176 "a row's thumb ends over the next row's label");
178 "the thumb ends under its label");
186#define OV_Y SU_PAGE_Y
188#define OV_H (H - OV_Y - PAD)
197#define OV_ROW_H UI_TAP_MIN
202#define OV_COL0_X (OV_X + INNER)
203#define OV_COL1_X (OV_COL0_X + OV_COL_W + 16)
204#define OV_COL1_W (OV_X + OV_W - INNER - OV_COL1_X)
205#define OV_SAVE_Y (STOP_FLOOR - LINE_H)
206#define OV_HELP_PITCH 18
209#define OV_RESTART_DY 152
210#define OV_HELP_DY 204
211#define OV_CONFIRM_DY 268
212#define OV_MODRESET_DY 300
214 "KEYPAD's row ends over the save line");
216 "the trips' help ends over CONFIRM WHILE ON");
224#define ASK_BTN_Y (OV_Y + 240)
231#define SAMPLE_HZ 20.0f
238enum { S_VOLT = 0, S_CURR, S_POWER, S_READINGS, S_VSET = S_READINGS, S_ISET,
242enum { P_NONE = 0, P_OUTPUT, P_RESET, P_V_DOWN, P_V_UP, P_I_DOWN, P_I_UP,
243 P_V_SLIDER, P_I_SLIDER, P_TABS, P_CARD_V, P_CARD_I, P_VALUE_V,
244 P_VALUE_I, P_STRIP, P_ROW, P_KEYPAD, P_APPLY, P_DISCARD, P_MODRESET };
247enum { FROM_SLIDER = 0, FROM_KEYPAD };
250enum { KP_NONE = 0, KP_SET_V, KP_SET_I, KP_SETTING };
277 { SET_SUPPLY_V_MAX, TX_SUP_ROW_V_MAX, 0, 36, 2 },
278 { SET_SUPPLY_I_MAX, TX_SUP_ROW_I_MAX, 0, 92, 2 },
279 { SET_SUPPLY_V_START, TX_SUP_ROW_V_START, 0, 180, 2 },
280 { SET_SUPPLY_I_START, TX_SUP_ROW_I_START, 0, 236, 2 },
281 { SET_SUPPLY_TRIP_I, TX_SUP_ROW_TRIP_I, 1, 36, 2 },
282 { SET_SUPPLY_TRIP_V, TX_SUP_ROW_TRIP_V, 1, 92, 2 },
283 { SET_SUPPLY_TRIP_MS, TX_SUP_ROW_TRIP_MS, 1, 148, 0 },
284 { SET_SUPPLY_CONFIRM_SLIDE, TX_SUP_ROW_CONFIRM_SLIDE, 1, 296, 0 },
285 { SET_SUPPLY_CONFIRM_KEYS, TX_SUP_ROW_CONFIRM_KEYS, 1, 352, 0 },
288#define ROW_COUNT ((int)(sizeof(k_rows) / sizeof(k_rows[0])))
gfx: an RGB565 (16-bit red, green, blue) rasteriser with no dependencies.
#define STOP_FLOOR
The lowest row a control that stops what the bench drives, or a line of text, may reach: 4px above th...
Definition motor_screen_int.h:75
const ov_row_t k_rows[]
The rows of the pages, page by page, and their count.
Definition servo_settings_panel.c:46
#define OV_ROW_H
Definition servo_screen_int.h:208
#define OV_SAVE_Y
The save line under SETTINGS' rows and notes, 20px tall, ending 4px above the alert band.
Definition servo_screen_int.h:224
#define OV_Y
Definition servo_screen_int.h:192
Device settings: a typed schema, a value per entry, and a persistence seam.
setting_id_t
Every setting's id, in schema order.
Definition settings.h:67
One row of SETTINGS' page: the setting it edits, its label, its column and its place from the overlay...
Definition supply_screen_int.h:260
setting_id_t id
Definition supply_screen_int.h:261
int decimals
Definition supply_screen_int.h:269
ui_text_id_t label
Definition supply_screen_int.h:262
int y
Definition supply_screen_int.h:268
int col
Column: 0 left (caps and start values), 1 right (trips and confirmations).
Definition supply_screen_int.h:267
The supply screen's state: the plot, the sliders, the set points and what the supply reports,...
Definition supply_screen_int.h:295
int pressed
Definition supply_screen_int.h:392
uint32_t off_count
Definition supply_screen_int.h:342
uint32_t confirm_stops
Definition supply_screen_int.h:346
supply_caps_t eff
Definition supply_screen_int.h:305
uint32_t drawn_kp[2]
Definition supply_screen_int.h:379
int rx1
Definition supply_screen_int.h:358
uint32_t drawn_set[2]
Definition supply_screen_int.h:373
uint32_t ov_rev
Definition supply_screen_int.h:376
bool port_held
Whether a servo programming port is out of PWM and holds the supply.
Definition supply_screen_int.h:326
ui_slider_t v_slider
Definition supply_screen_int.h:301
supply_by_t owner
Definition supply_screen_int.h:335
ui_wb_strip_t wb
Definition supply_screen_int.h:297
ui_tabs_t tabs
Definition supply_screen_int.h:300
supply_limits_t lim
Definition supply_screen_int.h:304
gfx_rect_t out_rect
Definition supply_screen_int.h:381
gfx_rect_t v_down
Definition supply_screen_int.h:384
uint32_t drawn_push[2]
Definition supply_screen_int.h:367
uint32_t out_rev
Definition supply_screen_int.h:374
int press_row
Definition supply_screen_int.h:393
gfx_rect_t i_up
Definition supply_screen_int.h:387
gfx_rect_t apply_btn
Definition supply_screen_int.h:353
setting_id_t kp_setting
Setting the keypad types when kp_target is KP_SETTING.
Definition supply_screen_int.h:391
uint32_t baud
Definition supply_screen_int.h:356
float cv
Definition supply_screen_int.h:312
bool on_asked
Whether an ON this screen asked for is not yet seen applied.
Definition supply_screen_int.h:318
bool off_owed
Whether an OFF is owed for leaving the screen while a port held the supply.
Definition supply_screen_int.h:340
unsigned drawn_mask
Bit per frame buffer: its title and strip were drawn.
Definition supply_screen_int.h:366
uint8_t press_id
Definition supply_screen_int.h:394
uint32_t drawn_out[2]
Definition supply_screen_int.h:375
bool have_press
Definition supply_screen_int.h:395
bool model
Definition supply_screen_int.h:355
gfx_rect_t i_down
Definition supply_screen_int.h:386
bool out_reported
Definition supply_screen_int.h:363
uint32_t drawn_ov[2]
Definition supply_screen_int.h:377
uint32_t stops
Definition supply_screen_int.h:345
bool confirm_open
Definition supply_screen_int.h:341
bool held_kst
The KST programmer's word on the hold.
Definition supply_screen_int.h:328
uint32_t strip_rev
Definition supply_screen_int.h:298
uint8_t drawn_title[2]
Definition supply_screen_int.h:369
uint32_t set_rev
Definition supply_screen_int.h:372
uint32_t drawn_strip[2]
Definition supply_screen_int.h:299
supply_cmd_t pending
Definition supply_screen_int.h:364
uint32_t drawn_plot[2]
Definition supply_screen_int.h:368
ui_keypad_t kp
Definition supply_screen_int.h:388
ui_slider_t i_slider
Definition supply_screen_int.h:302
bool held_hitec
The Hitec programmer's word on the hold.
Definition supply_screen_int.h:330
bool on
Definition supply_screen_int.h:361
int kp_target
Definition supply_screen_int.h:389
int tx1
Definition supply_screen_int.h:357
gfx_rect_t discard_btn
Definition supply_screen_int.h:354
uint8_t drawn_save[2]
Definition supply_screen_int.h:378
ui_hold_t hold
Definition supply_screen_int.h:380
bool press_on
Whether OUTPUT's press began on a live output (an OFF tap).
Definition supply_screen_int.h:350
supply_state_t sup
Definition supply_screen_int.h:306
uint32_t ctrl_rev
Definition supply_screen_int.h:370
float pend_i
Definition supply_screen_int.h:352
uint32_t drawn_ctrl[2]
Definition supply_screen_int.h:371
gfx_rect_t reset_rect
Definition supply_screen_int.h:382
supply_caps_t caps
Definition supply_screen_int.h:303
gfx_rect_t modreset_btn
Definition supply_screen_int.h:383
float ci
Definition supply_screen_int.h:313
gfx_rect_t v_up
Definition supply_screen_int.h:385
float pend_v
Definition supply_screen_int.h:351
ui_plot_t plot
Definition supply_screen_int.h:296
What a supply can be set to.
Definition supply.h:32
Definition supply_screen.h:69
What the operator allows, on top of what the supply can do: caps on the set points,...
Definition supply.h:122
A supply's readings, set points, mode and trip state.
Definition supply.h:69
A DOWN, MOVE or UP of one contact.
Definition touch_types.h:69
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
Definition ui_slider.h:42
A row of tabs: their labels, where they are, which is selected and the press under way.
Definition ui_tabs.h:27
Definition ui_workbench.h:63
void sup_render(gfx_canvas_t *c, int buffer_index)
A frame: the chrome once per framebuffer, then each part on its own counter.
Definition supply_draw.c:632
void sup_event(const touch_event_t *evt)
Takes a touch event: presses, drags and releases on the screen's controls.
Definition supply_events.c:421
void sup_drop_press(void)
Drops the press as a lost release: a gesture asks for nothing, except a tap on OUTPUT OFF,...
Definition supply_events.c:369
void sup_tick(float dt_s)
Advances the screen by one frame: holds, repeats and the question about a live output.
Definition supply_events.c:544
bool sup_safe_at(int x, int y)
Returns whether (x, y) is on OUTPUT OFF, the one control here whose press stops what the bench drives...
Definition supply_events.c:416
sup_state_t sup_s
The supply screen's state, in supply_screen.c.
Definition supply_screen.c:44
gfx_rect_t sup_row_rect(int i)
SETTINGS' row i: its label and its value, in its column.
Definition supply_screen.c:181
void sup_owner_settle(void)
Clears the owner and any owed OFF once the output is off with no ON asked.
Definition supply_screen.c:322
gfx_rect_t sup_set_value_rect(int row)
A set point's value, at the right end of its controls: tapped, the keypad.
Definition supply_screen.c:123
void sup_refresh_limits(void)
Re-reads the operator's limits from the settings and narrows the caps.
Definition supply_screen.c:248
const ui_plot_series_t sup_series[S_COUNT]
The plot's five series: voltage, current, power, and the voltage and current set points.
Definition supply_screen.c:33
bool sup_on_live(void)
Returns whether the LIVE task shows.
Definition supply_screen.c:166
void sup_post_on(supply_by_t by)
Asks for the output ON, unless an OFF is pending or a programming port holds the supply.
Definition supply_screen.c:330
gfx_rect_t sup_card_rect(int i)
Returns the rectangle of reading card i on the rail.
Definition supply_screen.c:129
bool sup_confirm_needed(int from)
Returns whether a change waits for a confirmation: only while the output is on and as the operator's ...
Definition supply_screen.c:508
void sup_confirm_close(bool apply)
Closes the question, applying the pending change or dropping it.
Definition supply_screen.c:573
void sup_let_go(void)
Ends the press on a slider or key and lets the set points follow the supply.
Definition supply_screen.c:397
void sup_propose(int from)
Gives a set point change to the supply, or opens the question when one is needed.
Definition supply_screen.c:524
gfx_rect_t sup_strip_area(void)
The strip's row with its trough's 3px around it.
Definition supply_screen.c:139
void sup_bind_colours(void)
Sets the plot's series colours from the active theme.
Definition supply_screen.c:68
bool sup_confirm_stands(void)
Returns whether the question about a live output still stands: the output on or an ON on its way,...
Definition supply_screen.c:567
gfx_rect_t sup_overlay_area(void)
Returns the area the keypad, the question and SETTINGS' page take.
Definition supply_screen.c:171
gfx_rect_t sup_row_value_rect(int i)
The value of SETTINGS' row i, at the row's right end: tapped, the keypad or a switch's flip.
Definition supply_screen.c:195
void sup_post_off(void)
Asks for the output OFF.
Definition supply_screen.c:343
The SUPPLY screen: a programmable supply set, switched and watched.
supply_by_t
Definition supply_screen.h:46
#define SET_CTRL_H
Definition supply_screen_int.h:160
#define OV_CONFIRM_DY
Definition supply_screen_int.h:211
#define OUT_Y
Definition supply_screen_int.h:113
#define OV_HELP_PITCH
Definition supply_screen_int.h:206
#define SET_TEXT_H
Definition supply_screen_int.h:158
#define OV_HELP_DY
Definition supply_screen_int.h:210
#define SET_CTRL_DY
Definition supply_screen_int.h:159
#define SET_Y0
Definition supply_screen_int.h:157
#define SET_ROW_H
Definition supply_screen_int.h:156
#define OUT_H
Definition supply_screen_int.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.
#define UI_TAP_MIN
The smallest touch target for a control, in pixels: 48px, 7.2mm.
Definition ui_layout.h:71
A multi-series plot on one time base, with a scale per series.
A draggable value with presets: the throttle, and any other control that needs coarse reach and fine ...
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
A workbench's task strip: one device, its tasks as tabs under the band.