|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
Which of a card's entries a bounded list keeps, and the order it draws them in. More...
Go to the source code of this file.
Data Structures | |
| struct | log_select_page_t |
| One page being chosen while a directory is read. Filled by log_select_page_begin(); the fields are the walk's, not the caller's. Not copied while a walk runs: its page keeping points at its own key. More... | |
Functions | |
| int | log_select_keep (log_viewer_file_t *set, int count, int capacity, const log_viewer_file_t *cand) |
Offer cand to a set in log_name_rank() order. | |
| void | log_select_page_begin (log_select_page_t *sel, log_viewer_file_t *set, int capacity, const log_viewer_page_t *page) |
Start choosing page into set. | |
| void | log_select_page_offer (log_select_page_t *sel, const log_viewer_file_t *cand) |
| Offer one directory entry; it is copied if it is kept. | |
| int | log_select_page_end (log_select_page_t *sel, log_viewer_page_t *page) |
End the walk: put the set into the order the browse list draws (log_select_sort()) and write page's ahead and held. | |
| void | log_select_sort (log_viewer_file_t *set, int count) |
Put count entries into the order the browse list draws them in: directories first, then log_name_rank() order – runs newest first, then the other names, case-insensitively. | |
| bool | log_select_lists (const char *name) |
| Whether the list holds a file of this name: a CSV file, or a report. | |
Which of a card's entries a bounded list keeps, and the order it draws them in.
The browse list holds a page of LOG_VIEWER_MAX_FILES entries and a card takes up to LOG_RUN_LAST runs, so a listing of a full card is a choice. Making that choice by where the directory read stopped hides every run written after the card passed that many files – usually the newest experiments.
Entries are offered one at a time, in whatever order the volume hands them over. log_select_keep() holds the LOG_VIEWER_MAX_FILES that log_name_rank() puts first; log_select_page_*() hold one page of that order, the one a log_viewer_page_t names, and count where it starts. Memory is the page and nothing more: one walk of the directory per page, whatever the card holds. Ordering for display is a separate pass, run once the directory has been read to its end: directories first, then log_name_rank() order, so the rows of a page run the same way as the pages, newest run at the top.
The page keeping is the file manager's (fm_select.h) with log_name_rank() as its order; the file manager's panes keep theirs in name order.
Paging needs log_name_rank() to be a strict order: zero only for the same file. Two names that tie fall on the key's side of every page edge, and one of them is shown on no page.
Pure C, no ESP-IDF (Espressif Internet-of-Things Development Framework).
SPDX-License-Identifier: MIT
| int log_select_keep | ( | log_viewer_file_t * | set, |
| int | count, | ||
| int | capacity, | ||
| const log_viewer_file_t * | cand ) |
Offer cand to a set in log_name_rank() order.
The count is the same one that came back from the last call, so a set never drifts past its capacity. A candidate that ranks below a full set is dropped and the count does not move.
| set | the entries, in log_name_rank() order |
| count | entries in set |
| capacity | room in set |
| cand | the entry offered; copied when it is kept |
| bool log_select_lists | ( | const char * | name | ) |
Whether the list holds a file of this name: a CSV file, or a report.
A report is a name log_report_number() takes, the same rule FILES labels a report by (fm_kind_of()): ATESTnnn.TXT beside its ATESTnnn.CSV or without it, LIMITnnn.TXT, which a LIMIT RUN writes with no CSV, and the SERVOnnn.TXT of firmware 0.21.0 and older. A run and its report are two rows, the run first (log_name_rank()); OPEN reads the CSV into the import and the report as text, and DELETE on the run takes its report along. Any other ".TXT" is not listed. One walk of a folder decides it name by name.
| name | a file's name in the folder; NULL is none |
| void log_select_page_begin | ( | log_select_page_t * | sel, |
| log_viewer_file_t * | set, | ||
| int | capacity, | ||
| const log_viewer_page_t * | page ) |
Start choosing page into set.
The key is copied, so page may change while the walk runs.
| sel | the walk's state |
| set | room for capacity entries |
| capacity | entries set takes |
| page | which page; NULL for the first |
| int log_select_page_end | ( | log_select_page_t * | sel, |
| log_viewer_page_t * | page ) |
End the walk: put the set into the order the browse list draws (log_select_sort()) and write page's ahead and held.
| sel | the walk's state |
| page | takes ahead and held; may be NULL |
| void log_select_page_offer | ( | log_select_page_t * | sel, |
| const log_viewer_file_t * | cand ) |
Offer one directory entry; it is copied if it is kept.
| sel | the walk's state |
| cand | the entry |
| void log_select_sort | ( | log_viewer_file_t * | set, |
| int | count ) |
Put count entries into the order the browse list draws them in: directories first, then log_name_rank() order – runs newest first, then the other names, case-insensitively.
| set | the entries |
| count | how many |