Skip to content

Commit

Permalink
Release 2.3.0 (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
unwieldycat authored Jan 12, 2025
2 parents 6399cb3 + b4ac91e commit 9495335
Show file tree
Hide file tree
Showing 17 changed files with 239 additions and 41 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ Changes to this project will be logged in this file. This project uses
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). Format is loosely
based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## 2.3.0

Robodash 2.3.0 improves the selector UI.

### Added

- An indication for what auton in the selector list is currently selected
- `color_hue` parameter to autons, which places a color chip next to the auton's name in the list.
- Page up / page down buttons to the selector if it's scrollable, making scrolling easier when there's many autons.
- Up / down buttons to the selector, providing an alternate way to select autons in the list.
- `rd::Selector::next_auton` and `rd::Selector::prev_auton` functions for user-defined methods to control the selector, enabling hardware buttons or dials.

## 2.2.0

Robodash 2.2.0 provides selector enhancements.
Expand Down
2 changes: 1 addition & 1 deletion LICENCE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Thurston A Yates
Copyright (c) 2025 Thurston A Yates

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ EXCLUDE_COLD_LIBRARIES:=
# Set this to 1 to add additional rules to compile your project as a PROS library template
IS_LIBRARY:=1
LIBNAME:=robodash
VERSION:=2.2.0
VERSION:=2.3.0

# EXCLUDE_SRC_FROM_LIB= $(SRCDIR)/unpublishedfile.c
# this line excludes opcontrol.c and similar files
Expand Down
2 changes: 1 addition & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = Robodash
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 2.2.0
PROJECT_NUMBER = 2.3.0

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "Robodash"
copyright = "2024, Thurston A Yates"
copyright = "2025, Thurston A Yates"
author = "Thurston A Yates"

# -- General configuration ---------------------------------------------------
Expand Down
Binary file modified docs/source/img/alert.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/img/alert_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/img/selector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/img/view_button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/img/view_selector.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion include/robodash/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#define ROBODASH
#define RD_VERSION_MAJOR 2
#define RD_VERSION_MINOR 2
#define RD_VERSION_MINOR 3
#define RD_VERSION_PATCH 0

#include "liblvgl/lvgl.h"
Expand Down
1 change: 1 addition & 0 deletions include/robodash/impl/styles.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ extern void _init_style_misc();
extern lv_style_t style_list;
extern lv_style_t style_list_btn;
extern lv_style_t style_list_btn_pr;
extern lv_style_t style_list_btn_ch;

extern void _init_style_list();

Expand Down
24 changes: 23 additions & 1 deletion include/robodash/views/selector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Selector {
std::string name;
routine_action_t action;
std::string img = "";
int color_hue = -1;
} routine_t;

typedef std::function<void(std::optional<routine_t>)> select_action_t;
Expand Down Expand Up @@ -74,6 +75,22 @@ class Selector {
*/
void on_select(select_action_t callback);

/**
* @brief Select the next auton in the list
* @param wrap_around Whether to wrap around to the beginning once the last auton is reached
*
* Selects the next auton in the list for use with physical buttons such as limit switches.
*/
void next_auton(bool wrap_around = true);

/**
* @brief Select the previous auton in the list
* @param wrap_around Whether to wrap around to the end once the first auton is reached
*
* Selects the previous auton in the list for use with physical buttons such as limit switches.
*/
void prev_auton(bool wrap_around = true);

/**
* @brief Set this view to the active view
*/
Expand All @@ -84,7 +101,8 @@ class Selector {
private:
rd_view_t *view;

lv_obj_t *select_cont;
lv_obj_t *routine_list;
lv_obj_t *selected_cont;
lv_obj_t *selected_label;
lv_obj_t *selected_img;

Expand All @@ -99,6 +117,10 @@ class Selector {
void run_callbacks();

static void select_cb(lv_event_t *event);
static void up_cb(lv_event_t *event);
static void down_cb(lv_event_t *event);
static void pg_up_cb(lv_event_t *event);
static void pg_down_cb(lv_event_t *event);
};

} // namespace rd
8 changes: 5 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@
void best_auton() { std::cout << "Running best auton" << std::endl; }
void simple_auton() { std::cout << "Running simple auton " << std::endl; }
void good_auton() { std::cout << "Running good auton" << std::endl; }
void skills() { std::cout << "Running skills" << std::endl; }

// ================================= Views ================================= //

// Create robodash selector
rd::Selector selector({
{"Best auton", &best_auton},
{"Simple auton", &simple_auton},
{"Good auton", &good_auton},
{"Best auton", &best_auton, "", 0},
{"Simple auton", &simple_auton, "", 220},
{"Good auton", &good_auton, "", 100},
{"Skills", &skills},
});

// Create robodash console
Expand Down
1 change: 1 addition & 0 deletions src/robodash/styles/colors.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "liblvgl/misc/lv_color.h"
#include "robodash/apix.h"

// ================================= Colors ================================= //
Expand Down
12 changes: 8 additions & 4 deletions src/robodash/styles/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
lv_style_t style_list;
lv_style_t style_list_btn;
lv_style_t style_list_btn_pr;
lv_style_t style_list_btn_ch;

void _init_style_list() {
// List
Expand All @@ -13,9 +14,7 @@ void _init_style_list() {
lv_style_set_border_width(&style_list, 1);
lv_style_set_border_opa(&style_list, LV_OPA_COVER);
lv_style_set_bg_color(&style_list, color_bg);
lv_style_set_pad_ver(&style_list, 0);
lv_style_set_pad_hor(&style_list, 8);
lv_style_set_pad_gap(&style_list, 0);
lv_style_set_pad_hor(&style_list, 0);

// List button
lv_style_init(&style_list_btn);
Expand All @@ -31,4 +30,9 @@ void _init_style_list() {
// List button pressed
lv_style_init(&style_list_btn_pr);
lv_style_set_bg_color(&style_list_btn_pr, color_shade);
}

// List button checked
lv_style_init(&style_list_btn_ch);
lv_style_set_bg_color(&style_list_btn_ch, lv_color_darken(color_shade, 64));
lv_style_set_transform_width(&style_list_btn_ch, 0);
}
Loading

0 comments on commit 9495335

Please sign in to comment.