|
| #define | W UI_PANEL_W |
| #define | H UI_BODY_H |
| #define | PAD UI_MARGIN |
|
#define | TAB_X (PAD + 3) |
| | The pane tabs, BALANCE | TEST RIG | AIRCRAFT: three tabs of 150 x 48px, 4px apart, from x 11 and y 8, a finger tall.
|
| #define | TAB_Y 8 |
| #define | TAB_H UI_TAP_MIN |
| #define | TAB_ROW_W (3 * 150 + 2 * 4) |
| #define | CARD_Y 64 |
|
#define | TEXT_FLOOR (UI_ALERT_Y - UI_BAND_H - 4) |
| | The lowest row a control or a line of text may reach: 4px above the alert band, body y 492.
|
|
#define | LCARD_W 640 |
| | The rotor's card: 640px, the right card 360.
|
| #define | RCARD_X (PAD + LCARD_W + 8) |
| #define | RCARD_W (W - RCARD_X - PAD) |
| #define | CARD_H (H - PAD - CARD_Y) |
| #define | RC_X (RCARD_X + 14) |
| #define | RC_W (RCARD_W - 28) |
|
#define | BL_FONT_LABEL (&gfx_font_10x20) |
| | The faces of the 1024 x 600 type scale this screen draws in: BL_FONT_LABEL (10 x 20) for labels, buttons, rows, callouts and the rules' heads, BL_FONT_FINE (8 x 16) for the notes and the rules' two lines, which the 33 cells of the 10 x 20 face in the right column do not hold.
|
| #define | BL_FONT_FINE UI_FONT_FINE |
| #define | ROTOR_Y (CARD_Y + 38) |
| #define | ROTOR_H UI_TAP_MIN |
| #define | BLADES_Y (ROTOR_Y + ROTOR_H + 10) |
| #define | STEP_W 56 |
| #define | STEP_H UI_TAP_MIN |
| #define | READ_Y (BLADES_Y + STEP_H + 18) |
| #define | READ_H 36 |
| #define | MARK_Y (READ_Y + 4 * READ_H + 8) |
| | The SIMULATED pill under the readings, 20px high.
|
| #define | NOTE_Y (MARK_Y + 38) |
|
#define | RULE_Y0 (CARD_Y + 40) |
| | The rules' first row, TEST RIG and AIRCRAFT, px: y 104.
|
| #define | RULE_PITCH 64 |
| #define | FIG_X ((LCARD_W - 450) / 2) |
| #define | FIG_Y (CARD_Y - 40) |
|
#define | KP_Y CARD_Y |
| | The keypad's top, px.
|
|
#define | KP_H (TEXT_FLOOR - KP_Y) |
| | The keypad's height, px: 428.
|
|
#define | BLADES_MIN 2 |
| | The fewest blades the count takes.
|
|
#define | BLADES_MAX 6 |
| | The most blades the count takes.
|
|
#define | BASE_Y 356 |
|
#define | POST_X 150 |
|
#define | POST_W 40 |
|
#define | ARM_Y 196 |
|
#define | ARM_H 28 |
|
#define | MOTOR_X 300 |
|
#define | MOTOR_W 62 |
|
#define | SHAFT_Y 210 |
|
#define | SPIN_X 406 |
|
#define | BLADE_L 92 |
| #define | DISC_CX (PAD + LCARD_W / 2) |
| #define | DISC_CY ((CARD_Y + TEXT_FLOOR) / 2) |
|
#define | DISC_R 160 |
| | The disc's radius, px: a ducted fan's numbers at DISC_R + 38 and 10px tall end inside the card and above the alert band.
|
| #define | HUB_R 32 |
|
#define | RIG_RULES ((int)(sizeof(k_rig_rules) / sizeof(k_rig_rules[0]))) |
|
#define | AIR_RULES 6 |
|
| void | balance_invalidate (void) |
|
static void | reset (void) |
| | The screen's state cleared: the BALANCE pane, two blades, a propeller, the controls laid out and the keypad closed.
|
| int | balance_screen_blades (void) |
| int | balance_screen_rotor (void) |
| const ui_keypad_t * | balance_screen_keypad (void) |
| | The keypad a tap on the blade count opens over both cards, for tests and the renderer.
|
| gfx_rect_t | balance_screen_blades_rect (void) |
| | Where the blade count is drawn and tapped, in the screen's coordinates: between BLADES and the "-" key.
|
|
static void | kp_follow (void) |
| | The keypad's revision moved: the frame draws it again.
|
| static void | kp_event (const touch_event_t *evt) |
| | One event while the keypad is open: it takes them all. OK sets the count; the keypad holds it to 2 to 6.
|
|
static void | kp_close (void) |
| | The keypad closes, with nothing typed taken: the home tag over it and leaving the screen.
|
| static bool | back (void) |
| | The home tag: over the keypad it is CANCEL.
|
|
static void | leave (void) |
| | The screen is left: the keypad closes, with nothing typed taken.
|
|
static float | balance_screen_angle (void) |
| const char * | balance_screen_model_mark (void) |
| const char * | balance_screen_model_note (void) |
| static void | event (const touch_event_t *evt) |
| | One touch event: the tabs first, then the keypad while it is open, then the BALANCE pane's controls. The rotor buttons and the count's "-" and "+" act on the press; the count opens its keypad on the release of a tap on it.
|
|
static void | callout (gfx_canvas_t *c, int px, int py, int lx, int ly, const char *text, gfx_color_t ink) |
| static int | left_of (int lx, int right, int gap, const char *text) |
| | Where a callout's label starts so that it ends gap px left of right, or at lx where it already does.
|
|
static void | draw_rig (gfx_canvas_t *c) |
|
static void | draw_aircraft (gfx_canvas_t *c) |
|
static void | disc_at (float deg, int r, int *x, int *y) |
|
static void | draw_measure (gfx_canvas_t *c) |
| void | balance_nearest_blades (float angle, int blades, int *lo, int *hi) |
| static void | draw_readings (gfx_canvas_t *c) |
| | The BALANCE pane's right column: ROTOR, BLADES, the four readings, the SIMULATED pill and the note.
|
| static void | draw_rules (gfx_canvas_t *c, const rule_t *rules, int count) |
| | TEST RIG's or AIRCRAFT's right column: COMMON MISTAKES and the numbered rules, each its head over its two lines.
|
| static void | render (gfx_canvas_t *c, int buffer_index) |
| | The screen drawn on a revision not yet drawn: the tabs, then the keypad alone while it is open, else both cards of the pane.
|
| static void | cancel (void) |
| | The panel could not hand over every touch event, so this screen's record of the glass is stale.
|
|
const ui_screen_t * | balance_screen (void) |
The balance screen: sensor placement guides and the correction readout.
A balance answer is a magnitude and an angle, both derived from two sensors whose placement decides whether the answer is valid. A vibration sensor on a compliant mount reads a filtered version of the bearing's motion; an index mark on a blade instead of the bell gives one pulse per blade and an angle wrong by a blade spacing. Neither error is visible on screen, so the screen carries the placement diagrams.
The blade count takes 2 to 6 from its "-" and "+" keys, which step on the press, or from the keypad a tap on the count opens over both cards. A tab tapped while the keypad is open closes it, the count as it was.
SPDX-License-Identifier: MIT