Skip to content

Commit

Permalink
public access to screen & line arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Bad-Assumptions committed Jul 11, 2023
1 parent da6d3b3 commit b9ce4a1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/LiquidLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void LiquidLine::print_variable(DisplayClass *p_liquidCrystal, uint8_t number) {
case DataType::CHAR_PTR: {
char* variable = const_cast<char*>(reinterpret_cast<const char *>(_variable[number]));
DEBUG(F("(char*)")); DEBUG(variable);
ESP_LOGD("LiquidLine", "print_variable(char*):%s", variable);
ESP_LOGV("LiquidLine", "print_variable(char*):%s", variable);
p_liquidCrystal->print(variable);
break;
} //case CHAR_PTR
Expand Down
5 changes: 5 additions & 0 deletions src/LiquidMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ uint8_t LiquidMenu::get_currentScreenNumber() const
return _currentScreen;
}

uint8_t LiquidMenu::get_screenCount() const
{
return _screenCount;
}

void LiquidMenu::next_screen()
{
_p_liquidCrystal->clear();
Expand Down
9 changes: 6 additions & 3 deletions src/LiquidMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,9 @@ class LiquidScreen {
*/
bool set_focusedLine(uint8_t lineIndex);

LiquidLine *_p_liquidLine[MAX_LINES]; ///< The LiquidLine objects
uint8_t get_lineCount() const;

private:
/// Prints the lines pointed by the screen.
/**
Expand Down Expand Up @@ -764,7 +767,6 @@ class LiquidScreen {
*/
bool call_function(uint8_t number) const;

LiquidLine *_p_liquidLine[MAX_LINES]; ///< The LiquidLine objects
uint8_t _lineCount; ///< Count of the LiquidLine objects
uint8_t _focus; ///< Index of the focused line
uint8_t _displayLineCount; ///< The number of lines the display supports
Expand Down Expand Up @@ -1045,10 +1047,11 @@ class LiquidMenu {

DisplayClass *_p_liquidCrystal; ///< Pointer to the DisplayClass object FIXME
LiquidScreen *_p_liquidScreen[MAX_SCREENS]; ///< The LiquidScreen objects
uint8_t get_screenCount() const;

private:
uint8_t _screenCount; ///< Count of the LiquidScreen objects
uint8_t _currentScreen; // FIXME DEBUG should be private
uint8_t _screenCount; ///< Count of the LiquidScreen objects
uint8_t _currentScreen; // FIXME DEBUG should be private
};

/// Represents a collection of menus forming a menu system.
Expand Down
4 changes: 4 additions & 0 deletions src/LiquidScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ uint8_t LiquidScreen::get_focusedLine() const {
return _focus;
}

uint8_t LiquidScreen::get_lineCount() const {
return _lineCount;
}

bool LiquidScreen::is_callable(uint8_t number) const {
if (_focus != _lineCount) {
return _p_liquidLine[_focus]->is_callable(number);
Expand Down

0 comments on commit b9ce4a1

Please sign in to comment.