More fixes again
This commit is contained in:
Submodule components/esp-gui-lib updated: 7e17dcf7d8...53c5f9a0f3
@ -23,7 +23,6 @@ set(BOBBY_HEADERS
|
||||
actions/loadsettingsaction.h
|
||||
actions/modesettingsaction.h
|
||||
actions/qraction.h
|
||||
actions/rebootaction.h
|
||||
actions/resetnvsaction.h
|
||||
actions/savesettingsaction.h
|
||||
actions/setupactions.h
|
||||
@ -159,6 +158,7 @@ set(BOBBY_HEADERS
|
||||
displays/qrcodedebug.h
|
||||
displays/qrdisplay.h
|
||||
displays/qrimportdisplay.h
|
||||
displays/rebootscreen.h
|
||||
displays/setup/ask_calibrate_other_buttons.h
|
||||
displays/setup/ask_setup_clouds.h
|
||||
displays/setup/basic_buttons.h
|
||||
@ -287,7 +287,6 @@ set(BOBBY_SOURCES
|
||||
actions/loadsettingsaction.cpp
|
||||
actions/modesettingsaction.cpp
|
||||
actions/qraction.cpp
|
||||
actions/rebootaction.cpp
|
||||
actions/resetnvsaction.cpp
|
||||
actions/savesettingsaction.cpp
|
||||
actions/setupactions.cpp
|
||||
@ -418,6 +417,7 @@ set(BOBBY_SOURCES
|
||||
displays/qrcodedebug.cpp
|
||||
displays/qrdisplay.cpp
|
||||
displays/qrimportdisplay.cpp
|
||||
displays/rebootscreen.cpp
|
||||
displays/setup/ask_calibrate_other_buttons.cpp
|
||||
displays/setup/ask_setup_clouds.cpp
|
||||
displays/setup/basic_buttons.cpp
|
||||
|
@ -1,22 +0,0 @@
|
||||
#include "rebootaction.h"
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_system.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <TFT_eSPI.h>
|
||||
|
||||
void RebootAction::triggered()
|
||||
{
|
||||
tft.fillScreen(TFT_BLACK);
|
||||
tft.setTextColor(TFT_YELLOW);
|
||||
|
||||
tft.drawString("Reboot", 5, 5, 4);
|
||||
|
||||
tft.fillRect(0, 34, tft.width(), 3, TFT_WHITE);
|
||||
|
||||
tft.setTextColor(TFT_WHITE);
|
||||
tft.drawString("Rebooting now...", 0, 50, 4);
|
||||
|
||||
esp_restart();
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <actioninterface.h>
|
||||
|
||||
class RebootAction : public virtual espgui::ActionInterface
|
||||
{
|
||||
public:
|
||||
void triggered() override;
|
||||
};
|
@ -8,7 +8,9 @@
|
||||
|
||||
void BobbyErrorHandler::errorOccurred(std::string &&error)
|
||||
{
|
||||
auto newDisplay = std::make_unique<BobbyPopupDisplay>(std::move(error), std::move(espgui::currentDisplay));
|
||||
espgui::changeScreenCallback = [error_ = std::move(error)](espgui::TftInterface &tft) mutable {
|
||||
auto newDisplay = std::make_unique<BobbyPopupDisplay>(std::move(error_), std::move(espgui::currentDisplay));
|
||||
newDisplay->initOverlay(tft);
|
||||
espgui::currentDisplay = std::move(newDisplay);
|
||||
};
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ void GameOfLifeDisplay::redraw(espgui::TftInterface &tft)
|
||||
}
|
||||
|
||||
computeCA();
|
||||
drawGrid();
|
||||
drawGrid(tft);
|
||||
|
||||
*m_grid = *m_newgrid;
|
||||
|
||||
@ -71,7 +71,7 @@ void GameOfLifeDisplay::buttonPressed(espgui::Button button)
|
||||
}
|
||||
}
|
||||
|
||||
void GameOfLifeDisplay::drawGrid()
|
||||
void GameOfLifeDisplay::drawGrid(espgui::TftInterface &tft)
|
||||
{
|
||||
uint16_t color = espgui::TFT_WHITE;
|
||||
for (int16_t x = 1; x < GRIDX - 1; x++) {
|
||||
|
@ -22,7 +22,7 @@ public:
|
||||
private:
|
||||
|
||||
//Draws the grid on the display
|
||||
void drawGrid();
|
||||
void drawGrid(espgui::TftInterface &tft);
|
||||
|
||||
//Initialise Grid
|
||||
void initGrid();
|
||||
|
@ -58,7 +58,7 @@ AboutMenu::AboutMenu()
|
||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, PopScreenAction, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||
}
|
||||
|
||||
std::string AboutMenu::text() const
|
||||
std::string AboutMenu::title() const
|
||||
{
|
||||
return TEXT_ABOUT;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ class AboutMenu : public BobbyMenuDisplay
|
||||
public:
|
||||
AboutMenu();
|
||||
|
||||
std::string text() const override;
|
||||
std::string title() const override;
|
||||
|
||||
void back() override;
|
||||
};
|
||||
|
35
main/displays/rebootscreen.cpp
Normal file
35
main/displays/rebootscreen.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
#include "rebootscreen.h"
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_system.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <tftinterface.h>
|
||||
#include <tftcolors.h>
|
||||
#include <fontrenderer.h>
|
||||
|
||||
void RebootScreen::initScreen(espgui::TftInterface &tft)
|
||||
{
|
||||
Base::initScreen(tft);
|
||||
|
||||
espgui::FontRenderer fontRenderer{tft};
|
||||
|
||||
fontRenderer.drawString("Rebooting now...", 0, 50, espgui::TFT_WHITE, espgui::TFT_BLACK, 4);
|
||||
|
||||
esp_restart();
|
||||
}
|
||||
|
||||
std::string RebootScreen::title() const
|
||||
{
|
||||
return "Reboot";
|
||||
}
|
||||
|
||||
void RebootScreen::buttonPressed(espgui::Button button)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RebootScreen::buttonReleased(espgui::Button button)
|
||||
{
|
||||
|
||||
}
|
17
main/displays/rebootscreen.h
Normal file
17
main/displays/rebootscreen.h
Normal file
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
// local includes
|
||||
#include "displays/bobbydisplaywithtitle.h"
|
||||
|
||||
class RebootScreen : public BobbyDisplayWithTitle
|
||||
{
|
||||
using Base = BobbyDisplayWithTitle;
|
||||
|
||||
public:
|
||||
void initScreen(espgui::TftInterface &tft) override;
|
||||
|
||||
std::string title() const override;
|
||||
|
||||
void buttonPressed(espgui::Button button) override;
|
||||
void buttonReleased(espgui::Button button) override;
|
||||
};
|
@ -26,7 +26,7 @@ std::optional<int> sunset;
|
||||
std::optional<espchrono::DateTime> sunrise_dt;
|
||||
|
||||
esp_chip_info_t chip_info;
|
||||
esp_pm_config_esp32_t pm_config;
|
||||
esp_pm_config_t pm_config;
|
||||
|
||||
#ifdef GLOBALS_SOURCE
|
||||
GLOBALS_SOURCE
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
// esp-idf includes
|
||||
#include <esp_chip_info.h>
|
||||
#include <esp32/pm.h>
|
||||
#include <esp_pm.h>
|
||||
|
||||
// 3rdparty lib includes
|
||||
#include <espchrono.h>
|
||||
@ -49,7 +49,7 @@ extern std::optional<int> sunset;
|
||||
extern std::optional<espchrono::DateTime> sunrise_dt;
|
||||
|
||||
extern esp_chip_info_t chip_info;
|
||||
extern esp_pm_config_esp32_t pm_config;
|
||||
extern esp_pm_config_t pm_config;
|
||||
|
||||
extern float avgSpeed;
|
||||
extern float avgSpeedKmh;
|
||||
|
Reference in New Issue
Block a user