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

The SERVO screen's limit run: its checks, its steps, the programmer's sessions it asks for, and its box, card and note. More...

#include <math.h>
#include <stdio.h>
#include <string.h>
#include "kst_panel.h"
#include "prog_registry.h"
#include "kst_port.h"
#include "log_name.h"
#include "rcbench_version.h"
#include "sensors_rows.h"
#include "servo_limrun.h"
#include "settings.h"
#include "settings_sensors.h"
#include "supply_screen.h"
#include "ui_text.h"
#include "ui_theme.h"
#include "ui_value_gate.h"
#include "ui_widgets.h"
#include "servo_screen_int.h"

Macros

#define LIM_LINE_DY   (RUN_BTN_DY + RUN_BTN_H + 2)
 The LIMIT RUN card's first line, 2px under START LIMIT RUN: its four lines at LIM_LINE_P end 2px inside the card, which is the AUTOMATIC TEST card's size and holds three.
#define LIM_LINE_P   20
 The pitch of those lines in SV_FONT_LABEL, px.

Functions

bool servo_screen_limit_running (void)
int servo_screen_limit_phase (void)
static bool lim_pd_answers (void)
static const char * lim_meter_why (void)
const char * lim_blocked (void)
const char * lim_prog_why (void)
static void lim_cfg (servo_limrun_cfg_t *c)
static bool lim_apply (const servo_limrun_do_t *d)
static void lim_step (void)
static void lim_poll (void)
static void lim_ended (void)
void lim_leave_follow (void)
void lim_end_now (servo_test_abort_t why)
void lim_meter_follow (servo_source_id_t id, uint32_t changes)
void lim_begin (void)
uint32_t lim_signature (void)
void lim_tick (void)
static void lim_file_name (char *b, size_t n)
static void lim_end_text (char *b, size_t n, const servo_limrun_side_t *e)
void draw_lim_box (gfx_canvas_t *c)
 The limit run on the left card, in the automatic test's place: while it runs, the values written, the phase with the end and the pulse, and the output it drives; after it, the verdict, the ends or the values, and the report. Its button is STOP RUN while it runs and CLOSE after. The box, its lines and its button are the automatic test's (test_box_rect()).
void draw_lim_start (gfx_canvas_t *c)
 START LIMIT RUN, on the LIMIT RUN card under the AUTOMATIC TEST one: green, fading to the danger red across its hold; STOP RUN in red while the run is under way.
void draw_lim_mode_note (gfx_canvas_t *c, int x, int y)
 Why SEARCH+PROG is not offered, or what the mode does: the LIMIT RUN settings' note, one line of SV_FONT_LABEL.
void draw_lim_lines (gfx_canvas_t *c)
 The LIMIT RUN card's lines: over START LIMIT RUN the mode, and under it what the run drives and reads, why it cannot start or what it does now, the last result and its report, and the mode's note.

Detailed Description

The SERVO screen's limit run: its checks, its steps, the programmer's sessions it asks for, and its box, card and note.

The SERVO screen's limit run (servo_limrun.h). START LIMIT RUN, on TEST's LIMIT RUN card, starts it. This file holds what that button checks first, the run's steps done the way a finger does them (the servo's position, ARM and DISARM, SUPPLY's output), and the programmer's sessions with a KST or Chaservo servo on the programming port. It also draws the run's box on LIVE's card, its card's lines on TEST and its settings' note.

The screen is servo_screen.c; the state and the layout the files share are servo_screen_int.h.

SPDX-License-Identifier: MIT

Function Documentation

◆ draw_lim_box()

void draw_lim_box ( gfx_canvas_t * c)

The limit run on the left card, in the automatic test's place: while it runs, the values written, the phase with the end and the pulse, and the output it drives; after it, the verdict, the ends or the values, and the report. Its button is STOP RUN while it runs and CLOSE after. The box, its lines and its button are the automatic test's (test_box_rect()).

Parameters
cthe canvas

◆ draw_lim_lines()

void draw_lim_lines ( gfx_canvas_t * c)

The LIMIT RUN card's lines: over START LIMIT RUN the mode, and under it what the run drives and reads, why it cannot start or what it does now, the last result and its report, and the mode's note.

Parameters
cthe canvas

◆ draw_lim_mode_note()

void draw_lim_mode_note ( gfx_canvas_t * c,
int x,
int y )

Why SEARCH+PROG is not offered, or what the mode does: the LIMIT RUN settings' note, one line of SV_FONT_LABEL.

Parameters
cthe canvas
xthe line's left edge
yits top

◆ draw_lim_start()

void draw_lim_start ( gfx_canvas_t * c)

START LIMIT RUN, on the LIMIT RUN card under the AUTOMATIC TEST one: green, fading to the danger red across its hold; STOP RUN in red while the run is under way.

Parameters
cthe canvas

◆ servo_screen_limit_phase()

int servo_screen_limit_phase ( void )

The limit run's phase (servo_limrun_phase_t), for the tests.

◆ servo_screen_limit_running()

bool servo_screen_limit_running ( void )

Whether a limit run (servo_limrun.h) is under way, for the tests.