Skip to content

Commit

Permalink
Release 2.1.0 (#24)
Browse files Browse the repository at this point in the history
This release fixes issues with and improves the autonomous selector. More information can be found in the change log.
  • Loading branch information
unwieldycat authored Dec 25, 2023
2 parents 80224de + ac6c6e7 commit fc5d9aa
Show file tree
Hide file tree
Showing 19 changed files with 220 additions and 103 deletions.
Binary file removed .DS_Store
Binary file not shown.
2 changes: 0 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ UseCRLF: false
ColumnLimit: 100
AllowShortIfStatementsOnASingleLine: WithoutElse
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Left
AlwaysBreakTemplateDeclarations: "MultiLine"
AlwaysBreakTemplateDeclarations: true
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Bug report
about: Report a bug in robodash
title: 'Bug: '
labels: bug
assignees: unwieldycat

---

**Bug description**
Description of what the bug is.

**Expected behavior**
Description of what you expected to happen.

**Steps to reproduce**
Steps to reproduce the behavior, including any necessary code.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Enhancement
about: Suggest a new feature or idea
title: 'Enhancement: '
labels: enhancement
assignees: unwieldycat

---

**Proposed enhancement**
Describe the change or feature you want.

**Motivation behind change**
Describe why this enhancement would be helpful.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Question
about: Ask a question about robodash
title: 'Question: '
labels: question
assignees: unwieldycat

---

Ask your question here. Provide any relevant background information.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ temp.errors
.d/

docs-output/
.DS_STORE
.DS_Store
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changelog

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.1.0

Robodash 2.1.0 resolves issues with the autonomous selector.

### Added

- The ability to associate images with autonomous routines
- Support for multiple active selectors
- Automatic SD saving, no need to press a button

Minor breaking changes with selector: `rd::Selector::routine_t` is now a
`struct` instead of an `std::pair`. This shouldn't break any existing code.

### Fixed

- A data abort error when a routine name was too long
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.0.0
VERSION:=2.1.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.0.0
PROJECT_NUMBER = 2.1.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
Binary file modified docs/assets/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/assets/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/assets/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/assets/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/assets/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 0
#define RD_VERSION_MINOR 1
#define RD_VERSION_PATCH 0

#include "liblvgl/lvgl.h"
Expand Down
39 changes: 32 additions & 7 deletions include/robodash/views/selector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ namespace rd {
* @brief A function selector
* @image html selector.png
*
* A function selector for easily managing autonomous routines. Supports saving a configuration to
* an SD card, and automatically loading it on the next run.
* A function selector for easily managing autonomous routines. If available, automatically saves
* the current configuration to an SD card and loads it on the next run. Also supports displaying
* images from the SD card.
*/

/**
Expand All @@ -28,20 +29,28 @@ namespace rd {
class Selector {
/// @addtogroup selector
/// @{
private:
rd_view_t *view;

public:
/// @name Selector Typedefs
typedef std::function<void()> routine_action_t;
typedef std::pair<std::string, routine_action_t> routine_t;

typedef struct routine {
std::string name;
routine_action_t action;
std::string img = "";
} routine_t;

/// @name Selector Functions

/**
* @brief Create autonomous selector
* @param name Name of the autonomous selector
* @param autons Vector of autonomous rotuines
*/
Selector(std::string name, std::vector<routine_t> autons);

/**
* @brief Create autonomous selector
* @param autons Vector of autonomous rotuines
* @bug Multiple selectors cannot be active at the same time.
*/
Selector(std::vector<routine_t> autons);

Expand All @@ -56,6 +65,22 @@ class Selector {
void focus();

/// @}

private:
rd_view_t *view;

lv_obj_t *select_cont;
lv_obj_t *selected_label;
lv_obj_t *selected_img;

std::string name;
std::vector<rd::Selector::routine_t> routines;
rd::Selector::routine_t *selected_routine;

void sd_save();
void sd_load();

static void select_cb(lv_event_t *event);
};

} // namespace rd
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ void good_auton() { std::cout << "Running good auton" << std::endl; }

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

// Create robodash console
Expand Down
2 changes: 0 additions & 2 deletions src/robodash/styles/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ void _init_style_text() {
lv_style_set_text_color(&style_text_small, color_text);
lv_style_set_text_opa(&style_text_small, LV_OPA_COVER);
lv_style_set_text_font(&style_text_small, &lv_font_montserrat_12);
lv_style_set_text_letter_space(&style_text_small, 1);

// Medium text
lv_style_init(&style_text_medium);
lv_style_set_text_color(&style_text_medium, color_text);
lv_style_set_text_opa(&style_text_medium, LV_OPA_COVER);
lv_style_set_text_font(&style_text_medium, &lv_font_montserrat_14);
lv_style_set_text_letter_space(&style_text_medium, 1);

// Large text
lv_style_init(&style_text_large);
Expand Down
Loading

0 comments on commit fc5d9aa

Please sign in to comment.