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

Blackbox field naming: which group a channel belongs to, and what it is measured in. More...

#include <stdbool.h>
#include "log_csv.h"

Go to the source code of this file.

Data Structures

struct  log_field_meta_t
 Group and unit of one channel. More...

Functions

log_field_meta_t log_field_meta (const char *name)
 Group and unit for a channel name.
int log_fields_picks (const log_analysis_t *an, int *out, int max)
 The columns LOGS plots in a file before the operator picks any.

Detailed Description

Blackbox field naming: which group a channel belongs to, and what it is measured in.

Every pattern is an anchored prefix or an exact name, so a table of prefixes is sufficient and no regular-expression engine is needed on the board.

A CSV (comma-separated values) file exported from a blackbox tool carries exactly these column names, so the grouping applies to it directly; anything else is grouped by unit, which keeps related channels together.

SPDX-License-Identifier: MIT

Function Documentation

◆ log_field_meta()

log_field_meta_t log_field_meta ( const char * name)

Group and unit for a channel name.

Never NULL; "Other"/"" when unknown.

Parameters
nameThe channel name.
Returns
The group and unit of the channel.

◆ log_fields_picks()

int log_fields_picks ( const log_analysis_t * an,
int * out,
int max )

The columns LOGS plots in a file before the operator picks any.

In a file with a numeric pulse column, a SERVO run's, its pulse, angle, current and voltage first, each where it is numeric; then, and in any other file, the first numeric columns in file order. Never the time axis, and no column twice.

Parameters
anThe file's analysis.
outReceives the column indices.
maxThe most columns to pick.
Returns
The number of columns picked; 0 with an or out NULL.