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

The SERVO screen's pages of rows and the panels they open. SETTINGS, a task of the strip, holds three pages under its own tabs – OUTPUT, SWEEP and DUT: the servo's type, frame rate and pulse widths, the sweep's curve, and the device under test. Each run card on TEST opens its run's settings as one more page, one level down: the automatic test's steps, length, timing and pass/fail limits, and the limit run's mode. The rows open the keypad, the keyboard, the list, the profile warning, the HV warning and SUPPLY's question about a live output, all over the left column. The right card stays where it is and works. More...

#include <math.h>
#include <stdio.h>
#include <string.h>
#include "kst_panel.h"
#include "outputs.h"
#include "servo_limrun.h"
#include "settings.h"
#include "supply_screen.h"
#include "ui_keypad.h"
#include "ui_tabs.h"
#include "ui_textkey.h"
#include "ui_text.h"
#include "ui_theme.h"
#include "ui_widgets.h"
#include "servo_screen_int.h"

Macros

#define ROW_COUNT   ((int)(sizeof(k_rows) / sizeof(k_rows[0])))

Functions

gfx_rect_t row_rect (int i)
 Row i's rectangle: on SETTINGS' pages its column, or both for a wide one, UI_TAP_MIN tall; on a run's, its label over its value.
gfx_rect_t value_rect (int i)
 Where row i's value is drawn: right in its row on SETTINGS' pages, under its label on a run's.
gfx_rect_t trim_rect (int i, bool up)
 TRIM's two steps, inside its value, UI_TAP_MIN px wide each.
gfx_rect_t choice_rect (int i)
 The list's choice i: two columns of CHOICE_MAX / 2.
gfx_rect_t choice_cancel_rect (void)
 The list's CANCEL, bottom right.
gfx_rect_t warn_cancel_rect (void)
 A warning's or the question's CANCEL, bottom right.
int decimals_of (setting_id_t id)
 The decimals a setting's value is typed and drawn with.
static uint16_t max_pulse_for_rate (void)
static void open_set_point (int target)
static void set_point_typed (int target, float typed)
void ask_hv_on (void)
void ask_apply (void)
static void open_choice (int target, setting_id_t id, const char *title)
static void choice_add (const char *label, int value)
static void open_keypad (int target, const char *title, const char *unit, float value, float lo, float hi, int decimals)
bool target_locked_for (setting_id_t id)
bool target_locked (const ov_row_t *r)
 Whether a row is a TARGET or PORT PWM setting under its lock.
static void edit_row (int i)
 A settings row tapped: the editor its kind takes; TRIM's keypad is signed.
static void choose (int k)
static void keypad_done (ui_keypad_result_t r, float v)
 The keypad closed: v to its target on OK.
void ov_down (const touch_event_t *evt)
 A press on a page of rows or a panel: on whichever is up; on TRIM, beside its steps, the row.
void ov_rest (const touch_event_t *evt)

Variables

const ov_row_t k_rows []
 The settings rows, page by page. SETTINGS' pages in two columns; the automatic test's in three of five rows: the steps, the pass/fail limits and the brown-out, the length and timing. The length rule tops the right column, under TEST's SETTINGS: a second tap there opens its list and changes nothing.
const int k_row_count = ROW_COUNT
 The rows k_rows holds.

Detailed Description

The SERVO screen's pages of rows and the panels they open. SETTINGS, a task of the strip, holds three pages under its own tabs – OUTPUT, SWEEP and DUT: the servo's type, frame rate and pulse widths, the sweep's curve, and the device under test. Each run card on TEST opens its run's settings as one more page, one level down: the automatic test's steps, length, timing and pass/fail limits, and the limit run's mode. The rows open the keypad, the keyboard, the list, the profile warning, the HV warning and SUPPLY's question about a live output, all over the left column. The right card stays where it is and works.

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

SPDX-License-Identifier: MIT

Function Documentation

◆ choice_cancel_rect()

gfx_rect_t choice_cancel_rect ( void )

The list's CANCEL, bottom right.

Returns
the button

◆ choice_rect()

gfx_rect_t choice_rect ( int i)

The list's choice i: two columns of CHOICE_MAX / 2.

Parameters
ithe choice
Returns
its button

◆ decimals_of()

int decimals_of ( setting_id_t id)

The decimals a setting's value is typed and drawn with.

Parameters
idthe setting
Returns
2 for a float stepping under 1, else 0

◆ edit_row()

void edit_row ( int i)
static

A settings row tapped: the editor its kind takes; TRIM's keypad is signed.

Parameters
iThe row.

◆ keypad_done()

void keypad_done ( ui_keypad_result_t r,
float v )
static

The keypad closed: v to its target on OK.

Parameters
rHow it closed.
vThe value OK handed back.

◆ ov_down()

void ov_down ( const touch_event_t * evt)

A press on a page of rows or a panel: on whichever is up; on TRIM, beside its steps, the row.

Parameters
evtThe DOWN.

◆ row_rect()

gfx_rect_t row_rect ( int i)

Row i's rectangle: on SETTINGS' pages its column, or both for a wide one, UI_TAP_MIN tall; on a run's, its label over its value.

Parameters
ithe row in k_rows
Returns
the row: a tap anywhere on it edits it

◆ target_locked()

bool target_locked ( const ov_row_t * r)

Whether a row is a TARGET or PORT PWM setting under its lock.

Parameters
rthe row
Returns
true when it takes no tap now

◆ trim_rect()

gfx_rect_t trim_rect ( int i,
bool up )

TRIM's two steps, inside its value, UI_TAP_MIN px wide each.

Parameters
iTRIM's row in k_rows
uptrue for +, false for -
Returns
the step

◆ value_rect()

gfx_rect_t value_rect ( int i)

Where row i's value is drawn: right in its row on SETTINGS' pages, under its label on a run's.

Parameters
ithe row in k_rows
Returns
the value's box

◆ warn_cancel_rect()

gfx_rect_t warn_cancel_rect ( void )

A warning's or the question's CANCEL, bottom right.

Returns
the button

Variable Documentation

◆ k_row_count

const int k_row_count = ROW_COUNT

The rows k_rows holds.

The rows k_rows holds.

◆ k_rows

const ov_row_t k_rows[]

The settings rows, page by page. SETTINGS' pages in two columns; the automatic test's in three of five rows: the steps, the pass/fail limits and the brown-out, the length and timing. The length rule tops the right column, under TEST's SETTINGS: a second tap there opens its list and changes nothing.

The rows of the pages, page by page, and their count.

The settings rows, page by page. SETTINGS' pages in two columns; the automatic test's in three of five rows: the steps, the pass/fail limits and the brown-out, the length and timing. The length rule tops the right column, under TEST's SETTINGS: a second tap there opens its list and changes nothing.