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

The log viewer's loading: a file the browse view opens is analysed (its delimiter, decimal convention and time column, see shared/logfile), its chosen columns are read, and lv_compute_spans() turns them into the plot's scaled traces; a report is read whole into the TEXT view. log_viewer_screen.c holds the state, the card's listing and paging and the screen's interface (log_viewer_screen.h); log_viewer_int.h is what the screen's four files share. More...

#include <math.h>
#include <stdio.h>
#include <string.h>
#include "log_fields.h"
#include "log_name.h"
#include "log_viewer_screen.h"
#include "settings.h"
#include "ui_screen.h"
#include "ui_text.h"
#include "log_viewer_int.h"

Functions

static const char * err_text (log_err_t err)
 The reader's verdict in the language showing; log_err_str() is the English the console logs.
void lv_say (ui_text_id_t id, const char *name)
 Keep id and name as the footer message (log_viewer_int.h).
void lv_say_err (log_err_t err)
 Keep err as the footer message (log_viewer_int.h).
void lv_quiet (void)
 Clear the footer message (log_viewer_int.h).
const char * lv_message (char *buf, size_t n)
 Word the footer message into buf (log_viewer_int.h).
const char * lv_delim_text (char delimiter)
 Returns a delimiter's name in the language showing.
static bool open_name (log_source_t *src)
 The open file again: from the mount its page was read from, or not at all, so a list read since from another card lends it no file.
void lv_run_analysis (void)
 Analyses the open file with the chosen delimiter and number convention, keeping the picked columns by name.
void lv_compute_spans (void)
 Reduces the window's samples to a minimum and maximum row per pixel column and series, and the series' ranges.
void lv_load_data (void)
 Loads the picked columns of the open file into the plot's samples.
static void open_text (void)
 Read the report s.name names into the TEXT view and show it.
void lv_open_selected (void)
 Opens the selected row: a CSV file to the import view, a report to the TEXT view; a folder or an oversized file is refused with a message.

Detailed Description

The log viewer's loading: a file the browse view opens is analysed (its delimiter, decimal convention and time column, see shared/logfile), its chosen columns are read, and lv_compute_spans() turns them into the plot's scaled traces; a report is read whole into the TEXT view. log_viewer_screen.c holds the state, the card's listing and paging and the screen's interface (log_viewer_screen.h); log_viewer_int.h is what the screen's four files share.

SPDX-License-Identifier: MIT

Function Documentation

◆ err_text()

const char * err_text ( log_err_t err)
static

The reader's verdict in the language showing; log_err_str() is the English the console logs.

Parameters
errthe verdict
Returns
the words, from the text table

◆ lv_delim_text()

const char * lv_delim_text ( char delimiter)

Returns a delimiter's name in the language showing.

Parameters
delimiter';', ',', tab or '|'
Returns
the name, "?" for any other

◆ lv_message()

const char * lv_message ( char * buf,
size_t n )

Word the footer message into buf (log_viewer_int.h).

The footer message in the language showing.

Word the footer message into buf (log_viewer_int.h).

Parameters
buftakes the message; never NULL
nbytes at buf, 1 or more, LV_MSG_MAX for the longest
Returns
buf, "" for no message

◆ lv_quiet()

void lv_quiet ( void )

Clear the footer message (log_viewer_int.h).

The footer message says nothing.

Clear the footer message (log_viewer_int.h).

◆ lv_say()

void lv_say ( ui_text_id_t id,
const char * name )

Keep id and name as the footer message (log_viewer_int.h).

The footer message says id, a refusal or a failure.

Keep id and name as the footer message (log_viewer_int.h).

The message keeps the ID and the name, and lv_message() words it in the language showing, so a change of SET_LANGUAGE rewords it.

Parameters
idthe text: LOG_CANNOT_OPEN, LOG_IS_FOLDER, LOG_TOO_BIG, LOG_CANNOT_DELETE and LOG_DELETED format name; any other is shown as it is
namethe file's name, or NULL

◆ lv_say_err()

void lv_say_err ( log_err_t err)

Keep err as the footer message (log_viewer_int.h).

The footer message says the reader's verdict err, a failure.

Keep err as the footer message (log_viewer_int.h).

Parameters
errthe verdict of log_csv_analyse(), log_csv_build() or log_text_load()

◆ open_text()

void open_text ( void )
static

Read the report s.name names into the TEXT view and show it.

The file is read once, whole, up to LOG_TEXT_MAX bytes; a file the I/O does not open, or one that fails to read, stays on the list with the reason in the footer.