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

PICK A PIN's geometry: the box the board takes, where each pad sits, the buttons above and below the board, the marks inside it, and the protocol list's rows. picker_screen.c holds the state, the touch handling and the screen's interface (picker_screen.h); picker_draw.c draws; picker_screen_int.h is what the three share. More...

#include "board_drawing.h"
#include "link_pages.h"
#include "outputs_screen.h"
#include "outputs_screen_int.h"
#include "picker_screen.h"
#include "port_view.h"
#include "picker_screen_int.h"

Functions

void picker_board_fit (uint16_t ow, uint16_t oh, int *w, int *h)
 The size in pixels a board outline draws at.
void pk_board_box (int *x, int *y, int *w, int *h)
 Gives the box the board occupies: the drawing's outline or else the shape's, centred across the screen between the body's top and FOOT.
bool pk_pad_xy (uint8_t pad, int *px, int *py)
 Gives where a pad sits on screen, from the drawing's pad record or else the shape's grid.
bool pk_pad_is_top (uint8_t pad)
 Returns which of the two pad rows a pad is in.
bool pk_button_at (int i, gfx_rect_t *out, int *tier_out)
 Gives the button of catalogue entry i and its tier; only a pin an output may have gets one.
bool picker_screen_button_rect (uint8_t index, gfx_rect_t *out)
bool pk_marker_at (uint8_t e, int *mx, int *my, int *r)
 Gives the centre and radius of the marker of pad-list entry e.
bool picker_screen_marker_rect (uint8_t entry, gfx_rect_t *out)
gfx_rect_t picker_screen_area (picker_area_t area)
 Gives the rectangle of one of the screen's tables.
gfx_rect_t picker_screen_list_face (void)
int pk_pop_rows (void)
 Returns the rows of the protocol list: the protocols, then one PROG PORT entry per port.
gfx_rect_t pk_pop_rect (void)
 Returns the protocol list's rectangle: one column of POP_W px, two with PROG PORT entries.
gfx_rect_t picker_screen_list_row (uint8_t proto)
 Row proto: a protocol in the first column, PROG PORT entry proto - OUTBIND_PROTOS in the second, from the same top.
bool picker_screen_list_open (void)
 Returns whether the protocol list is open.

Detailed Description

PICK A PIN's geometry: the box the board takes, where each pad sits, the buttons above and below the board, the marks inside it, and the protocol list's rows. picker_screen.c holds the state, the touch handling and the screen's interface (picker_screen.h); picker_draw.c draws; picker_screen_int.h is what the three share.

SPDX-License-Identifier: MIT

Function Documentation

◆ picker_board_fit()

void picker_board_fit ( uint16_t ow,
uint16_t oh,
int * w,
int * h )

The size in pixels a board outline draws at.

600 wide and the height its aspect gives, or, when that is taller than 240, 240 high and the width its aspect gives. A zero side gives 600 x 240.

Parameters
owThe outline's width, any unit.
ohIts height, in the same unit.
wThe width drawn, px.
hThe height drawn, px.

◆ picker_screen_area()

gfx_rect_t picker_screen_area ( picker_area_t area)

Gives the rectangle of one of the screen's tables.

Parameters
areathe table
Returns
its rectangle

◆ picker_screen_button_rect()

bool picker_screen_button_rect ( uint8_t index,
gfx_rect_t * out )

The rectangle of the button of catalogue entry index; false for a pin with none.

◆ picker_screen_list_face()

gfx_rect_t picker_screen_list_face ( void )

The protocol list: its face, and the row of proto when it is open.

◆ picker_screen_list_open()

bool picker_screen_list_open ( void )

Returns whether the protocol list is open.

Returns
true when open

◆ picker_screen_list_row()

gfx_rect_t picker_screen_list_row ( uint8_t proto)

Row proto: a protocol in the first column, PROG PORT entry proto - OUTBIND_PROTOS in the second, from the same top.

Parameters
protothe protocol index, or OUTBIND_PROTOS + n for PROG PORT entry n
Returns
the row's rectangle

◆ picker_screen_marker_rect()

bool picker_screen_marker_rect ( uint8_t entry,
gfx_rect_t * out )

The round marker of entry entry of the board's pad list (outbind_pads()), with its dark ring: a G for a ground, the voltage for a rail. False for a pad with no marker.

◆ pk_board_box()

void pk_board_box ( int * x,
int * y,
int * w,
int * h )

Gives the box the board occupies: the drawing's outline or else the shape's, centred across the screen between the body's top and FOOT.

Parameters
xtakes the left edge, px
ytakes the top edge, px
wtakes the width, px
htakes the height, px

◆ pk_button_at()

bool pk_button_at ( int i,
gfx_rect_t * out,
int * tier_out )

Gives the button of catalogue entry i and its tier; only a pin an output may have gets one.

Parameters
icatalogue entry
outtakes the button's rectangle
tier_outtakes the tier, 0 for the row nearer the board
Returns
true when the entry has a button

◆ pk_marker_at()

bool pk_marker_at ( uint8_t e,
int * mx,
int * my,
int * r )

Gives the centre and radius of the marker of pad-list entry e.

Parameters
epad-list entry
mxtakes the centre x, px
mytakes the centre y, px
rtakes the radius, px
Returns
true when the pad has a marker

◆ pk_pad_is_top()

bool pk_pad_is_top ( uint8_t pad)

Returns which of the two pad rows a pad is in.

Parameters
padthe pad
Returns
true for the upper row

◆ pk_pad_xy()

bool pk_pad_xy ( uint8_t pad,
int * px,
int * py )

Gives where a pad sits on screen, from the drawing's pad record or else the shape's grid.

Parameters
padthe pad
pxtakes the x of the pad's ring centre, px
pytakes the y of the pad's ring centre, px
Returns
true when the pad is on the board

◆ pk_pop_rect()

gfx_rect_t pk_pop_rect ( void )

Returns the protocol list's rectangle: one column of POP_W px, two with PROG PORT entries.

Returns
the rectangle

◆ pk_pop_rows()

int pk_pop_rows ( void )

Returns the rows of the protocol list: the protocols, then one PROG PORT entry per port.

Returns
the row count