|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The automatic servo test's TXT report, line by line. More...
Data Structures | |
| struct | cursor_t |
| Cursor that prints one report line, found by counting. More... | |
Macros | |
| #define | S(id) |
| A word or a line format of the report, in the run's language. | |
| #define | CELL_MAX_A 99.999f |
| The largest magnitude a step table cell prints, A: "-99999" mA is its widest text, 6 cells. No meter reads near it: the INA3221 reads to 32.760A on its smallest shunt. | |
Functions | |
| static bool | here (cursor_t *c) |
| Count one line, and tell whether it is the one asked for. | |
| static void | limit_a (const cursor_t *c, char *b, size_t n, float a) |
| A limit's value, or OFF for 0. | |
| static const char * | verdict_word (const cursor_t *c, bool checked, bool measured, bool over) |
| The word for one check: NOT CHECKED, NOT MEASURED, FAIL or PASS. | |
| static void | ma_text (char *b, size_t n, float a) |
| A current in whole mA, or "--" for none. | |
| static void | amps (char *b, size_t n, const servo_test_mean_t *m) |
| A mean in whole mA, or "--" for none. | |
| static void | brownout_ran (const servo_test_t *t, const servo_test_step_t **first, const servo_test_step_t **last) |
| The first and the last brown-out voltage that ran to its end; NULL for none. | |
| static bool | header_lines (const servo_test_t *t, cursor_t *c) |
| The head of the report: title, result, device and firmware, the meter and supply, the readings' rates, the counts, the duration and the rows. | |
| static bool | settings_lines (const servo_test_t *t, cursor_t *c) |
| The settings lines: the servo, the rate, the danger tag, HV, the ends, the steps, the brown-out walk, the current limit, the timing, the length and the limits. | |
| static bool | step_unseen (const servo_test_step_t *s) |
| Whether none of a step's counted moves showed movement: the step is not measurable. | |
| static void | step_row (const cursor_t *c, const servo_test_step_t *s) |
| One step's line of the steps table, 92 cells at most: the columns end where the two heading lines end their words. | |
| static bool | step_lines (const servo_test_t *t, cursor_t *c) |
| The steps table: two heading lines, one line per characterisation step and, under a step cut short or not measurable, a line that says so; then the column notes and the threshold, arrival and late rules. | |
| static void | deg_end (const servo_test_t *t, const servo_test_step_t *s, unsigned end, char *b, char *eb, size_t n) |
A step's mean end angle at end and its error against the commanded one, both on the circle (servo_test_enc_end()), signed, or "--" for none. | |
| static bool | encoder_lines (const servo_test_t *t, cursor_t *c) |
| The encoder lines: one line per characterisation step with its end angles, then the counts and the rules. Nothing when the encoder is off. | |
| static bool | brownout_lines (const servo_test_t *t, cursor_t *c) |
| The brown-out lines: the walk's result, then the threshold rule. | |
| static void | stall_line (const cursor_t *c, const servo_test_cfg_t *g, bool by_limit) |
| STALL AT against the current limit, or against the meter's range. | |
| bool | servo_test_stall_note (const servo_test_cfg_t *cfg, char *buf, size_t n) |
The line that says STALL AT cannot be reached in a run of cfg, in the language of cfg->text, into buf: against the current limit where that is the reason, else against the meter's range (servo_test_stall_unreachable()). False, and buf empty, when a reading can pass STALL AT. | |
| static bool | limit_lines (const servo_test_t *t, cursor_t *c) |
| The limits lines: the idle, hold, travel, stall, late and unseen checks against their limits, and the first brown-out voltage. | |
| static bool | unmeasured_lines (const servo_test_t *t, cursor_t *c) |
| The unmeasured notes: the heading and the lines that say what the run did not measure. | |
| bool | servo_report_line (const servo_test_t *t, unsigned idx, char *buf, size_t n) |
Line idx of the report into buf, in the language of t->cfg.text; false past the last. | |
The automatic servo test's TXT report, line by line.
The lines come in sections, in this order: header, settings, steps, encoder, brown-out, limits and unmeasured notes; servo_report_line() picks one line by its index.
Its words are entries of servo_str.c's table, looked up in the language of the table the run was started with (S() below). A report is UTF-8, as the table's strings are.
SPDX-License-Identifier: MIT
| #define S | ( | id | ) |
A word or a line format of the report, in the run's language.
|
static |
A mean in whole mA, or "--" for none.
| b | Out: the mean in whole mA, or "--". |
| n | Size of b, bytes. |
| m | Mean to print; no reading gives "--". |
|
static |
The brown-out lines: the walk's result, then the threshold rule.
| t | Run state. |
| c | Cursor. |
|
static |
The first and the last brown-out voltage that ran to its end; NULL for none.
| t | Run state. |
| first | Out: the first such step, or NULL for none. NULL to skip. |
| last | Out: the last such step, or NULL for none. NULL to skip. |
|
static |
A step's mean end angle at end and its error against the commanded one, both on the circle (servo_test_enc_end()), signed, or "--" for none.
| t | Run state. |
| s | Step. |
| end | 0 for the low end, 1 for the high end. |
| b | Out: the mean angle, degrees, or "--" for none. |
| eb | Out: the error, degrees, or "--" for none. |
| n | Size of b and eb, bytes. |
|
static |
The encoder lines: one line per characterisation step with its end angles, then the counts and the rules. Nothing when the encoder is off.
| t | Run state. |
| c | Cursor. |
|
static |
The head of the report: title, result, device and firmware, the meter and supply, the readings' rates, the counts, the duration and the rows.
| t | Run state. |
| c | Cursor. |
|
static |
Count one line, and tell whether it is the one asked for.
| c | Cursor. Its count goes up whether or not this is the line. |
|
static |
A limit's value, or OFF for 0.
| c | Cursor; its text gives the language of OFF. |
| b | Out: the text. |
| n | Size of b, bytes. |
| a | Limit, A; 0 or less is OFF. |
|
static |
The limits lines: the idle, hold, travel, stall, late and unseen checks against their limits, and the first brown-out voltage.
| t | Run state. |
| c | Cursor. |
|
static |
A current in whole mA, or "--" for none.
| b | Out: the current in whole mA, at most 6 cells, or "--". |
| n | Size of b, bytes. |
| a | Current, A; one not a number or beyond CELL_MAX_A gives "--". |
| bool servo_report_line | ( | const servo_test_t * | t, |
| unsigned | idx, | ||
| char * | buf, | ||
| size_t | n ) |
Line idx of the report into buf, in the language of t->cfg.text; false past the last.
| t | Run state. |
| idx | Index of the line asked for. |
| buf | Out: the line. NULL is refused. |
| n | Size of buf, bytes; 0 is refused. |
idx exists and was written into buf; false past the last line, or for a NULL argument or n of 0. | bool servo_test_stall_note | ( | const servo_test_cfg_t * | cfg, |
| char * | buf, | ||
| size_t | n ) |
The line that says STALL AT cannot be reached in a run of cfg, in the language of cfg->text, into buf: against the current limit where that is the reason, else against the meter's range (servo_test_stall_unreachable()). False, and buf empty, when a reading can pass STALL AT.
| cfg | Configuration of the run. |
| buf | Out: the line. |
| n | Size of buf, bytes. |
|
static |
The settings lines: the servo, the rate, the danger tag, HV, the ends, the steps, the brown-out walk, the current limit, the timing, the length and the limits.
| t | Run state. |
| c | Cursor. |
|
static |
STALL AT against the current limit, or against the meter's range.
| c | Cursor; buf receives the line. |
| g | Configuration of the run. |
| by_limit | true for the current limit, false for the meter's range. |
|
static |
The steps table: two heading lines, one line per characterisation step and, under a step cut short or not measurable, a line that says so; then the column notes and the threshold, arrival and late rules.
| t | Run state. |
| c | Cursor. |
|
static |
One step's line of the steps table, 92 cells at most: the columns end where the two heading lines end their words.
Voltages take 5 cells, currents 6 (whole mA, "-99999" the widest, see ma_text()), the travel times 6 and 7 and the counts 5, 4 and 6, one space between columns. A count is at most SERVO_TEST_MOVES_MAX.
| c | Cursor; buf receives the line. |
| s | A step that began. |
|
static |
Whether none of a step's counted moves showed movement: the step is not measurable.
| s | Step. |
|
static |
The unmeasured notes: the heading and the lines that say what the run did not measure.
| t | Run state. |
| c | Cursor. |
|
static |
The word for one check: NOT CHECKED, NOT MEASURED, FAIL or PASS.
| c | Cursor; its text gives the language. |
| checked | true when the check has a limit. |
| measured | true when a value was measured. |
| over | true when the value is over the limit. |