rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
servo_str.c File Reference

The automatic servo test's words: the CSV header, the phase and abort names, and the line formats of the TXT report (servo_report.c). More...

#include "servo_str.h"
#include "servo_test.h"
#include <stddef.h>

Macros

#define CSV_BASE
#define CSV_ENC   ";angle (deg);travel angle (ms)"
#define CSV_METER

Enumerations

enum  { k_str_entries = 0 }
 The count of UI_SERVO_TEXT entries in ui_text.def.

Functions

const char * servo_str_in (const char *const *table, servo_str_t id)
const char * servo_str (servo_str_t id)
servo_str_t servo_test_phase_str (servo_test_phase_t ph)
 The entries the names below come from, for a caller with its own table.
servo_str_t servo_test_abort_str (servo_test_abort_t why)
 Table entry for an abort reason.
servo_str_t servo_test_verdict_str (servo_test_verdict_t v)
 Table entry for a verdict.
static servo_str_t servo_test_start_str (servo_test_start_t why)
const char * servo_test_phase_name (servo_test_phase_t ph)
 English name of a phase.
const char * servo_test_abort_name (servo_test_abort_t why)
 English name of an abort reason.
const char * servo_test_verdict_name (servo_test_verdict_t v)
 English name of a verdict.
const char * servo_test_start_name (servo_test_start_t why)
 English name of a start refusal.
const char * servo_test_csv_header (void)
 The CSV's header row: the 13 columns of every run, then the meter's six – meter, window, current max, current min, voltage min, clipped.
const char * servo_test_csv_header_enc (void)
 And with the encoder's two columns, angle_deg and travel_angle_ms, between the two groups.
const char * servo_test_meter_word (uint8_t kind)
 The word a row's meter column carries: INA3221, PDMINI or MODEL.

Variables

static const char *const k_str [SERVO_STR_COUNT]
 The servo test's words in English, from ui_text.def.

Detailed Description

The automatic servo test's words: the CSV header, the phase and abort names, and the line formats of the TXT report (servo_report.c).

Every string the run writes or the SERVO screen shows about it is an entry of ui_text.def (shared/text), with its English and its German; k_str is the English column, and ui_text.c makes the other languages' tables of the same entries. The report is written in the language of the table the run was started with, and the CSV always in English, because tools read it by its words. A report is UTF-8, as the table's strings are.

SPDX-License-Identifier: MIT

Macro Definition Documentation

◆ CSV_BASE

#define CSV_BASE
Value:
"time (s);test;step;phase;command (us);position (us);" \
"set (V);voltage (V);limit (A);current (A);power (W);" \
"mode;travel (ms)"

◆ CSV_METER

#define CSV_METER
Value:
";meter;window;current max (A);current min (A);" \
"voltage min (V);clipped"

Function Documentation

◆ servo_str()

const char * servo_str ( servo_str_t id)

The English text of id; "" for one out of range.

◆ servo_str_in()

const char * servo_str_in ( const char *const * table,
servo_str_t id )

id from table, or the English where table is NULL or holds none; "" for one out of range.

◆ servo_test_abort_name()

const char * servo_test_abort_name ( servo_test_abort_t why)

English name of an abort reason.

Parameters
whyAbort reason to name.
Returns
name of the reason.

◆ servo_test_abort_str()

servo_str_t servo_test_abort_str ( servo_test_abort_t why)

Table entry for an abort reason.

Parameters
whyAbort reason to name.
Returns
table entry for the reason.

◆ servo_test_csv_header()

const char * servo_test_csv_header ( void )

The CSV's header row: the 13 columns of every run, then the meter's six – meter, window, current max, current min, voltage min, clipped.

Returns
header row of the CSV without the encoder columns.

◆ servo_test_csv_header_enc()

const char * servo_test_csv_header_enc ( void )

And with the encoder's two columns, angle_deg and travel_angle_ms, between the two groups.

Returns
header row of the CSV with the encoder columns.

◆ servo_test_meter_word()

const char * servo_test_meter_word ( uint8_t kind)

The word a row's meter column carries: INA3221, PDMINI or MODEL.

Parameters
kindMeter kind, servo_test_meter_kind_t.
Returns
word for the meter column: INA3221, PDMINI or MODEL.

◆ servo_test_phase_name()

const char * servo_test_phase_name ( servo_test_phase_t ph)

English name of a phase.

Parameters
phPhase to name.
Returns
name of the phase.

◆ servo_test_phase_str()

servo_str_t servo_test_phase_str ( servo_test_phase_t ph)

The entries the names below come from, for a caller with its own table.

Parameters
phPhase to name.
Returns
table entry for the phase.

◆ servo_test_start_name()

const char * servo_test_start_name ( servo_test_start_t why)

English name of a start refusal.

Parameters
whyRefusal to name.
Returns
name of the refusal.

◆ servo_test_verdict_name()

const char * servo_test_verdict_name ( servo_test_verdict_t v)

English name of a verdict.

Parameters
vVerdict to name.
Returns
name of the verdict.

◆ servo_test_verdict_str()

servo_str_t servo_test_verdict_str ( servo_test_verdict_t v)

Table entry for a verdict.

Parameters
vVerdict to name.
Returns
table entry for the verdict.

Variable Documentation

◆ k_str

const char* const k_str[SERVO_STR_COUNT]
static
Initial value:
= {
}

The servo test's words in English, from ui_text.def.