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

The actions and editors of the Hitec programmer's overlay: the SERVO tab's buttons, the lists (SERIES, MORE, RESTORE, a value's choices), the keypad of the supply and of a value, and the options kept in the settings. The hold pages are hitec_panel_page.c's. More...

#include "hitec_panel.h"
#include <math.h>
#include <stdio.h>
#include "hitec_reg.h"
#include "pdmini.h"
#include "settings.h"
#include "supply_screen.h"
#include "ui_text.h"
#include "ui_widgets.h"
#include "hitec_panel_int.h"

Functions

void hpn_close_editors (void)
 Every editor shut: the keypad, the list and the page.
static void choice_open (int kind, const char *title)
 Opens the list of kind with its title; choice_add() fills it.
static void choice_add (const char *label, int value)
 Adds an entry to the open list while it has room.
static void options_keep (void)
 The options as the settings keep them: the voltage and current, which the KST programmer shares, and the series.
void hpn_options_load (void)
 The programmer's options from the settings.
hitec_prog_edit_t hpn_edit_take (int32_t value)
 An edit's value to the model; CHECK THIS CHANGE where it waits.
static void value_keypad (const char *title, const char *unit, float value, float min, float max, int decimals)
 Opens the keypad for the value being edited.
static void value_list (const char *title, const hitec_param_info_t *info, int32_t now)
 The list of every value of a parameter with few of them.
static void editor_for (const hpn_row_t *r, const hitec_param_info_t *info, int32_t now)
 The editor of row r: a list of a few values, the D series FAILSAFE's list, or the keypad.
void hpn_edit_open (const hpn_row_t *r)
 The editor of a value row: its list or its keypad.
static void fs_position_keypad (void)
 The D series FAILSAFE's POSITION on the keypad.
static int more_held (bool add)
 MORE's entries while the port is held: DISCARD EDITS with an edit standing, REPAIR CHECKSUM with a classic sum that is wrong.
bool hpn_row_live (const hpn_row_t *r)
 Whether row r's control takes a tap now.
static void ask_write (uint8_t kind)
 A write of kind asked for: the switch's page while it is off, the write's own page where the write is taken, else the write's refusal, said.
static void port_act (hitec_prog_t *p)
 The action of the PORT row.
static void more_open (const hitec_prog_t *p)
 MORE opened: the supply's entries in PWM, the session's while held.
void hpn_act (const hpn_row_t *r)
 The action of a SERVO row.
static void list_done (hitec_prog_t *p, int kind, int value)
 An entry of MORE or RESTORE.
void hpn_choice_done (int value)
 The list's choice value.
static void value_done (float v)
 The keypad's value of a parameter: the edit, or the reason it is refused with the keypad open again.
void hpn_keypad_done (float v)
 The keypad's value v.

Detailed Description

The actions and editors of the Hitec programmer's overlay: the SERVO tab's buttons, the lists (SERIES, MORE, RESTORE, a value's choices), the keypad of the supply and of a value, and the options kept in the settings. The hold pages are hitec_panel_page.c's.

Hitec is a name or trademark of its owner; it is used here only to say which servos this overlay works with. The state and the seam are hitec_panel_int.h.

SPDX-License-Identifier: MIT

Function Documentation

◆ ask_write()

void ask_write ( uint8_t kind)
static

A write of kind asked for: the switch's page while it is off, the write's own page where the write is taken, else the write's refusal, said.

Parameters
kindhitec_prog_wr_t

◆ choice_add()

void choice_add ( const char * label,
int value )
static

Adds an entry to the open list while it has room.

Parameters
labelthe entry's label
valueits value

◆ choice_open()

void choice_open ( int kind,
const char * title )
static

Opens the list of kind with its title; choice_add() fills it.

Parameters
kindC_*
titlethe title

◆ editor_for()

void editor_for ( const hpn_row_t * r,
const hitec_param_info_t * info,
int32_t now )
static

The editor of row r: a list of a few values, the D series FAILSAFE's list, or the keypad.

Parameters
rthe row
infoits parameter
nowthe draft's value; INT32_MIN where it fits no encoding

◆ hpn_act()

void hpn_act ( const hpn_row_t * r)

The action of a SERVO row.

Parameters
rthe row

◆ hpn_choice_done()

void hpn_choice_done ( int value)

The list's choice value.

Parameters
valuethe entry's value

◆ hpn_edit_open()

void hpn_edit_open ( const hpn_row_t * r)

The editor of a value row: its list or its keypad.

Parameters
rthe row

◆ hpn_edit_take()

hitec_prog_edit_t hpn_edit_take ( int32_t value)

An edit's value to the model; CHECK THIS CHANGE where it waits.

Parameters
valuethe value in the parameter's unit
Returns
what the edit came to

◆ hpn_keypad_done()

void hpn_keypad_done ( float v)

The keypad's value v.

Parameters
vthe value

◆ hpn_row_live()

bool hpn_row_live ( const hpn_row_t * r)

Whether row r's control takes a tap now.

Parameters
rthe row
Returns
true when live

◆ list_done()

void list_done ( hitec_prog_t * p,
int kind,
int value )
static

An entry of MORE or RESTORE.

Parameters
pthe programmer
kindC_MORE or C_RESTORE
valuethe entry's value

◆ more_held()

int more_held ( bool add)
static

MORE's entries while the port is held: DISCARD EDITS with an edit standing, REPAIR CHECKSUM with a classic sum that is wrong.

Parameters
addtrue to add them to the open list
Returns
the entries

◆ more_open()

void more_open ( const hitec_prog_t * p)
static

MORE opened: the supply's entries in PWM, the session's while held.

Parameters
pthe programmer

◆ port_act()

void port_act ( hitec_prog_t * p)
static

The action of the PORT row.

Parameters
pthe programmer

◆ value_done()

void value_done ( float v)
static

The keypad's value of a parameter: the edit, or the reason it is refused with the keypad open again.

Parameters
vthe value typed

◆ value_keypad()

void value_keypad ( const char * title,
const char * unit,
float value,
float min,
float max,
int decimals )
static

Opens the keypad for the value being edited.

Parameters
titleits title
unitthe unit
valuethe value as it is
minthe range's lower end
maxits upper end
decimalsdigits after the point

◆ value_list()

void value_list ( const char * title,
const hitec_param_info_t * info,
int32_t now )
static

The list of every value of a parameter with few of them.

Parameters
titleits title
infothe parameter's row
nowthe draft's value; INT32_MIN not known