Skip to content

Commit

Permalink
Update widget references and test names:
Browse files Browse the repository at this point in the history
- Update item references to use new widget structure
- Rename test from "ItemRangeBase Test" to "WidgetRange Test"
  • Loading branch information
forntoh committed Oct 29, 2024
1 parent bbd1c75 commit 2711fba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
14 changes: 10 additions & 4 deletions examples/IntFloatValues/IntFloatValues.ino
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include <ItemFloatRange.h>
#include <ItemIntRange.h>
#include <ItemWidget.h>
#include <LcdMenu.h>
#include <MenuScreen.h>
#include <display/LiquidCrystal_I2CAdapter.h>
#include <input/KeyboardAdapter.h>
#include <renderer/CharacterDisplayRenderer.h>
#include <widget/WidgetRange.h>

#define LCD_ROWS 2
#define LCD_COLS 16
Expand All @@ -17,8 +17,14 @@ void callbackFloat(float value);
// clang-format off
MENU_SCREEN(mainScreen, mainItems,
ITEM_BASIC("Con"),
ITEM_INT_RANGE("Dist", 100, 200, 100, callbackInt, "%02dm"),
ITEM_FLOAT_RANGE("Curr", -1.0f, 1.0f, -1.0f, callbackFloat, "%.2fmA", 0.01f),
ITEM_WIDGET(
"Dist",
callbackInt,
WIDGET_RANGE(100, 1, 100, 200, "%dm", 1)),
ITEM_WIDGET(
"Curr",
callbackFloat,
WIDGET_RANGE(-1.0f, 0.01f, -1.0f, 1.0f, "%.2fmA", 2)),
ITEM_BASIC("Blink SOS"),
ITEM_BASIC("Blink random"));
// clang-format on
Expand Down
32 changes: 16 additions & 16 deletions test/IntFloatValues.test.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
name: ItemRangeBase Test
name: WidgetRange Test
version: 1
author: Thomas Forntoh
steps:
- wait-serial: "#LOG# LcdMenu::setScreen"
- simulate: downButton-press
- wait-serial: "#LOG# MenuScreen::down=1"
- simulate: enterButton-press
- wait-serial: "#LOG# ItemRangeBase::enterEditMode=100"
- wait-serial: "#LOG# ItemWidget::enterEditMode=Dist"
- simulate: upButton-press
- wait-serial: "#LOG# ItemRangeBase::increment=101"
- wait-serial: "#LOG# WidgetRange::increment=101"
- simulate: upButton-press
- wait-serial: "#LOG# ItemRangeBase::increment=102"
- wait-serial: "#LOG# WidgetRange::increment=102"
- simulate: upButton-press
- wait-serial: "#LOG# ItemRangeBase::increment=103"
- wait-serial: "#LOG# WidgetRange::increment=103"
- simulate: downButton-press
- wait-serial: "#LOG# ItemRangeBase::decrement=102"
- wait-serial: "#LOG# WidgetRange::decrement=102"
- simulate: downButton-press
- wait-serial: "#LOG# ItemRangeBase::decrement=101"
- wait-serial: "#LOG# WidgetRange::decrement=101"
- simulate: backButton-press
- wait-serial: "#LOG# ItemRangeBase::exitEditMode=101"
- wait-serial: "#LOG# ItemWidget::exitEditMode=Dist"
- simulate: downButton-press
- wait-serial: "#LOG# MenuScreen::down=2"
- simulate: enterButton-press
- wait-serial: "#LOG# ItemRangeBase::enterEditMode=-1.00"
- wait-serial: "#LOG# ItemWidget::enterEditMode=Curr"
- simulate: upButton-press
- wait-serial: "#LOG# ItemRangeBase::increment=-0.99"
- wait-serial: "#LOG# WidgetRange::increment=-0.99"
- simulate: upButton-press
- wait-serial: "#LOG# ItemRangeBase::increment=-0.98"
- wait-serial: "#LOG# WidgetRange::increment=-0.98"
- simulate: upButton-press
- wait-serial: "#LOG# ItemRangeBase::increment=-0.97"
- wait-serial: "#LOG# WidgetRange::increment=-0.97"
- simulate: upButton-press
- wait-serial: "#LOG# ItemRangeBase::increment=-0.96"
- wait-serial: "#LOG# WidgetRange::increment=-0.96"
- simulate: downButton-press
- wait-serial: "#LOG# ItemRangeBase::decrement=-0.97"
- wait-serial: "#LOG# WidgetRange::decrement=-0.97"
- simulate: downButton-press
- wait-serial: "#LOG# ItemRangeBase::decrement=-0.98"
- wait-serial: "#LOG# WidgetRange::decrement=-0.98"
- simulate: backButton-press
- wait-serial: "#LOG# ItemRangeBase::exitEditMode=-0.98"
- wait-serial: "#LOG# WidgetRange::exitEditMode=Curr"
- simulate: downButton-press
- wait-serial: "#LOG# MenuScreen::down=3"

0 comments on commit 2711fba

Please sign in to comment.