|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
ESC STICK's profile list. More...
#include "esc_stick_panel.h"#include <limits.h>#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "esc_profile.h"#include "settings.h"#include "supply_screen.h"#include "ui_text.h"#include "ui_theme.h"#include "ui_widgets.h"#include "esc_stick_panel_int.h"Data Structures | |
| struct | [struct].k_why |
Functions | |
| void | sp_text (gfx_canvas_t *c, int x, int y, const char *text, int max_chars, gfx_color_t ink) |
text at (x, y) cut to max_chars, with ".." in place of what did not fit. | |
| int | esc_stick_panel_wrap_lines (const char *text, int cells) |
| const char * | esc_stick_panel_step_text (const esc_manual_t *m) |
| const char * | sp_action (const esc_manual_t *m) |
| What a manual step asks, in the language showing. | |
| const char * | sp_when_text (const esc_manual_t *m) |
| When a manual step is due, in the language showing. | |
| const char * | esc_stick_panel_why_text (const char *why) |
| const char * | sp_why_text (const char *why) |
The engine's reason why in the language showing. | |
| const char * | sp_rating_why (const esc_profile_t *p, int model, uint32_t mv, uint32_t ma, bool by_hand, bool longer, char *buf, size_t n) |
What the supply's set points break of a model's ratings, into buf, or NULL: the short form for a row, longer for the page's note. | |
| const char * | sp_rating_warn (const esc_profile_t *p, int model, uint32_t mv, bool by_hand, bool longer, char *buf, size_t n) |
The warning for a voltage the data cannot vouch for, into buf, or NULL; the run goes ahead. | |
| const char * | sp_model_warn (const esc_profile_t *p, int model, char *buf, size_t n) |
sp_rating_warn() for model model with the settings now. | |
| const char * | sp_model_why (const esc_profile_t *p, int model, char *buf, size_t n) |
Why model model cannot run, into buf, or NULL when it can. | |
| uint32_t | sp_list_key (void) |
| VOLTAGE and the SUPPLY cap, mV: what decides from outside a profile whether it runs. | |
| static int | sp_casecmp (const char *a, const char *b) |
a against b with the letters A to Z folded, as the search folds them: the makers' order and their grouping. | |
| bool | sp_model_runs (const esc_profile_t *p, int model) |
Whether model model of p runs on this bench. | |
| static void | sp_build_makers (stick_t *t) |
| The first level: every maker, alphabetical with case folded, that the search finds a model of (esc_model_matches(); every one while it is empty), with its models, those found and those of them that run. A card profile joins its maker as a built-in one does. | |
| static int | sp_key_cmp (uint32_t a, uint32_t b) |
| One key of the models' order: smaller first, 0 – not stated – last. | |
| static int | sp_by_model (const void *a, const void *b) |
| Current, then voltage, then name with case folded; a key a model does not state sorts it last on that key. Ties keep the registry's order. | |
| static void | sp_build_models (stick_t *t) |
| The second level: the open maker's models the search finds, one row a model, by current, voltage and name; each row is its family's profile. The registry holds a maker to ESC_MAKER_MODELS_MAX, SP_MODELS, so every one of them has a row. | |
| void | sp_build_list (bool keep_scroll) |
The level showing built again, from the top or, with keep_scroll, where it was. | |
| void | sp_pick_profile (const esc_profile_t *p) |
Profile p picked: its picks cleared, and its manual steps shown the first time it is opened. | |
| int | sp_items (void) |
| The items the page offers. | |
| int | sp_item_at (int at) |
The profile's index of the at-th item offered, or -1. | |
| void | sp_pick_shown (void) |
| The picked item kept among those shown; the first otherwise. | |
Variables | |
| static const struct | k_why [] |
| The stick engine's refusals, English, held where the engine writes them (esc_stick.c), each with the text the screen shows in the language showing. A refusal the table does not know shows as the engine wrote it. | |
ESC STICK's profile list.
ESC STICK's profile list: the texts a row and a page are drawn from, why a profile cannot run on this bench, the makers and the models built from the profiles and the search, and the profile picked. The state and the seam are esc_stick_panel_int.h.
SPDX-License-Identifier: MIT
| const char * esc_stick_panel_step_text | ( | const esc_manual_t * | m | ) |
A manual step's text in the language showing: its action_de where the profile gives one and German shows, else its English action.
| const char * esc_stick_panel_why_text | ( | const char * | why | ) |
A refusal of the stick engine (esc_stick_kind(), esc_stick_check(), esc_stick_start()) in the language showing, found by the engine's words; one the screen does not know comes back as given, and NULL as "refused".
| int esc_stick_panel_wrap_lines | ( | const char * | text, |
| int | cells ) |
The lines text takes broken as the screen breaks it, in lines of cells, one cell at least; for tests.
| const char * sp_action | ( | const esc_manual_t * | m | ) |
What a manual step asks, in the language showing.
| m | the manual step |
| void sp_build_list | ( | bool | keep_scroll | ) |
The level showing built again, from the top or, with keep_scroll, where it was.
| keep_scroll | true to keep the scroll position |
| int sp_item_at | ( | int | at | ) |
The profile's index of the at-th item offered, or -1.
| at | the position among the items offered |
| int sp_items | ( | void | ) |
The items the page offers.
| uint32_t sp_list_key | ( | void | ) |
VOLTAGE and the SUPPLY cap, mV: what decides from outside a profile whether it runs.
| bool sp_model_runs | ( | const esc_profile_t * | p, |
| int | model ) |
Whether model model of p runs on this bench.
| p | the profile |
| model | the model's index in p |
| const char * sp_model_warn | ( | const esc_profile_t * | p, |
| int | model, | ||
| char * | buf, | ||
| size_t | n ) |
sp_rating_warn() for model model with the settings now.
| p | the profile |
| model | the model's index in p |
| buf | the buffer the text is written to |
| n | the size of buf, bytes |
buf, or NULL when there is no warning | const char * sp_model_why | ( | const esc_profile_t * | p, |
| int | model, | ||
| char * | buf, | ||
| size_t | n ) |
Why model model cannot run, into buf, or NULL when it can.
| p | the profile |
| model | the model's index in p |
| buf | the buffer the text is written to |
| n | the size of buf, bytes |
buf, or NULL when the model can run | void sp_pick_profile | ( | const esc_profile_t * | p | ) |
Profile p picked: its picks cleared, and its manual steps shown the first time it is opened.
| p | the profile |
| const char * sp_rating_warn | ( | const esc_profile_t * | p, |
| int | model, | ||
| uint32_t | mv, | ||
| bool | by_hand, | ||
| bool | longer, | ||
| char * | buf, | ||
| size_t | n ) |
The warning for a voltage the data cannot vouch for, into buf, or NULL; the run goes ahead.
| p | the profile |
| model | the model's index in p |
| mv | the supply voltage, mV |
| by_hand | whether the model is run by hand |
| longer | true for the page's note, false for a row's short form |
| buf | the buffer the text is written to |
| n | the size of buf, bytes |
buf, or NULL when there is no warning | const char * sp_rating_why | ( | const esc_profile_t * | p, |
| int | model, | ||
| uint32_t | mv, | ||
| uint32_t | ma, | ||
| bool | by_hand, | ||
| bool | longer, | ||
| char * | buf, | ||
| size_t | n ) |
What the supply's set points break of a model's ratings, into buf, or NULL: the short form for a row, longer for the page's note.
| p | the profile |
| model | the model's index in p |
| mv | the supply voltage, mV |
| ma | the supply current limit, mA |
| by_hand | whether the model is run by hand |
| longer | true for the page's note, false for a row's short form |
| buf | the buffer the text is written to |
| n | the size of buf, bytes |
buf, or NULL when the set points break nothing | void sp_text | ( | gfx_canvas_t * | c, |
| int | x, | ||
| int | y, | ||
| const char * | text, | ||
| int | max_chars, | ||
| gfx_color_t | ink ) |
text at (x, y) cut to max_chars, with ".." in place of what did not fit.
| c | the canvas |
| x | the left edge, px |
| y | the top edge, px |
| text | the text to draw |
| max_chars | the most characters to draw |
| ink | the text colour |
| const char * sp_when_text | ( | const esc_manual_t * | m | ) |
When a manual step is due, in the language showing.
| m | the manual step |
| const char * sp_why_text | ( | const char * | why | ) |
The engine's reason why in the language showing.
| why | the engine's reason |