refactored all the gui code into library
This commit is contained in:
Submodule components/TFT_eSPI updated: 5b450e3992...d27de95f6b
Submodule components/cpputils updated: b60122ff4a...e4176f9d0c
Submodule components/esp-gui-lib updated: f4b568f055...ad0d90339e
BIN
icons/back.png
BIN
icons/back.png
Binary file not shown.
Before Width: | Height: | Size: 9.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 9.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 7.1 KiB |
@ -1,10 +1,7 @@
|
|||||||
set(headers
|
set(headers
|
||||||
accessorinterface.h
|
|
||||||
accessors/globalaccessors.h
|
accessors/globalaccessors.h
|
||||||
accessors/settingsaccessors.h
|
accessors/settingsaccessors.h
|
||||||
accessors/wifiaccessors.h
|
accessors/wifiaccessors.h
|
||||||
actioninterface.h
|
|
||||||
actions/backproxyaction.h
|
|
||||||
actions/bluetoothbeginaction.h
|
actions/bluetoothbeginaction.h
|
||||||
actions/bluetoothbeginmasteraction.h
|
actions/bluetoothbeginmasteraction.h
|
||||||
actions/bluetoothconnectbmsaction.h
|
actions/bluetoothconnectbmsaction.h
|
||||||
@ -15,15 +12,12 @@ set(headers
|
|||||||
actions/bmsturnoffdischargeaction.h
|
actions/bmsturnoffdischargeaction.h
|
||||||
actions/bmsturnonchargeaction.h
|
actions/bmsturnonchargeaction.h
|
||||||
actions/bmsturnondischargeaction.h
|
actions/bmsturnondischargeaction.h
|
||||||
actions/dummyaction.h
|
|
||||||
actions/erasenvsaction.h
|
actions/erasenvsaction.h
|
||||||
actions/loadsettingsaction.h
|
actions/loadsettingsaction.h
|
||||||
actions/modesettingsaction.h
|
actions/modesettingsaction.h
|
||||||
actions/multiaction.h
|
actions/multiaction.h
|
||||||
actions/rebootaction.h
|
actions/rebootaction.h
|
||||||
actions/savesettingsaction.h
|
actions/savesettingsaction.h
|
||||||
actions/setvalueaction.h
|
|
||||||
actions/switchscreenaction.h
|
|
||||||
actions/tempomatmodeapplycurrentpeedaction.h
|
actions/tempomatmodeapplycurrentpeedaction.h
|
||||||
actions/toggleboolaction.h
|
actions/toggleboolaction.h
|
||||||
actions/wifiscanaction.h
|
actions/wifiscanaction.h
|
||||||
@ -34,16 +28,13 @@ set(headers
|
|||||||
bletexthelpers.h
|
bletexthelpers.h
|
||||||
bmsutils.h
|
bmsutils.h
|
||||||
changevaluedisplay_bluetoothmode.h
|
changevaluedisplay_bluetoothmode.h
|
||||||
changevaluedisplay_bool.h
|
changevaluedisplay_controlmode.h
|
||||||
changevaluedisplay_sntp_sync_mode_t.h
|
changevaluedisplay_controltype.h
|
||||||
changevaluedisplay_daylightsavingmode.h
|
|
||||||
changevaluedisplay_larsmmode_mode.h
|
changevaluedisplay_larsmmode_mode.h
|
||||||
changevaluedisplay_unifiedmodelmode.h
|
changevaluedisplay_unifiedmodelmode.h
|
||||||
changevaluedisplay_wifi_mode_t.h
|
changevaluedisplay_wifi_mode_t.h
|
||||||
changevaluedisplay_wifi_power_t.h
|
changevaluedisplay_wifi_power_t.h
|
||||||
checkboxicon.h
|
|
||||||
cloud.h
|
cloud.h
|
||||||
colorinterface.h
|
|
||||||
debugcolorhelpers.h
|
debugcolorhelpers.h
|
||||||
displays/gameoflifedisplay.h
|
displays/gameoflifedisplay.h
|
||||||
displays/graphdisplay.h
|
displays/graphdisplay.h
|
||||||
@ -99,15 +90,11 @@ set(headers
|
|||||||
displays/statusdisplay.h
|
displays/statusdisplay.h
|
||||||
displays/updatedisplay.h
|
displays/updatedisplay.h
|
||||||
esp_websocket_client.h
|
esp_websocket_client.h
|
||||||
fontinterface.h
|
|
||||||
htmltag.h
|
htmltag.h
|
||||||
iconinterface.h
|
|
||||||
icons/alert.h
|
icons/alert.h
|
||||||
icons/back.h
|
|
||||||
icons/bluetooth.h
|
icons/bluetooth.h
|
||||||
icons/bms.h
|
icons/bms.h
|
||||||
icons/buzzer.h
|
icons/buzzer.h
|
||||||
icons/checked.h
|
|
||||||
icons/close.h
|
icons/close.h
|
||||||
icons/demos.h
|
icons/demos.h
|
||||||
icons/graph.h
|
icons/graph.h
|
||||||
@ -122,12 +109,9 @@ set(headers
|
|||||||
icons/scan.h
|
icons/scan.h
|
||||||
icons/settings.h
|
icons/settings.h
|
||||||
icons/time.h
|
icons/time.h
|
||||||
icons/unchecked.h
|
|
||||||
icons/update.h
|
icons/update.h
|
||||||
icons/wifi.h
|
icons/wifi.h
|
||||||
ledstrip.h
|
ledstrip.h
|
||||||
menudisplay.h
|
|
||||||
menuitem.h
|
|
||||||
modes/defaultmode.h
|
modes/defaultmode.h
|
||||||
modes/gametrakmode.h
|
modes/gametrakmode.h
|
||||||
modes/ignoreinputmode.h
|
modes/ignoreinputmode.h
|
||||||
@ -137,23 +121,13 @@ set(headers
|
|||||||
rotary.h
|
rotary.h
|
||||||
screens.h
|
screens.h
|
||||||
types.h
|
types.h
|
||||||
widgets/progressbar.h
|
|
||||||
widgets/reverseprogressbar.h
|
|
||||||
widgets/verticalmeter.h
|
|
||||||
widgets/vumeter.h
|
|
||||||
widgets/graph.h
|
|
||||||
widgets/label.h
|
|
||||||
esptexthelpers.h
|
esptexthelpers.h
|
||||||
presets.h
|
presets.h
|
||||||
bluetoothtexthelpers.h
|
bluetoothtexthelpers.h
|
||||||
buttons.h
|
buttons.h
|
||||||
can.h
|
can.h
|
||||||
changevaluedisplay.h
|
|
||||||
changevaluedisplay_controlmode.h
|
|
||||||
changevaluedisplay_controltype.h
|
|
||||||
controller.h
|
controller.h
|
||||||
debugtexthelpers.h
|
debugtexthelpers.h
|
||||||
display.h
|
|
||||||
dpad.h
|
dpad.h
|
||||||
dpad3wire.h
|
dpad3wire.h
|
||||||
dpad5wire.h
|
dpad5wire.h
|
||||||
@ -169,7 +143,7 @@ set(headers
|
|||||||
settingspersister.h
|
settingspersister.h
|
||||||
settingsutils.h
|
settingsutils.h
|
||||||
statistics.h
|
statistics.h
|
||||||
textinterface.h
|
statustexthelper.h
|
||||||
texts.h
|
texts.h
|
||||||
time_bobbycar.h
|
time_bobbycar.h
|
||||||
unifiedmodelmode.h
|
unifiedmodelmode.h
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
template<typename T>
|
|
||||||
struct AccessorInterface
|
|
||||||
{
|
|
||||||
virtual T getValue() const = 0;
|
|
||||||
virtual void setValue(T value) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
//! A special type of AccessorInterface that allows for simple variable read/write operations
|
|
||||||
//! Can be used to read and write global settings for example.
|
|
||||||
template<typename T>
|
|
||||||
struct RefAccessor : public virtual AccessorInterface<T>
|
|
||||||
{
|
|
||||||
virtual T& getRef() const = 0;
|
|
||||||
|
|
||||||
T getValue() const override { return getRef(); };
|
|
||||||
void setValue(T value) override { getRef() = value; };
|
|
||||||
};
|
|
||||||
}
|
|
@ -5,6 +5,8 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "modes/tempomatmode.h"
|
#include "modes/tempomatmode.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
struct AvgSpeedAccessor : public RefAccessor<float> { float &getRef() const override { return avgSpeed; } };
|
struct AvgSpeedAccessor : public RefAccessor<float> { float &getRef() const override { return avgSpeed; } };
|
||||||
|
@ -5,6 +5,8 @@
|
|||||||
#include "accessorinterface.h"
|
#include "accessorinterface.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
//! Special type of RefAccessor that also saves settings after setValue()
|
//! Special type of RefAccessor that also saves settings after setValue()
|
||||||
template<typename T>
|
template<typename T>
|
||||||
@ -110,7 +112,6 @@ struct GametrakYMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t
|
|||||||
struct GametrakDistMinAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gametrakDistMin; } };
|
struct GametrakDistMinAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gametrakDistMin; } };
|
||||||
struct GametrakDistMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gametrakDistMax; } };
|
struct GametrakDistMaxAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.gametrakDistMax; } };
|
||||||
#endif
|
#endif
|
||||||
struct SwapScreenBytesAccessor : public RefAccessorSaveSettings<bool> { bool &getRef() const override { return settings.boardcomputerHardware.swapScreenBytes; } };
|
|
||||||
struct PotiReadRateAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.timersSettings.potiReadRate; } };
|
struct PotiReadRateAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.timersSettings.potiReadRate; } };
|
||||||
struct ModeUpdateRateAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.timersSettings.modeUpdateRate; } };
|
struct ModeUpdateRateAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.timersSettings.modeUpdateRate; } };
|
||||||
struct StatsUpdateRateAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.timersSettings.statsUpdateRate; } };
|
struct StatsUpdateRateAccessor : public RefAccessorSaveSettings<int16_t> { int16_t &getRef() const override { return settings.boardcomputerHardware.timersSettings.statsUpdateRate; } };
|
||||||
|
@ -3,5 +3,7 @@
|
|||||||
// local includes
|
// local includes
|
||||||
#include "accessorinterface.h"
|
#include "accessorinterface.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
}
|
}
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class ActionInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void triggered() = 0;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "actioninterface.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class BackProxyAction : public virtual ActionInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BackProxyAction(BackInterface &backInterface) :
|
|
||||||
m_backInterface{backInterface}
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void triggered() override
|
|
||||||
{
|
|
||||||
m_backInterface.back();
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
BackInterface &m_backInterface;
|
|
||||||
};
|
|
||||||
}
|
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BLUETOOTH
|
#ifdef FEATURE_BLUETOOTH
|
||||||
class BluetoothBeginAction : public virtual ActionInterface
|
class BluetoothBeginAction : public virtual ActionInterface
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BLUETOOTH
|
#ifdef FEATURE_BLUETOOTH
|
||||||
class BluetoothBeginMasterAction : public virtual ActionInterface
|
class BluetoothBeginMasterAction : public virtual ActionInterface
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#if defined(FEATURE_BLUETOOTH) && defined(FEATURE_BMS)
|
#if defined(FEATURE_BLUETOOTH) && defined(FEATURE_BMS)
|
||||||
class BluetoothConnectBmsAction : public virtual ActionInterface
|
class BluetoothConnectBmsAction : public virtual ActionInterface
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BLUETOOTH
|
#ifdef FEATURE_BLUETOOTH
|
||||||
class BluetoothDisconnectAction : public virtual ActionInterface
|
class BluetoothDisconnectAction : public virtual ActionInterface
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BLUETOOTH
|
#ifdef FEATURE_BLUETOOTH
|
||||||
class BluetoothEndAction : public virtual ActionInterface
|
class BluetoothEndAction : public virtual ActionInterface
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BLUETOOTH
|
#ifdef FEATURE_BLUETOOTH
|
||||||
class BluetoothFlushAction : public virtual ActionInterface
|
class BluetoothFlushAction : public virtual ActionInterface
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "bmsutils.h"
|
#include "bmsutils.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BMS
|
#ifdef FEATURE_BMS
|
||||||
class BmsTurnOffChargeAction : public virtual ActionInterface
|
class BmsTurnOffChargeAction : public virtual ActionInterface
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "bmsutils.h"
|
#include "bmsutils.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BMS
|
#ifdef FEATURE_BMS
|
||||||
class BmsTurnOffDischargeAction : public virtual ActionInterface
|
class BmsTurnOffDischargeAction : public virtual ActionInterface
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "bmsutils.h"
|
#include "bmsutils.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BMS
|
#ifdef FEATURE_BMS
|
||||||
class BmsTurnOnChargeAction : public virtual ActionInterface
|
class BmsTurnOnChargeAction : public virtual ActionInterface
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "bmsutils.h"
|
#include "bmsutils.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BMS
|
#ifdef FEATURE_BMS
|
||||||
class BmsTurnOnDischargeAction : public virtual ActionInterface
|
class BmsTurnOnDischargeAction : public virtual ActionInterface
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "actioninterface.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class DummyAction : public virtual ActionInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void triggered() override {}
|
|
||||||
};
|
|
||||||
}
|
|
@ -8,6 +8,8 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "presets.h"
|
#include "presets.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class EraseNvsAction : public virtual ActionInterface
|
class EraseNvsAction : public virtual ActionInterface
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class LoadSettingsAction : public virtual ActionInterface
|
class LoadSettingsAction : public virtual ActionInterface
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
#include "displays/menus/larsmmodesettingsmenu.h"
|
#include "displays/menus/larsmmodesettingsmenu.h"
|
||||||
#include "displays/menus/gametrakmodesettingsmenu.h"
|
#include "displays/menus/gametrakmodesettingsmenu.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class ModeSettingsAction : public virtual ActionInterface
|
class ModeSettingsAction : public virtual ActionInterface
|
||||||
{
|
{
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template<typename ...T>
|
template<typename ...T>
|
||||||
class MultiAction;
|
class MultiAction;
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class RebootAction : public virtual ActionInterface
|
class RebootAction : public virtual ActionInterface
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class SaveSettingsAction : public virtual ActionInterface
|
class SaveSettingsAction : public virtual ActionInterface
|
||||||
{
|
{
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "actioninterface.h"
|
|
||||||
#include "accessorinterface.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
template<typename T>
|
|
||||||
class SetValueAction : public virtual ActionInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
SetValueAction(T value, AccessorInterface<T> &accessorInterface, BackInterface &backInterface) :
|
|
||||||
m_value{value},
|
|
||||||
m_accessorInterface{accessorInterface},
|
|
||||||
m_backInterface{backInterface}
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void triggered() override
|
|
||||||
{
|
|
||||||
m_accessorInterface.setValue(m_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
T value() const { return m_value; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
const T m_value;
|
|
||||||
AccessorInterface<T> &m_accessorInterface;
|
|
||||||
BackInterface &m_backInterface;
|
|
||||||
};
|
|
||||||
}
|
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "settingsutils.h"
|
#include "settingsutils.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template<uint8_t index>
|
template<uint8_t index>
|
||||||
class SwitchProfileAction : public virtual ActionInterface
|
class SwitchProfileAction : public virtual ActionInterface
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "actioninterface.h"
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
template<typename Tscreen, typename ...Targs>
|
|
||||||
class SwitchScreenAction : public virtual ActionInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void triggered() override { switchScreen<Tscreen>(std::make_unique<Targs>()...); }
|
|
||||||
};
|
|
||||||
}
|
|
@ -5,6 +5,8 @@
|
|||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "modes/tempomatmode.h"
|
#include "modes/tempomatmode.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class TempomatModeApplyCurrentSpeedAction : public virtual ActionInterface
|
class TempomatModeApplyCurrentSpeedAction : public virtual ActionInterface
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "accessorinterface.h"
|
#include "accessorinterface.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class ToggleBoolAction : public virtual ActionInterface, public virtual AccessorInterface<bool>
|
class ToggleBoolAction : public virtual ActionInterface, public virtual AccessorInterface<bool>
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_SERIAL
|
#ifdef FEATURE_SERIAL
|
||||||
class UpdateSwapFrontBackAction : public virtual ActionInterface
|
class UpdateSwapFrontBackAction : public virtual ActionInterface
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#include "actioninterface.h"
|
#include "actioninterface.h"
|
||||||
#include "wifi_bobbycar.h"
|
#include "wifi_bobbycar.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class WifiScanAction : public virtual ActionInterface
|
class WifiScanAction : public virtual ActionInterface
|
||||||
{
|
{
|
||||||
|
@ -1,167 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
// 3rdparty lib includes
|
|
||||||
#include <fmt/core.h>
|
|
||||||
|
|
||||||
// local includes
|
|
||||||
#include "display.h"
|
|
||||||
#include "textinterface.h"
|
|
||||||
#include "actioninterface.h"
|
|
||||||
#include "accessorinterface.h"
|
|
||||||
#include "widgets/label.h"
|
|
||||||
#include "globals.h"
|
|
||||||
#include "utils.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class ChangeValueDisplayInterface : public Display, public virtual TextInterface, public virtual ActionInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void initScreen() override;
|
|
||||||
|
|
||||||
TextInterface *asTextInterface() override { return this; }
|
|
||||||
const TextInterface *asTextInterface() const override { return this; }
|
|
||||||
|
|
||||||
ChangeValueDisplayInterface *asChangeValueDisplayInterface() override { return this; }
|
|
||||||
const ChangeValueDisplayInterface *asChangeValueDisplayInterface() const override { return this; }
|
|
||||||
|
|
||||||
virtual int shownValue() const = 0;
|
|
||||||
virtual void setShownValue(int value) = 0;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
Label m_titleLabel{5, 5}; // 230, 25
|
|
||||||
Label m_valueLabel{26, 81}; // 188, 53
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename Tvalue>
|
|
||||||
class ChangeValueDisplaySettingsInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual Tvalue step() const { return 1; };
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename Tvalue, typename Tratio>
|
|
||||||
class RatioNumberStep : public virtual ChangeValueDisplaySettingsInterface<Tvalue>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Tvalue step() const override { return Tvalue(Tratio::num) / Tratio::den; }
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename Tvalue>
|
|
||||||
class ChangeValueDisplay : public ChangeValueDisplayInterface, public virtual AccessorInterface<Tvalue>, public virtual ChangeValueDisplaySettingsInterface<Tvalue>
|
|
||||||
{
|
|
||||||
using Base = ChangeValueDisplayInterface;
|
|
||||||
|
|
||||||
public:
|
|
||||||
void start() override;
|
|
||||||
void update() override;
|
|
||||||
void redraw() override;
|
|
||||||
|
|
||||||
void rotate(int offset) override;
|
|
||||||
void confirm() override;
|
|
||||||
|
|
||||||
int shownValue() const { return m_value; }
|
|
||||||
void setShownValue(int value) { m_value = value; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
Tvalue m_value{};
|
|
||||||
|
|
||||||
int m_rotateOffset;
|
|
||||||
bool m_pressed{};
|
|
||||||
};
|
|
||||||
|
|
||||||
void ChangeValueDisplayInterface::initScreen()
|
|
||||||
{
|
|
||||||
tft.fillScreen(TFT_BLACK);
|
|
||||||
|
|
||||||
m_titleLabel.start();
|
|
||||||
|
|
||||||
tft.fillRect(0, 34, tft.width(), 3, TFT_WHITE);
|
|
||||||
|
|
||||||
tft.drawRect(25, 75, 190, 65, TFT_WHITE);
|
|
||||||
m_valueLabel.start();
|
|
||||||
|
|
||||||
tft.setTextFont(4);
|
|
||||||
tft.setTextColor(TFT_WHITE);
|
|
||||||
tft.drawString("Change value and", 10, 160);
|
|
||||||
tft.drawString("press button to", 10, 185);
|
|
||||||
tft.drawString("confirm and go", 10, 210);
|
|
||||||
tft.drawString("back.", 10, 235);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Tvalue>
|
|
||||||
void ChangeValueDisplay<Tvalue>::start()
|
|
||||||
{
|
|
||||||
m_value = static_cast<AccessorInterface<Tvalue>*>(this)->getValue();
|
|
||||||
|
|
||||||
m_rotateOffset = 0;
|
|
||||||
m_pressed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Tvalue>
|
|
||||||
void ChangeValueDisplay<Tvalue>::update()
|
|
||||||
{
|
|
||||||
if (!m_pressed)
|
|
||||||
{
|
|
||||||
const auto rotateOffset = m_rotateOffset;
|
|
||||||
m_rotateOffset = 0;
|
|
||||||
|
|
||||||
m_value -= rotateOffset * static_cast<ChangeValueDisplaySettingsInterface<Tvalue>*>(this)->step();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
static_cast<AccessorInterface<Tvalue>*>(this)->setValue(m_value);
|
|
||||||
triggered();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Tvalue>
|
|
||||||
void ChangeValueDisplay<Tvalue>::redraw()
|
|
||||||
{
|
|
||||||
tft.setTextFont(4);
|
|
||||||
tft.setTextColor(TFT_YELLOW);
|
|
||||||
m_titleLabel.redraw(text());
|
|
||||||
|
|
||||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
|
||||||
tft.setTextFont(7);
|
|
||||||
m_valueLabel.redraw(std::to_string(m_value));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
|
||||||
void ChangeValueDisplay<float>::redraw()
|
|
||||||
{
|
|
||||||
tft.setTextFont(4);
|
|
||||||
tft.setTextColor(TFT_YELLOW);
|
|
||||||
m_titleLabel.redraw(text());
|
|
||||||
|
|
||||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
|
||||||
tft.setTextFont(7);
|
|
||||||
m_valueLabel.redraw(fmt::format("{:.02f}", m_value));
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Tvalue>
|
|
||||||
void ChangeValueDisplay<Tvalue>::rotate(int offset)
|
|
||||||
{
|
|
||||||
m_rotateOffset += offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Tvalue>
|
|
||||||
void ChangeValueDisplay<Tvalue>::confirm()
|
|
||||||
{
|
|
||||||
m_pressed = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#include "changevaluedisplay_bool.h"
|
|
||||||
#ifdef FEATURE_BLUETOOTH
|
|
||||||
#include "changevaluedisplay_bluetoothmode.h"
|
|
||||||
#endif
|
|
||||||
#ifdef FEATURE_NTP
|
|
||||||
#include "changevaluedisplay_sntp_sync_mode_t.h"
|
|
||||||
#endif
|
|
||||||
#include "changevaluedisplay_controlmode.h"
|
|
||||||
#include "changevaluedisplay_controltype.h"
|
|
||||||
#include "changevaluedisplay_daylightsavingmode.h"
|
|
||||||
#include "changevaluedisplay_larsmmode_mode.h"
|
|
||||||
#include "changevaluedisplay_unifiedmodelmode.h"
|
|
||||||
#include "changevaluedisplay_wifi_mode_t.h"
|
|
||||||
#include "changevaluedisplay_wifi_power_t.h"
|
|
@ -12,7 +12,7 @@
|
|||||||
#include "bluetoothmode.h"
|
#include "bluetoothmode.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace espgui {
|
||||||
#ifdef FEATURE_BLUETOOTH
|
#ifdef FEATURE_BLUETOOTH
|
||||||
template<>
|
template<>
|
||||||
class ChangeValueDisplay<BluetoothMode> :
|
class ChangeValueDisplay<BluetoothMode> :
|
||||||
@ -33,7 +33,7 @@ ChangeValueDisplay<BluetoothMode>::ChangeValueDisplay()
|
|||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BluetoothMode>, StaticText<TEXT_OFF>>>(BluetoothMode::Off, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BluetoothMode>, StaticText<TEXT_OFF>>>(BluetoothMode::Off, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BluetoothMode>, StaticText<TEXT_MASTER>>>(BluetoothMode::Master, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BluetoothMode>, StaticText<TEXT_MASTER>>>(BluetoothMode::Master, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BluetoothMode>, StaticText<TEXT_SLAVE>>>(BluetoothMode::Slave, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<BluetoothMode>, StaticText<TEXT_SLAVE>>>(BluetoothMode::Slave, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
|
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&espgui::icons::back>>>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeValueDisplay<BluetoothMode>::start()
|
void ChangeValueDisplay<BluetoothMode>::start()
|
||||||
@ -51,4 +51,4 @@ void ChangeValueDisplay<BluetoothMode>::start()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
} // namespace espgui
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
// local includes
|
|
||||||
#include "changevaluedisplay.h"
|
|
||||||
#include "menudisplay.h"
|
|
||||||
#include "actioninterface.h"
|
|
||||||
#include "utils.h"
|
|
||||||
#include "actions/setvalueaction.h"
|
|
||||||
#include "actions/backproxyaction.h"
|
|
||||||
#include "icons/back.h"
|
|
||||||
#include "texts.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
template<>
|
|
||||||
class ChangeValueDisplay<bool> :
|
|
||||||
public MenuDisplay,
|
|
||||||
public virtual AccessorInterface<bool>,
|
|
||||||
public virtual ActionInterface
|
|
||||||
{
|
|
||||||
using Base = MenuDisplay;
|
|
||||||
|
|
||||||
public:
|
|
||||||
ChangeValueDisplay();
|
|
||||||
|
|
||||||
void start() override;
|
|
||||||
};
|
|
||||||
|
|
||||||
ChangeValueDisplay<bool>::ChangeValueDisplay()
|
|
||||||
{
|
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<bool>, StaticText<TEXT_TRUE>>>(true, *this, *this);
|
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<bool>, StaticText<TEXT_FALSE>>>(false, *this, *this);
|
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChangeValueDisplay<bool>::start()
|
|
||||||
{
|
|
||||||
Base::start();
|
|
||||||
|
|
||||||
switch (getValue())
|
|
||||||
{
|
|
||||||
case true: setSelectedIndex(0); break;
|
|
||||||
case false: setSelectedIndex(1); break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -12,7 +12,7 @@
|
|||||||
#include "icons/back.h"
|
#include "icons/back.h"
|
||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
|
|
||||||
namespace {
|
namespace espgui {
|
||||||
template<>
|
template<>
|
||||||
class ChangeValueDisplay<bobbycar::protocol::ControlMode> :
|
class ChangeValueDisplay<bobbycar::protocol::ControlMode> :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -34,7 +34,7 @@ ChangeValueDisplay<bobbycar::protocol::ControlMode>::ChangeValueDisplay()
|
|||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlMode>, StaticText<TEXT_VOLTAGE>>>(ControlMode::Voltage, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlMode>, StaticText<TEXT_VOLTAGE>>>(ControlMode::Voltage, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlMode>, StaticText<TEXT_SPEED>>>(ControlMode::Speed, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlMode>, StaticText<TEXT_SPEED>>>(ControlMode::Speed, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlMode>, StaticText<TEXT_TORQUE>>>(ControlMode::Torque, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlMode>, StaticText<TEXT_TORQUE>>>(ControlMode::Torque, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
|
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&espgui::icons::back>>>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeValueDisplay<bobbycar::protocol::ControlMode>::start()
|
void ChangeValueDisplay<bobbycar::protocol::ControlMode>::start()
|
||||||
@ -53,4 +53,4 @@ void ChangeValueDisplay<bobbycar::protocol::ControlMode>::start()
|
|||||||
setSelectedIndex(4);
|
setSelectedIndex(4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace espgui
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
#include "icons/back.h"
|
#include "icons/back.h"
|
||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
|
|
||||||
namespace {
|
namespace espgui {
|
||||||
template<>
|
template<>
|
||||||
class ChangeValueDisplay<bobbycar::protocol::ControlType> :
|
class ChangeValueDisplay<bobbycar::protocol::ControlType> :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -33,7 +33,7 @@ ChangeValueDisplay<bobbycar::protocol::ControlType>::ChangeValueDisplay()
|
|||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlType>, StaticText<TEXT_COMMUTATION>>>(ControlType::Commutation, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlType>, StaticText<TEXT_COMMUTATION>>>(ControlType::Commutation, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlType>, StaticText<TEXT_SINUSOIDAL>>>(ControlType::Sinusoidal, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlType>, StaticText<TEXT_SINUSOIDAL>>>(ControlType::Sinusoidal, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlType>, StaticText<TEXT_FIELDORIENTEDCONTROL>>>(ControlType::FieldOrientedControl, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<ControlType>, StaticText<TEXT_FIELDORIENTEDCONTROL>>>(ControlType::FieldOrientedControl, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
|
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&espgui::icons::back>>>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeValueDisplay<bobbycar::protocol::ControlType>::start()
|
void ChangeValueDisplay<bobbycar::protocol::ControlType>::start()
|
||||||
@ -51,4 +51,4 @@ void ChangeValueDisplay<bobbycar::protocol::ControlType>::start()
|
|||||||
setSelectedIndex(3);
|
setSelectedIndex(3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace espgui
|
||||||
|
@ -1,55 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
// esp-idf includes
|
|
||||||
#include <esp_log.h>
|
|
||||||
|
|
||||||
// 3rdparty lib includes
|
|
||||||
#include <espchrono.h>
|
|
||||||
|
|
||||||
// local includes
|
|
||||||
#include "changevaluedisplay.h"
|
|
||||||
#include "menudisplay.h"
|
|
||||||
#include "utils.h"
|
|
||||||
#include "actions/setvalueaction.h"
|
|
||||||
#include "actions/backproxyaction.h"
|
|
||||||
#include "icons/back.h"
|
|
||||||
#include "texts.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
template<>
|
|
||||||
class ChangeValueDisplay<espchrono::DayLightSavingMode> :
|
|
||||||
public MenuDisplay,
|
|
||||||
public virtual AccessorInterface<espchrono::DayLightSavingMode>,
|
|
||||||
public virtual ActionInterface
|
|
||||||
{
|
|
||||||
using Base = MenuDisplay;
|
|
||||||
|
|
||||||
public:
|
|
||||||
ChangeValueDisplay();
|
|
||||||
|
|
||||||
void start() override;
|
|
||||||
};
|
|
||||||
|
|
||||||
ChangeValueDisplay<espchrono::DayLightSavingMode>::ChangeValueDisplay()
|
|
||||||
{
|
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<espchrono::DayLightSavingMode>, StaticText<TEXT_NONE>>>(espchrono::DayLightSavingMode::None, *this, *this);
|
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<espchrono::DayLightSavingMode>, StaticText<TEXT_EUROPEANSUMMERTIME>>>(espchrono::DayLightSavingMode::EuropeanSummerTime, *this, *this);
|
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<espchrono::DayLightSavingMode>, StaticText<TEXT_USDAYLIGHTTIME>>>(espchrono::DayLightSavingMode::UsDaylightTime, *this, *this);
|
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChangeValueDisplay<espchrono::DayLightSavingMode>::start()
|
|
||||||
{
|
|
||||||
Base::start();
|
|
||||||
|
|
||||||
switch (const auto value = getValue())
|
|
||||||
{
|
|
||||||
case espchrono::DayLightSavingMode::None: setSelectedIndex(0); break;
|
|
||||||
case espchrono::DayLightSavingMode::EuropeanSummerTime: setSelectedIndex(1); break;
|
|
||||||
case espchrono::DayLightSavingMode::UsDaylightTime: setSelectedIndex(2); break;
|
|
||||||
default:
|
|
||||||
ESP_LOGW("BOBBY", "Unknown DayLightSavingMode: %i", int(value));
|
|
||||||
setSelectedIndex(3);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -11,7 +11,7 @@
|
|||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
#include "modes/larsmmode.h"
|
#include "modes/larsmmode.h"
|
||||||
|
|
||||||
namespace {
|
namespace espgui {
|
||||||
template<>
|
template<>
|
||||||
class ChangeValueDisplay<LarsmModeMode> :
|
class ChangeValueDisplay<LarsmModeMode> :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -32,7 +32,7 @@ ChangeValueDisplay<LarsmModeMode>::ChangeValueDisplay()
|
|||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<LarsmModeMode>, StaticText<TEXT_LARSMMODE2>>>(LarsmModeMode::Mode2, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<LarsmModeMode>, StaticText<TEXT_LARSMMODE2>>>(LarsmModeMode::Mode2, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<LarsmModeMode>, StaticText<TEXT_LARSMMODE3>>>(LarsmModeMode::Mode3, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<LarsmModeMode>, StaticText<TEXT_LARSMMODE3>>>(LarsmModeMode::Mode3, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<LarsmModeMode>, StaticText<TEXT_LARSMMODE4>>>(LarsmModeMode::Mode4, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<LarsmModeMode>, StaticText<TEXT_LARSMMODE4>>>(LarsmModeMode::Mode4, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
|
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&espgui::icons::back>>>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeValueDisplay<LarsmModeMode>::start()
|
void ChangeValueDisplay<LarsmModeMode>::start()
|
||||||
@ -50,4 +50,4 @@ void ChangeValueDisplay<LarsmModeMode>::start()
|
|||||||
setSelectedIndex(4);
|
setSelectedIndex(4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace espgui
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
// esp-idf includes
|
|
||||||
#include <esp_log.h>
|
|
||||||
|
|
||||||
// local includes
|
|
||||||
#include "changevaluedisplay.h"
|
|
||||||
#include "menudisplay.h"
|
|
||||||
#include "utils.h"
|
|
||||||
#include "actions/setvalueaction.h"
|
|
||||||
#include "actions/backproxyaction.h"
|
|
||||||
#include "icons/back.h"
|
|
||||||
#include "texts.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
template<>
|
|
||||||
class ChangeValueDisplay<sntp_sync_mode_t> :
|
|
||||||
public MenuDisplay,
|
|
||||||
public virtual AccessorInterface<sntp_sync_mode_t>,
|
|
||||||
public virtual ActionInterface
|
|
||||||
{
|
|
||||||
using Base = MenuDisplay;
|
|
||||||
|
|
||||||
public:
|
|
||||||
ChangeValueDisplay();
|
|
||||||
|
|
||||||
void start() override;
|
|
||||||
};
|
|
||||||
|
|
||||||
ChangeValueDisplay<sntp_sync_mode_t>::ChangeValueDisplay()
|
|
||||||
{
|
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<sntp_sync_mode_t>, StaticText<TEXT_IMMED>>>(SNTP_SYNC_MODE_IMMED, *this, *this);
|
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<sntp_sync_mode_t>, StaticText<TEXT_SMOOTH>>>(SNTP_SYNC_MODE_SMOOTH, *this, *this);
|
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChangeValueDisplay<sntp_sync_mode_t>::start()
|
|
||||||
{
|
|
||||||
Base::start();
|
|
||||||
|
|
||||||
switch (const auto value = getValue())
|
|
||||||
{
|
|
||||||
case SNTP_SYNC_MODE_IMMED: setSelectedIndex(0); break;
|
|
||||||
case SNTP_SYNC_MODE_SMOOTH: setSelectedIndex(1); break;
|
|
||||||
default:
|
|
||||||
ESP_LOGW("BOBBY", "Unknown sntp_sync_mode_t: %i", int(value));
|
|
||||||
setSelectedIndex(2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -11,7 +11,7 @@
|
|||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
#include "unifiedmodelmode.h"
|
#include "unifiedmodelmode.h"
|
||||||
|
|
||||||
namespace {
|
namespace espgui {
|
||||||
template<>
|
template<>
|
||||||
class ChangeValueDisplay<UnifiedModelMode> :
|
class ChangeValueDisplay<UnifiedModelMode> :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -33,7 +33,7 @@ ChangeValueDisplay<UnifiedModelMode>::ChangeValueDisplay()
|
|||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<UnifiedModelMode>, StaticText<TEXT_FOCVOLTAGE>>>(UnifiedModelMode::FocVoltage, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<UnifiedModelMode>, StaticText<TEXT_FOCVOLTAGE>>>(UnifiedModelMode::FocVoltage, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<UnifiedModelMode>, StaticText<TEXT_FOCSPEED>>>(UnifiedModelMode::FocSpeed, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<UnifiedModelMode>, StaticText<TEXT_FOCSPEED>>>(UnifiedModelMode::FocSpeed, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<UnifiedModelMode>, StaticText<TEXT_FOCTORQUE>>>(UnifiedModelMode::FocTorque, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<UnifiedModelMode>, StaticText<TEXT_FOCTORQUE>>>(UnifiedModelMode::FocTorque, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
|
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&espgui::icons::back>>>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeValueDisplay<UnifiedModelMode>::start()
|
void ChangeValueDisplay<UnifiedModelMode>::start()
|
||||||
@ -52,4 +52,4 @@ void ChangeValueDisplay<UnifiedModelMode>::start()
|
|||||||
setSelectedIndex(5);
|
setSelectedIndex(5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace espgui
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
#include "icons/back.h"
|
#include "icons/back.h"
|
||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
|
|
||||||
namespace {
|
namespace espgui {
|
||||||
template<>
|
template<>
|
||||||
class ChangeValueDisplay<wifi_mode_t> :
|
class ChangeValueDisplay<wifi_mode_t> :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -32,7 +32,7 @@ ChangeValueDisplay<wifi_mode_t>::ChangeValueDisplay()
|
|||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_mode_t>, StaticText<TEXT_WIFI_MODE_STA>>>(WIFI_MODE_STA, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_mode_t>, StaticText<TEXT_WIFI_MODE_STA>>>(WIFI_MODE_STA, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_mode_t>, StaticText<TEXT_WIFI_MODE_AP>>>(WIFI_MODE_AP, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_mode_t>, StaticText<TEXT_WIFI_MODE_AP>>>(WIFI_MODE_AP, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_mode_t>, StaticText<TEXT_WIFI_MODE_APSTA>>>(WIFI_MODE_APSTA, *this, *this);
|
constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_mode_t>, StaticText<TEXT_WIFI_MODE_APSTA>>>(WIFI_MODE_APSTA, *this, *this);
|
||||||
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
|
constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&espgui::icons::back>>>(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChangeValueDisplay<wifi_mode_t>::start()
|
void ChangeValueDisplay<wifi_mode_t>::start()
|
||||||
@ -50,4 +50,4 @@ void ChangeValueDisplay<wifi_mode_t>::start()
|
|||||||
setSelectedIndex(4);
|
setSelectedIndex(4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // namespace espgui
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "icons/back.h"
|
#include "icons/back.h"
|
||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
|
|
||||||
namespace {
|
namespace espgui {
|
||||||
//template<>
|
//template<>
|
||||||
//class ChangeValueDisplay<wifi_power_t> :
|
//class ChangeValueDisplay<wifi_power_t> :
|
||||||
// public MenuDisplay,
|
// public MenuDisplay,
|
||||||
@ -37,7 +37,7 @@ namespace {
|
|||||||
// constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_power_t>, StaticText<TEXT_WIFI_POWER_5dBm>>>(WIFI_POWER_5dBm, *this, *this);
|
// constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_power_t>, StaticText<TEXT_WIFI_POWER_5dBm>>>(WIFI_POWER_5dBm, *this, *this);
|
||||||
// constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_power_t>, StaticText<TEXT_WIFI_POWER_2dBm>>>(WIFI_POWER_2dBm, *this, *this);
|
// constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_power_t>, StaticText<TEXT_WIFI_POWER_2dBm>>>(WIFI_POWER_2dBm, *this, *this);
|
||||||
// constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_power_t>, StaticText<TEXT_WIFI_POWER_MINUS_1dBm>>>(WIFI_POWER_MINUS_1dBm, *this, *this);
|
// constructMenuItem<makeComponentArgs<MenuItem, SetValueAction<wifi_power_t>, StaticText<TEXT_WIFI_POWER_MINUS_1dBm>>>(WIFI_POWER_MINUS_1dBm, *this, *this);
|
||||||
// constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&icons::back>>>(*this);
|
// constructMenuItem<makeComponentArgs<MenuItem, BackProxyAction, StaticText<TEXT_BACK>, StaticMenuItemIcon<&espgui::icons::back>>>(*this);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//void ChangeValueDisplay<wifi_power_t>::start()
|
//void ChangeValueDisplay<wifi_power_t>::start()
|
||||||
@ -63,4 +63,4 @@ namespace {
|
|||||||
// setSelectedIndex(12);
|
// setSelectedIndex(12);
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
}
|
} // namespace espgui
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "menuitem.h"
|
|
||||||
#include "accessorinterface.h"
|
|
||||||
#include "icons/checked.h"
|
|
||||||
#include "icons/unchecked.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class CheckboxIcon : public virtual MenuItemIconInterface, public virtual AccessorInterface<bool>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
const MenuItemIcon *icon() const override
|
|
||||||
{
|
|
||||||
return getValue() ? &icons::checked : &icons::unchecked;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "TFT_eSPI.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class ColorInterface {
|
|
||||||
public:
|
|
||||||
virtual int color() const { return TFT_WHITE; };
|
|
||||||
};
|
|
||||||
|
|
||||||
template<int TColor>
|
|
||||||
class StaticColor : public virtual ColorInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static constexpr int STATIC_COLOR = TColor;
|
|
||||||
|
|
||||||
int color() const override { return TColor; }
|
|
||||||
};
|
|
||||||
|
|
||||||
using DefaultColor = StaticColor<TFT_WHITE>;
|
|
||||||
using DisabledColor = StaticColor<TFT_DARKGREY>;
|
|
||||||
|
|
||||||
class ChangeableColor : public virtual ColorInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
int color() const override { return m_color; }
|
|
||||||
void setColor(const int &color) { m_color = color; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_color;
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,69 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class TextInterface;
|
|
||||||
class MenuDisplay;
|
|
||||||
class ChangeValueDisplayInterface;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class ConfirmInterface {
|
|
||||||
public:
|
|
||||||
virtual void confirm() = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class BackInterface {
|
|
||||||
public:
|
|
||||||
virtual void back() = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
class ConfirmActionInterface : public virtual ConfirmInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void confirm() override { T{}.triggered(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
class DummyConfirm : public virtual ConfirmInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void confirm() override {}
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
class BackActionInterface : public virtual BackInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void back() override { T{}.triggered(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
class DummyBack : public virtual BackInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void back() override {}
|
|
||||||
};
|
|
||||||
|
|
||||||
class Display : public virtual ConfirmInterface, public virtual BackInterface {
|
|
||||||
public:
|
|
||||||
virtual ~Display() = default;
|
|
||||||
|
|
||||||
virtual void start() {};
|
|
||||||
virtual void initScreen() {};
|
|
||||||
virtual void update() {};
|
|
||||||
virtual void redraw() {};
|
|
||||||
virtual void stop() {}
|
|
||||||
|
|
||||||
virtual void rotate(int offset) {}
|
|
||||||
|
|
||||||
virtual TextInterface *asTextInterface() { return nullptr; }
|
|
||||||
virtual const TextInterface *asTextInterface() const { return nullptr; }
|
|
||||||
|
|
||||||
virtual MenuDisplay *asMenuDisplay() { return nullptr; }
|
|
||||||
virtual const MenuDisplay *asMenuDisplay() const { return nullptr; }
|
|
||||||
|
|
||||||
virtual ChangeValueDisplayInterface *asChangeValueDisplayInterface() { return nullptr; }
|
|
||||||
virtual const ChangeValueDisplayInterface *asChangeValueDisplayInterface() const { return nullptr; }
|
|
||||||
};
|
|
||||||
}
|
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
// 3rdparty lib includes
|
// 3rdparty lib includes
|
||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
|
#include <cpputils.h>
|
||||||
|
|
||||||
// local includes
|
// local includes
|
||||||
#include "display.h"
|
#include "display.h"
|
||||||
@ -130,12 +131,12 @@ void CalibrateDisplay::initScreen()
|
|||||||
void CalibrateDisplay::update()
|
void CalibrateDisplay::update()
|
||||||
{
|
{
|
||||||
if (raw_gas)
|
if (raw_gas)
|
||||||
m_gas = scaleBetween<float>(*raw_gas, m_gasMin, m_gasMax, 0., 1000.);
|
m_gas = cpputils::mapValueClamped<float>(*raw_gas, m_gasMin, m_gasMax, 0., 1000.);
|
||||||
else
|
else
|
||||||
m_gas = std::nullopt;
|
m_gas = std::nullopt;
|
||||||
|
|
||||||
if (raw_brems)
|
if (raw_brems)
|
||||||
m_brems = scaleBetween<float>(*raw_brems, m_bremsMin, m_bremsMax, 0., 1000.);
|
m_brems = cpputils::mapValueClamped<float>(*raw_brems, m_bremsMin, m_bremsMax, 0., 1000.);
|
||||||
else
|
else
|
||||||
m_brems = std::nullopt;
|
m_brems = std::nullopt;
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@ namespace {
|
|||||||
class SettingsMenu;
|
class SettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
constexpr char TEXT_VERSION[] = "Version: 1.0";
|
constexpr char TEXT_VERSION[] = "Version: 1.0";
|
||||||
|
|
||||||
@ -44,7 +46,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, EspSketchSizeText, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, EspSketchSizeText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, EspSketchMd5Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, EspSketchMd5Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, EspFreeSketchSpaceText, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, EspFreeSketchSpaceText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -14,6 +14,8 @@ namespace {
|
|||||||
class WifiSettingsMenu;
|
class WifiSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class AccessPointWifiSettingsMenu :
|
class AccessPointWifiSettingsMenu :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -31,7 +33,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, WifiSoftApIpV6Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, WifiSoftApIpV6Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, WifiSoftApHostnameText, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, WifiSoftApHostnameText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, WifiSoftApMacAddressText, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, WifiSoftApMacAddressText, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<WifiSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<WifiSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -16,6 +16,8 @@ namespace {
|
|||||||
class SettingsMenu;
|
class SettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BLE
|
#ifdef FEATURE_BLE
|
||||||
class BleSettingsMenu :
|
class BleSettingsMenu :
|
||||||
@ -29,7 +31,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLEENABLED>, ToggleBoolAction, CheckboxIcon, BleEnabledAccessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLEENABLED>, ToggleBoolAction, CheckboxIcon, BleEnabledAccessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, BleServerPeerDevicesText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, BleServerPeerDevicesText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, BleCharacSubscribedText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, BleCharacSubscribedText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
// local includes
|
// local includes
|
||||||
#include "changevaluedisplay.h"
|
#include "changevaluedisplay.h"
|
||||||
|
#ifdef FEATURE_BLUETOOTH
|
||||||
|
#include "changevaluedisplay_bluetoothmode.h"
|
||||||
|
#endif
|
||||||
#include "menudisplay.h"
|
#include "menudisplay.h"
|
||||||
#include "menuitem.h"
|
#include "menuitem.h"
|
||||||
#include "actions/dummyaction.h"
|
#include "actions/dummyaction.h"
|
||||||
@ -23,6 +26,8 @@ namespace {
|
|||||||
class SettingsMenu;
|
class SettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_BLUETOOTH
|
#ifdef FEATURE_BLUETOOTH
|
||||||
class BluetoothSettingsMenu;
|
class BluetoothSettingsMenu;
|
||||||
@ -54,7 +59,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLUETOOTHEND>, BluetoothEndAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLUETOOTHEND>, BluetoothEndAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLUETOOTHDISCONNECT>, BluetoothDisconnectAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BLUETOOTHDISCONNECT>, BluetoothDisconnectAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_AUTOBLUETOOTHMODE>, SwitchScreenAction<AutoBluetoothModeChangeDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_AUTOBLUETOOTHMODE>, SwitchScreenAction<AutoBluetoothModeChangeDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -23,6 +23,8 @@ namespace {
|
|||||||
class MainMenu;
|
class MainMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#if defined(FEATURE_BLUETOOTH) && defined(FEATURE_BMS)
|
#if defined(FEATURE_BLUETOOTH) && defined(FEATURE_BMS)
|
||||||
class BmsMenu :
|
class BmsMenu :
|
||||||
@ -40,7 +42,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_TURNOFFCHARGE>, BmsTurnOffChargeAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_TURNOFFCHARGE>, BmsTurnOffChargeAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_TURNONDISCHARGE>, BmsTurnOnDischargeAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_TURNONDISCHARGE>, BmsTurnOnDischargeAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_TURNOFFDISCHARGE>, BmsTurnOffDischargeAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_TURNOFFDISCHARGE>, BmsTurnOffDischargeAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -24,6 +24,8 @@ class TimersMenu;
|
|||||||
class SettingsMenu;
|
class SettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct GasText : public virtual TextInterface {
|
struct GasText : public virtual TextInterface {
|
||||||
public:
|
public:
|
||||||
@ -183,9 +185,8 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SETGAMETRAKDISTMAX>, SwitchScreenAction<GametrakDistMaxChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SETGAMETRAKDISTMAX>, SwitchScreenAction<GametrakDistMaxChangeScreen>>>();
|
||||||
#endif
|
#endif
|
||||||
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SWAPSCREENBYTES>, ToggleBoolAction, CheckboxIcon, SwapScreenBytesAccessor>>();
|
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_TIMERS>, SwitchScreenAction<TimersMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_TIMERS>, SwitchScreenAction<TimersMenu>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -19,6 +19,8 @@ class BuzzerMenu;
|
|||||||
class SettingsMenu;
|
class SettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
struct FrontFreqAccessor : public RefAccessor<uint8_t> { uint8_t &getRef() const override { return controllers.front.command.buzzer.freq; } };
|
struct FrontFreqAccessor : public RefAccessor<uint8_t> { uint8_t &getRef() const override { return controllers.front.command.buzzer.freq; } };
|
||||||
using FrontFreqChangeScreen = makeComponent<
|
using FrontFreqChangeScreen = makeComponent<
|
||||||
@ -102,7 +104,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_REVERSEBEEPFREQ1>, SwitchScreenAction<ReverseBeepFreq1ChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_REVERSEBEEPFREQ1>, SwitchScreenAction<ReverseBeepFreq1ChangeScreen>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_REVERSEBEEPDURATION0>, SwitchScreenAction<ReverseBeepDuration0ChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_REVERSEBEEPDURATION0>, SwitchScreenAction<ReverseBeepDuration0ChangeScreen>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_REVERSEBEEPDURATION1>, SwitchScreenAction<ReverseBeepDuration1ChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_REVERSEBEEPDURATION1>, SwitchScreenAction<ReverseBeepDuration1ChangeScreen>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, CloudCreatedText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, CloudCreatedText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, CloudStartedText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, CloudStartedText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, CloudConnectedText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, CloudConnectedText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -15,6 +15,8 @@ namespace {
|
|||||||
class DebugMenu;
|
class DebugMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template<const char *Ttext, typename Ttexts>
|
template<const char *Ttext, typename Ttexts>
|
||||||
class CommandDebugMenu :
|
class CommandDebugMenu :
|
||||||
@ -29,7 +31,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::BuzzerPatternText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::BuzzerPatternText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::PoweroffText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::PoweroffText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::LedText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::LedText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ class InvertMenu;
|
|||||||
class SettingsMenu;
|
class SettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using WheelDiameterMmChangeScreen = makeComponent<
|
using WheelDiameterMmChangeScreen = makeComponent<
|
||||||
ChangeValueDisplay<int16_t>,
|
ChangeValueDisplay<int16_t>,
|
||||||
@ -83,7 +85,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CANTRANSMITTIMEOUT>, SwitchScreenAction<CanTransmitTimeoutChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CANTRANSMITTIMEOUT>, SwitchScreenAction<CanTransmitTimeoutChangeScreen>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CANRECEIVETIMEOUT>, SwitchScreenAction<CanReceiveTimeoutChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CANRECEIVETIMEOUT>, SwitchScreenAction<CanReceiveTimeoutChangeScreen>>>();
|
||||||
#endif
|
#endif
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
#include "texts.h"
|
#include "texts.h"
|
||||||
#include "debugcolorhelpers.h"
|
#include "debugcolorhelpers.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
// forward declares
|
// forward declares
|
||||||
namespace {
|
namespace {
|
||||||
class MainMenu;
|
class MainMenu;
|
||||||
@ -34,6 +36,8 @@ class BackRightMotorFeedbackDebugMenu;
|
|||||||
class DynamicDebugMenu;
|
class DynamicDebugMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class DebugMenu :
|
class DebugMenu :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -64,7 +68,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACKRIGHTFEEDBACK>, SwitchScreenAction<BackRightMotorFeedbackDebugMenu>, BackFeedbackColor<TFT_WHITE>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACKRIGHTFEEDBACK>, SwitchScreenAction<BackRightMotorFeedbackDebugMenu>, BackFeedbackColor<TFT_WHITE>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, EmptyText, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DYNAMICMENU>, SwitchScreenAction<DynamicDebugMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DYNAMICMENU>, SwitchScreenAction<DynamicDebugMenu>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "menudisplay.h"
|
#include "menudisplay.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "changevaluedisplay.h"
|
#include "changevaluedisplay.h"
|
||||||
|
#include "changevaluedisplay_unifiedmodelmode.h"
|
||||||
#include "menuitem.h"
|
#include "menuitem.h"
|
||||||
#include "actions/toggleboolaction.h"
|
#include "actions/toggleboolaction.h"
|
||||||
#include "actions/switchscreenaction.h"
|
#include "actions/switchscreenaction.h"
|
||||||
@ -18,6 +19,8 @@ class DefaultModeSettingsMenu;
|
|||||||
class ModesSettingsMenu;
|
class ModesSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using DefaultModeModelModeChangeDisplay = makeComponent<
|
using DefaultModeModelModeChangeDisplay = makeComponent<
|
||||||
ChangeValueDisplay<UnifiedModelMode>,
|
ChangeValueDisplay<UnifiedModelMode>,
|
||||||
@ -103,7 +106,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_SUBBRAKEVAL, DefaultModeBrems2WertAccessor>, SwitchScreenAction<DefaultModeBrems2WertChangeDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_SUBBRAKEVAL, DefaultModeBrems2WertAccessor>, SwitchScreenAction<DefaultModeBrems2WertChangeDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_ADDGASVAL, DefaultModeGas1WertAccessor>, SwitchScreenAction<DefaultModeGas1WertChangeDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_ADDGASVAL, DefaultModeGas1WertAccessor>, SwitchScreenAction<DefaultModeGas1WertChangeDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_ADDBRAKEVAL, DefaultModeBrems1WertAccessor>, SwitchScreenAction<DefaultModeBrems1WertChangeDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_ADDBRAKEVAL, DefaultModeBrems1WertAccessor>, SwitchScreenAction<DefaultModeBrems1WertChangeDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ModesSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ModesSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -17,6 +17,8 @@ class GameOfLifeDisplay;
|
|||||||
class MainMenu;
|
class MainMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class DemosMenu :
|
class DemosMenu :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -30,7 +32,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_PINGPONG>, SwitchScreenAction<PingPongDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_PINGPONG>, SwitchScreenAction<PingPongDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SPIRO>, SwitchScreenAction<SpiroDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SPIRO>, SwitchScreenAction<SpiroDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_GAMEOFLIFE>, SwitchScreenAction<GameOfLifeDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_GAMEOFLIFE>, SwitchScreenAction<GameOfLifeDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -25,6 +25,8 @@ namespace {
|
|||||||
class DebugMenu;
|
class DebugMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class RandomText : public virtual TextInterface
|
class RandomText : public virtual TextInterface
|
||||||
{
|
{
|
||||||
@ -157,7 +159,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DUMMYITEM>, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DUMMYITEM>, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DUMMYITEM>, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DUMMYITEM>, DummyAction>>();
|
||||||
|
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -16,6 +16,8 @@ namespace {
|
|||||||
class ControllerHardwareSettingsMenu;
|
class ControllerHardwareSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class EnableMenu :
|
class EnableMenu :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -29,7 +31,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ENABLEFRONTRIGHT>, ToggleBoolAction, CheckboxIcon, FrontRightEnabledAccessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ENABLEFRONTRIGHT>, ToggleBoolAction, CheckboxIcon, FrontRightEnabledAccessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ENABLEBACKLEFT>, ToggleBoolAction, CheckboxIcon, BackLeftEnabledAccessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ENABLEBACKLEFT>, ToggleBoolAction, CheckboxIcon, BackLeftEnabledAccessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ENABLEBACKRIGHT>, ToggleBoolAction, CheckboxIcon, BackRightEnabledAccessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ENABLEBACKRIGHT>, ToggleBoolAction, CheckboxIcon, BackRightEnabledAccessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ControllerHardwareSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ControllerHardwareSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -16,6 +16,8 @@ namespace {
|
|||||||
class DebugMenu;
|
class DebugMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template<const char *Ttext, typename Ttexts, template<int> class ColorInterface>
|
template<const char *Ttext, typename Ttexts, template<int> class ColorInterface>
|
||||||
class FeedbackDebugMenu :
|
class FeedbackDebugMenu :
|
||||||
@ -31,7 +33,7 @@ public:
|
|||||||
//constructMenuItem<makeComponent<MenuItem, typename Ttexts::BoardTempText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
//constructMenuItem<makeComponent<MenuItem, typename Ttexts::BoardTempText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::BoardTempFixedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::BoardTempFixedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::TimeoutCntSerialText, StaticFont<2>, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::TimeoutCntSerialText, StaticFont<2>, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -13,6 +13,8 @@ namespace {
|
|||||||
class ModesSettingsMenu;
|
class ModesSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_GAMETRAK
|
#ifdef FEATURE_GAMETRAK
|
||||||
class ContainerModeSettingsMenu :
|
class ContainerModeSettingsMenu :
|
||||||
@ -23,7 +25,7 @@ class ContainerModeSettingsMenu :
|
|||||||
public:
|
public:
|
||||||
ContainerModeSettingsMenu()
|
ContainerModeSettingsMenu()
|
||||||
{
|
{
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ModesSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ModesSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,6 +19,8 @@ class GenericWifiSettingsMenu;
|
|||||||
class WifiSettingsMenu;
|
class WifiSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class GenericWifiSettingsMenu :
|
class GenericWifiSettingsMenu :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -28,7 +30,7 @@ class GenericWifiSettingsMenu :
|
|||||||
public:
|
public:
|
||||||
GenericWifiSettingsMenu()
|
GenericWifiSettingsMenu()
|
||||||
{
|
{
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<WifiSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<WifiSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -16,6 +16,8 @@ class MainMenu;
|
|||||||
class GraphsMenu;
|
class GraphsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using GasGraphDisplay = makeComponent<
|
using GasGraphDisplay = makeComponent<
|
||||||
GraphDisplay<1>,
|
GraphDisplay<1>,
|
||||||
@ -181,7 +183,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MOTORCURRENTS>, SwitchScreenAction<MotorCurrentsGraphDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MOTORCURRENTS>, SwitchScreenAction<MotorCurrentsGraphDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_RSSI>, SwitchScreenAction<RssiGraphDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_RSSI>, SwitchScreenAction<RssiGraphDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -16,6 +16,8 @@ namespace {
|
|||||||
class ControllerHardwareSettingsMenu;
|
class ControllerHardwareSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class InvertMenu :
|
class InvertMenu :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -29,7 +31,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_INVERTFRONTRIGHT>, ToggleBoolAction, CheckboxIcon, FrontRightInvertedAccessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_INVERTFRONTRIGHT>, ToggleBoolAction, CheckboxIcon, FrontRightInvertedAccessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_INVERTBACKLEFT>, ToggleBoolAction, CheckboxIcon, BackLeftInvertedAccessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_INVERTBACKLEFT>, ToggleBoolAction, CheckboxIcon, BackLeftInvertedAccessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_INVERTBACKRIGHT>, ToggleBoolAction, CheckboxIcon, BackRightInvertedAccessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_INVERTBACKRIGHT>, ToggleBoolAction, CheckboxIcon, BackRightInvertedAccessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ControllerHardwareSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ControllerHardwareSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
#include "menudisplay.h"
|
#include "menudisplay.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "changevaluedisplay.h"
|
#include "changevaluedisplay.h"
|
||||||
|
#include "changevaluedisplay_larsmmode_mode.h"
|
||||||
|
#include "changevaluedisplay_unifiedmodelmode.h"
|
||||||
#include "menuitem.h"
|
#include "menuitem.h"
|
||||||
#include "actions/switchscreenaction.h"
|
#include "actions/switchscreenaction.h"
|
||||||
#include "icons/back.h"
|
#include "icons/back.h"
|
||||||
@ -16,6 +18,8 @@ class LarsmModeSettingsMenu;
|
|||||||
class ModesSettingsMenu;
|
class ModesSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using LarsmModeModelModeChangeDisplay = makeComponent<
|
using LarsmModeModelModeChangeDisplay = makeComponent<
|
||||||
ChangeValueDisplay<UnifiedModelMode>,
|
ChangeValueDisplay<UnifiedModelMode>,
|
||||||
@ -50,7 +54,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MODELMODE>, SwitchScreenAction<LarsmModeModelModeChangeDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MODELMODE>, SwitchScreenAction<LarsmModeModelModeChangeDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SETMODE>, SwitchScreenAction<LarsmModeModeChangeDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SETMODE>, SwitchScreenAction<LarsmModeModeChangeDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SETITERATIONS>, SwitchScreenAction<LarsmModeIterationsChangeDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SETITERATIONS>, SwitchScreenAction<LarsmModeIterationsChangeDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ModesSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ModesSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -16,6 +16,8 @@ class LimitsSettingsMenu;
|
|||||||
class SettingsMenu;
|
class SettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using IMotMaxChangeScreen = makeComponent<
|
using IMotMaxChangeScreen = makeComponent<
|
||||||
ChangeValueDisplay<int16_t>,
|
ChangeValueDisplay<int16_t>,
|
||||||
@ -74,7 +76,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_NMOTMAX, NMotMaxRpmAccessor>, SwitchScreenAction<NMotMaxRpmChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_NMOTMAX, NMotMaxRpmAccessor>, SwitchScreenAction<NMotMaxRpmChangeScreen>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_FIELDWEAKMAX, FieldWeakMaxAccessor>, SwitchScreenAction<FieldWeakMaxChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_FIELDWEAKMAX, FieldWeakMaxAccessor>, SwitchScreenAction<FieldWeakMaxChangeScreen>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_PHASEADVMAX, PhaseAdvMaxAccessor>, SwitchScreenAction<PhaseAdvMaxChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_PHASEADVMAX, PhaseAdvMaxAccessor>, SwitchScreenAction<PhaseAdvMaxChangeScreen>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -42,6 +42,8 @@ class PoweroffDisplay;
|
|||||||
class DebugMenu;
|
class DebugMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class MainMenu :
|
class MainMenu :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -51,7 +53,7 @@ class MainMenu :
|
|||||||
public:
|
public:
|
||||||
MainMenu()
|
MainMenu()
|
||||||
{
|
{
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_STATUS>, SwitchScreenAction<StatusDisplay>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_STATUS>, SwitchScreenAction<StatusDisplay>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SELECTMODE>, SwitchScreenAction<SelectModeMenu>, StaticMenuItemIcon<&icons::modes>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SELECTMODE>, SwitchScreenAction<SelectModeMenu>, StaticMenuItemIcon<&icons::modes>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MODESETTINGS>, ModeSettingsAction>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MODESETTINGS>, ModeSettingsAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_PRESETS>, SwitchScreenAction<PresetsMenu>, StaticMenuItemIcon<&icons::presets>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_PRESETS>, SwitchScreenAction<PresetsMenu>, StaticMenuItemIcon<&icons::presets>>>();
|
||||||
|
@ -16,6 +16,8 @@ class GametrakModeSettingsMenu;
|
|||||||
class SettingsMenu;
|
class SettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class ModesSettingsMenu :
|
class ModesSettingsMenu :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -31,7 +33,7 @@ public:
|
|||||||
#ifdef FEATURE_GAMETRAK
|
#ifdef FEATURE_GAMETRAK
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_GAMETRAKMODESETTINGS>, SwitchScreenAction<GametrakModeSettingsMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_GAMETRAKMODESETTINGS>, SwitchScreenAction<GametrakModeSettingsMenu>>>();
|
||||||
#endif
|
#endif
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -16,6 +16,8 @@ namespace {
|
|||||||
class MainMenu;
|
class MainMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_MOSFETS
|
#ifdef FEATURE_MOSFETS
|
||||||
template<pin_t PIN>
|
template<pin_t PIN>
|
||||||
@ -41,7 +43,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MOSFET0>, ToggleBoolAction, CheckboxIcon, Mosfet0Accessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MOSFET0>, ToggleBoolAction, CheckboxIcon, Mosfet0Accessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MOSFET1>, ToggleBoolAction, CheckboxIcon, Mosfet1Accessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MOSFET1>, ToggleBoolAction, CheckboxIcon, Mosfet1Accessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MOSFET2>, ToggleBoolAction, CheckboxIcon, Mosfet2Accessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MOSFET2>, ToggleBoolAction, CheckboxIcon, Mosfet2Accessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@ -16,6 +16,8 @@ namespace {
|
|||||||
class DebugMenu;
|
class DebugMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template<const char *Ttext, typename Ttexts, template<int> class ColorInterface>
|
template<const char *Ttext, typename Ttexts, template<int> class ColorInterface>
|
||||||
class MotorFeedbackDebugMenu :
|
class MotorFeedbackDebugMenu :
|
||||||
@ -40,7 +42,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaCFixedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::DcPhaCFixedText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::ChopsText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::ChopsText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::HallText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::HallText, ColorInterface<TFT_DARKGREY>, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15,6 +15,8 @@ namespace {
|
|||||||
class DebugMenu;
|
class DebugMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template<const char *Ttext, typename Ttexts>
|
template<const char *Ttext, typename Ttexts>
|
||||||
class MotorStateDebugMenu :
|
class MotorStateDebugMenu :
|
||||||
@ -36,7 +38,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::PhaseAdvMaxText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::PhaseAdvMaxText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::CruiseCtrlEnaText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::CruiseCtrlEnaText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, typename Ttexts::NCruiseMotTgtText, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, typename Ttexts::NCruiseMotTgtText, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<DebugMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@ namespace {
|
|||||||
class MainMenu;
|
class MainMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class ApplyPresetAction : public virtual ActionInterface
|
class ApplyPresetAction : public virtual ActionInterface
|
||||||
{
|
{
|
||||||
@ -92,7 +94,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SINUSOIDALDEFAULTMODE>, MultiAction<ApplyDefaultModePresetAction<&presets::sinusoidalDefaultMode>, SwitchScreenAction<MainMenu>>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_SINUSOIDALDEFAULTMODE>, MultiAction<ApplyDefaultModePresetAction<&presets::sinusoidalDefaultMode>, SwitchScreenAction<MainMenu>>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DEFAULTTEMPOMATMODE>, MultiAction<ApplyTempomatModePresetAction<&presets::defaultTempomatMode>, SwitchScreenAction<MainMenu>>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DEFAULTTEMPOMATMODE>, MultiAction<ApplyTempomatModePresetAction<&presets::defaultTempomatMode>, SwitchScreenAction<MainMenu>>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DEFAULTLARSMMODE>, MultiAction<ApplyLarsmModePresetAction<&presets::defaultLarsmMode>, SwitchScreenAction<MainMenu>>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DEFAULTLARSMMODE>, MultiAction<ApplyLarsmModePresetAction<&presets::defaultLarsmMode>, SwitchScreenAction<MainMenu>>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -12,6 +12,8 @@ namespace {
|
|||||||
class MainMenu;
|
class MainMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class ProfilesMenu :
|
class ProfilesMenu :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -25,7 +27,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_PROFILE1>, SwitchProfileAction<1>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_PROFILE1>, SwitchProfileAction<1>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_PROFILE2>, SwitchProfileAction<2>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_PROFILE2>, SwitchProfileAction<2>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_PROFILE3>, SwitchProfileAction<3>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_PROFILE3>, SwitchProfileAction<3>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -20,6 +20,8 @@ namespace {
|
|||||||
class MainMenu;
|
class MainMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
template<typename T1, T1 &target, typename T2, T2 value>
|
template<typename T1, T1 &target, typename T2, T2 value>
|
||||||
class SetterAction : public ActionInterface
|
class SetterAction : public ActionInterface
|
||||||
@ -52,7 +54,7 @@ public:
|
|||||||
#ifdef FEATURE_GAMETRAK
|
#ifdef FEATURE_GAMETRAK
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_GAMETRAK>, MultiAction<SetGametrakModeAction, SwitchScreenAction<MainMenu>>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_GAMETRAK>, MultiAction<SetGametrakModeAction, SwitchScreenAction<MainMenu>>>>();
|
||||||
#endif
|
#endif
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void start() override;
|
void start() override;
|
||||||
|
@ -35,6 +35,8 @@ class AboutMenu;
|
|||||||
class MainMenu;
|
class MainMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
#ifdef FEATURE_LEDBACKLIGHT
|
#ifdef FEATURE_LEDBACKLIGHT
|
||||||
struct BacklightAccessor : public virtual AccessorInterface<bool>
|
struct BacklightAccessor : public virtual AccessorInterface<bool>
|
||||||
@ -79,7 +81,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_FRONTLED>, ToggleBoolAction, CheckboxIcon, FrontLedAccessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_FRONTLED>, ToggleBoolAction, CheckboxIcon, FrontLedAccessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACKLED>, ToggleBoolAction, CheckboxIcon, BackLedAccessor>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACKLED>, ToggleBoolAction, CheckboxIcon, BackLedAccessor>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ABOUT>, SwitchScreenAction<AboutMenu>, StaticMenuItemIcon<&icons::info>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ABOUT>, SwitchScreenAction<AboutMenu>, StaticMenuItemIcon<&icons::info>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<MainMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -22,6 +22,8 @@ class WifiScanMenu;
|
|||||||
class WifiSettingsMenu;
|
class WifiSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class StationWifiSettingsMenu :
|
class StationWifiSettingsMenu :
|
||||||
public MenuDisplay,
|
public MenuDisplay,
|
||||||
@ -52,7 +54,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, WifiDns0Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, WifiDns0Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, WifiDns1Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, WifiDns1Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, WifiDns2Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, WifiDns2Text, StaticFont<2>, DisabledColor, DummyAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<WifiSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<WifiSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "menudisplay.h"
|
#include "menudisplay.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "changevaluedisplay.h"
|
#include "changevaluedisplay.h"
|
||||||
|
#include "changevaluedisplay_unifiedmodelmode.h"
|
||||||
#include "menuitem.h"
|
#include "menuitem.h"
|
||||||
#include "actions/switchscreenaction.h"
|
#include "actions/switchscreenaction.h"
|
||||||
#include "icons/back.h"
|
#include "icons/back.h"
|
||||||
@ -18,6 +19,8 @@ class TempomatModeSettingsMenu;
|
|||||||
class ModesSettingsMenu;
|
class ModesSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
using DefaultModeCruiseMotTgtChangeDisplay = makeComponent<
|
using DefaultModeCruiseMotTgtChangeDisplay = makeComponent<
|
||||||
ChangeValueDisplay<int16_t>,
|
ChangeValueDisplay<int16_t>,
|
||||||
@ -46,7 +49,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_APPLY, AvgSpeedAccessor>, TempomatModeApplyCurrentSpeedAction>>();
|
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_APPLY, AvgSpeedAccessor>, TempomatModeApplyCurrentSpeedAction>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_NCRUISEMOTTGT, TempomatModeCruiseMotTgtAccessor>, SwitchScreenAction<TempomatModeModelModeChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_NCRUISEMOTTGT, TempomatModeCruiseMotTgtAccessor>, SwitchScreenAction<TempomatModeModelModeChangeScreen>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MODELMODE>, SwitchScreenAction<TempomatModeModelModeChangeScreen>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_MODELMODE>, SwitchScreenAction<TempomatModeModelModeChangeScreen>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ModesSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<ModesSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -14,6 +14,8 @@ namespace {
|
|||||||
class BoardcomputerHardwareSettingsMenu;
|
class BoardcomputerHardwareSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class TimersMenu;
|
class TimersMenu;
|
||||||
|
|
||||||
@ -96,7 +98,7 @@ public:
|
|||||||
#ifdef FEATURE_CLOUD
|
#ifdef FEATURE_CLOUD
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CLOUDSENDRATE>, SwitchScreenAction<CloudSendRateChangeDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_CLOUDSENDRATE>, SwitchScreenAction<CloudSendRateChangeDisplay>>>();
|
||||||
#endif
|
#endif
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<BoardcomputerHardwareSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<BoardcomputerHardwareSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
#include <fmt/core.h>
|
#include <fmt/core.h>
|
||||||
|
|
||||||
// local includes
|
// local includes
|
||||||
|
#include "changevaluedisplay.h"
|
||||||
|
#include "changevaluedisplay_daylightsavingmode.h"
|
||||||
|
#include "changevaluedisplay_sntp_sync_mode_t.h"
|
||||||
#include "menudisplay.h"
|
#include "menudisplay.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include "actions/toggleboolaction.h"
|
#include "actions/toggleboolaction.h"
|
||||||
@ -21,6 +24,8 @@ class SettingsMenu;
|
|||||||
class TimeSettingsMenu;
|
class TimeSettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class CurrentUtcDateTimeText : public virtual TextInterface { public:
|
class CurrentUtcDateTimeText : public virtual TextInterface { public:
|
||||||
std::string text() const override { return fmt::format("utc: {}", espchrono::toString(espchrono::toDateTime(espchrono::utc_clock::now()))); }};
|
std::string text() const override { return fmt::format("utc: {}", espchrono::toString(espchrono::toDateTime(espchrono::utc_clock::now()))); }};
|
||||||
@ -84,7 +89,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_NTPINTERVAL>, SwitchScreenAction<TimeSyncIntervalChangeDisplay>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_NTPINTERVAL>, SwitchScreenAction<TimeSyncIntervalChangeDisplay>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, NtpSyncStatusText, DummyAction>>();
|
constructMenuItem<makeComponent<MenuItem, NtpSyncStatusText, DummyAction>>();
|
||||||
#endif
|
#endif
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -27,6 +27,7 @@ class StationWifiSettingsMenu;
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
using namespace std::chrono_literals;
|
using namespace std::chrono_literals;
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class WifiScanMenu : public MenuDisplay, public BackActionInterface<SwitchScreenAction<StationWifiSettingsMenu>>
|
class WifiScanMenu : public MenuDisplay, public BackActionInterface<SwitchScreenAction<StationWifiSettingsMenu>>
|
||||||
@ -50,7 +51,7 @@ private:
|
|||||||
|
|
||||||
WifiScanMenu::WifiScanMenu()
|
WifiScanMenu::WifiScanMenu()
|
||||||
{
|
{
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<StationWifiSettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<StationWifiSettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string WifiScanMenu::text() const
|
std::string WifiScanMenu::text() const
|
||||||
|
@ -15,6 +15,8 @@ class AccessPointWifiSettingsMenu;
|
|||||||
class SettingsMenu;
|
class SettingsMenu;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class WifiSettingsMenu;
|
class WifiSettingsMenu;
|
||||||
|
|
||||||
@ -29,7 +31,7 @@ public:
|
|||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_GENERICWIFISETTINGS>, SwitchScreenAction<GenericWifiSettingsMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_GENERICWIFISETTINGS>, SwitchScreenAction<GenericWifiSettingsMenu>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_STATIONWIFISETTINGS>, SwitchScreenAction<StationWifiSettingsMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_STATIONWIFISETTINGS>, SwitchScreenAction<StationWifiSettingsMenu>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ACCESSPOINTWIFISETTINGS>, SwitchScreenAction<AccessPointWifiSettingsMenu>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ACCESSPOINTWIFISETTINGS>, SwitchScreenAction<AccessPointWifiSettingsMenu>>>();
|
||||||
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&icons::back>>>();
|
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_BACK>, SwitchScreenAction<SettingsMenu>, StaticMenuItemIcon<&espgui::icons::back>>>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -279,9 +279,9 @@ void StatusDisplay::BoardStatus::redraw(const Controller &controller)
|
|||||||
tft.drawString("No data!", 60, m_y+50, 4);
|
tft.drawString("No data!", 60, m_y+50, 4);
|
||||||
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||||
|
|
||||||
tft.setSwapBytes(!settings.boardcomputerHardware.swapScreenBytes);
|
tft.setSwapBytes(true);
|
||||||
tft.pushImage(10, m_y+40, icons::alert.WIDTH, icons::alert.HEIGHT, icons::alert.buffer);
|
tft.pushImage(10, m_y+40, icons::alert.WIDTH, icons::alert.HEIGHT, icons::alert.buffer);
|
||||||
tft.setSwapBytes(settings.boardcomputerHardware.swapScreenBytes);
|
tft.setSwapBytes(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastFeedbackValid = controller.feedbackValid;
|
m_lastFeedbackValid = controller.feedbackValid;
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class FontInterface {
|
|
||||||
public:
|
|
||||||
virtual int font() const { return 4; };
|
|
||||||
};
|
|
||||||
|
|
||||||
template<int TFont>
|
|
||||||
class StaticFont : public virtual FontInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static constexpr int STATIC_FONT = TFont;
|
|
||||||
|
|
||||||
int font() const override { return TFont; }
|
|
||||||
};
|
|
||||||
|
|
||||||
using DefaultFont = StaticFont<4>;
|
|
||||||
|
|
||||||
class ChangeableFont : public virtual FontInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
int font() const override { return m_font; }
|
|
||||||
void setfont(const int &font) { m_font = font; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_font;
|
|
||||||
};
|
|
||||||
}
|
|
@ -27,6 +27,8 @@
|
|||||||
#include "settingspersister.h"
|
#include "settingspersister.h"
|
||||||
#include "macros_bobbycar.h"
|
#include "macros_bobbycar.h"
|
||||||
|
|
||||||
|
using namespace espgui;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
std::optional<int16_t> raw_gas, raw_brems;
|
std::optional<int16_t> raw_gas, raw_brems;
|
||||||
std::optional<float> gas, brems;
|
std::optional<float> gas, brems;
|
||||||
@ -43,8 +45,6 @@ Settings settings;
|
|||||||
StringSettings stringSettings;
|
StringSettings stringSettings;
|
||||||
SettingsPersister settingsPersister;
|
SettingsPersister settingsPersister;
|
||||||
|
|
||||||
constexpr auto TFT_GREY = 0x5AEB;
|
|
||||||
|
|
||||||
class Controllers : public std::array<Controller, 2>
|
class Controllers : public std::array<Controller, 2>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -86,8 +86,6 @@ struct {
|
|||||||
BluetoothSerial bluetoothSerial;
|
BluetoothSerial bluetoothSerial;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TFT_eSPI tft = TFT_eSPI();
|
|
||||||
|
|
||||||
ModeInterface *lastMode{};
|
ModeInterface *lastMode{};
|
||||||
ModeInterface *currentMode{};
|
ModeInterface *currentMode{};
|
||||||
|
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "icon.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
template<uint16_t width, uint16_t height>
|
|
||||||
class IconInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual const Icon<width, height> *icon() const { return nullptr; }
|
|
||||||
};
|
|
||||||
|
|
||||||
template<uint16_t width, uint16_t height, const Icon<width, height> *T>
|
|
||||||
class StaticIcon : public virtual IconInterface<width, height>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual const Icon<width, height> *icon() const { return T; }
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "icon.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
namespace icons {
|
|
||||||
const Icon<24, 24> back{{
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x016C, 0x014B, 0x010B, 0x01AC, 0x018C, 0x018C, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0010 (16) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x014B, 0x0009, 0x0000, // 0x0020 (32) pixels
|
|
||||||
0x2AD0, 0x3331, 0x00CB, 0x09CD, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0030 (48) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x012B, 0x0007, 0x0000, 0x1A6F, 0x5CD7, 0x5C96, 0x0003, 0x09ED, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0040 (64) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x010B, 0x0006, 0xFFFF, 0x022F, 0x6518, // 0x0050 (80) pixels
|
|
||||||
0x75FB, 0x5C96, 0x0000, 0x1AB0, 0x2312, 0x22F1, 0x1AB0, 0x1A6F, 0x0A0E, 0x016C, 0x0048, 0x00EA, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0060 (96) pixels
|
|
||||||
0x0000, 0x0000, 0x010A, 0x0029, 0x0000, 0x022F, 0x6538, 0x761B, 0x761B, 0x5CD7, 0x024F, 0x22D0, 0x22D0, 0x1AB0, 0x1A6F, 0x124F, // 0x0070 (112) pixels
|
|
||||||
0x01CD, 0x002A, 0x0000, 0x018C, 0x0007, 0x014B, 0x0000, 0x0000, 0x0002, 0x0003, 0x0A2E, 0x0000, 0x1A90, 0x6518, 0x7E3C, 0x761C, // 0x0080 (128) pixels
|
|
||||||
0x761C, 0x6E1C, 0x65BB, 0x5D9A, 0x5D7A, 0x5539, 0x54F8, 0x4CB7, 0x4C76, 0x3BD4, 0x2B11, 0x1A6F, 0x016C, 0x43F5, 0x012B, 0x00A6, // 0x0090 (144) pixels
|
|
||||||
0x0006, 0x024F, 0x0000, 0x22F1, 0x6518, 0x7E3C, 0x7E5C, 0x765C, 0x765C, 0x6E3C, 0x661C, 0x65FC, 0x5DBB, 0x559A, 0x4D5A, 0x44F9, // 0x00A0 (160) pixels
|
|
||||||
0x44D8, 0x3C97, 0x4456, 0x3BD4, 0x2AF1, 0x09CD, 0x5D7C, 0x00AA, 0x022F, 0x0000, 0x2AF1, 0x6518, 0x863C, 0x7E3C, 0x6E3C, 0x663C, // 0x00B0 (176) pixels
|
|
||||||
0x663D, 0x5E3D, 0x5E1C, 0x5DFC, 0x55DB, 0x559B, 0x4D5A, 0x4519, 0x3CB8, 0x3477, 0x3436, 0x33F5, 0x3BD4, 0x2AF1, 0x018C, 0x0000, // 0x00C0 (192) pixels
|
|
||||||
0x014B, 0x22B0, 0x54B7, 0x5D9A, 0x4D7A, 0x3D7B, 0x357B, 0x2D9C, 0x2DDC, 0x2DDC, 0x2DBC, 0x2D7B, 0x355A, 0x3D5A, 0x453A, 0x4519, // 0x00D0 (208) pixels
|
|
||||||
0x3CD8, 0x3477, 0x3436, 0x2BD5, 0x2BB5, 0x3394, 0x1A6F, 0x014C, 0x016B, 0x1A90, 0x3436, 0x24D9, 0x14D9, 0x1D1A, 0x1D5B, 0x1D9C, // 0x00E0 (224) pixels
|
|
||||||
0x25DD, 0x25DD, 0x1D9C, 0x1D5B, 0x1D1A, 0x1CD9, 0x1CB8, 0x2CB8, 0x3CB8, 0x3477, 0x2C36, 0x2BD5, 0x2394, 0x33D5, 0x22F1, 0x11CC, // 0x00F0 (240) pixels
|
|
||||||
0x022F, 0x0004, 0x1AD0, 0x2C57, 0x24F9, 0x1D1A, 0x1D5B, 0x1D7C, 0x1DBC, 0x25BC, 0x1D9C, 0x1D5B, 0x1D1A, 0x1CD9, 0x1C98, 0x1457, // 0x0100 (256) pixels
|
|
||||||
0x1C37, 0x2C36, 0x2C16, 0x23D5, 0x2394, 0x23B5, 0x2B32, 0x11CD, 0x0000, 0x0A0E, 0x0000, 0x22F1, 0x2C77, 0x251A, 0x1D3A, 0x1D5B, // 0x0110 (272) pixels
|
|
||||||
0x1D7B, 0x1D7B, 0x1D5B, 0x1D3A, 0x1CFA, 0x1CB9, 0x1C78, 0x1457, 0x1416, 0x13D5, 0x23D5, 0x23B5, 0x1B94, 0x1B94, 0x2B52, 0x11ED, // 0x0120 (288) pixels
|
|
||||||
0x0023, 0x0000, 0x0A4F, 0x0000, 0x22F1, 0x3497, 0x251A, 0x1D1A, 0x1D3A, 0x2D5B, 0x2D3A, 0x2D1A, 0x24F9, 0x24D9, 0x1478, 0x1437, // 0x0130 (304) pixels
|
|
||||||
0x13F6, 0x13B5, 0x1394, 0x1B74, 0x1B74, 0x1B94, 0x2B52, 0x11ED, 0x0000, 0x0087, 0x0000, 0x124F, 0x0000, 0x1AB0, 0x3497, 0x1D1A, // 0x0140 (320) pixels
|
|
||||||
0x1CFA, 0x3497, 0x1B32, 0x2373, 0x2393, 0x2BD4, 0x3415, 0x2C57, 0x13F6, 0x1395, 0x1374, 0x1353, 0x1354, 0x2394, 0x2B32, 0x11ED, // 0x0150 (336) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x00EA, 0x00EA, 0x0000, 0x126F, 0x3497, 0x24D9, 0x3435, 0x0000, 0x1270, 0x0000, 0x0029, 0x01AC, 0x22F1, // 0x0160 (352) pixels
|
|
||||||
0x33F5, 0x1395, 0x1354, 0x1333, 0x0B33, 0x2394, 0x22F1, 0x22B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x010B, 0x0008, 0x0000, 0x1A6F, // 0x0170 (368) pixels
|
|
||||||
0x3477, 0x3435, 0x0006, 0x09ED, 0x0027, 0x00EA, 0x01AC, 0x0000, 0x22B0, 0x2BB4, 0x0B33, 0x1333, 0x0B34, 0x2B73, 0x22B0, 0x09AD, // 0x0180 (384) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x012B, 0x0009, 0x0000, 0x1A90, 0x3352, 0x004A, 0x09CD, 0x0000, 0x0000, 0x010A, 0x012B, // 0x0190 (400) pixels
|
|
||||||
0x09CD, 0x2B53, 0x1354, 0x0B33, 0x1B54, 0x2B32, 0x228F, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x014B, 0x010B, // 0x01A0 (416) pixels
|
|
||||||
0x0007, 0x018D, 0x01AC, 0x01AC, 0x0000, 0x0000, 0x0000, 0x014B, 0x09CD, 0x2B32, 0x1374, 0x0B33, 0x2353, 0x2AF1, 0x08EA, 0x1A0D, // 0x01B0 (432) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01AD, 0x09ED, 0x00CA, 0x018C, 0x018C, 0x0000, 0x0000, 0x0000, 0x018C, // 0x01C0 (448) pixels
|
|
||||||
0x09ED, 0x2B53, 0x1354, 0x1B53, 0x2B32, 0x224E, 0x2B11, 0x0800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x01D0 (464) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x00A8, 0x09ED, 0x122E, 0x2B73, 0x1B54, 0x2B53, 0x32D0, 0x43D4, 0x0004, 0x0000, // 0x01E0 (480) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0049, 0x451B, // 0x01F0 (496) pixels
|
|
||||||
0x1AB0, 0x2BB4, 0x2B53, 0x32F0, 0x5D3A, 0x0008, 0x00C9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0200 (512) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x018C, 0x010B, 0x3332, 0x3393, 0x2AD0, 0x873F, 0x012B, 0x11ED, 0x0000, 0x0000, // 0x0210 (528) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0109, 0x01AD, 0x018C, // 0x0220 (544) pixels
|
|
||||||
0x22B0, 0x32F0, 0x761E, 0x016C, 0x1A2E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0230 (560) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x014B, 0x018C, 0x018C, 0x09CD, 0x4C77, 0x012B, 0x1A0E, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels
|
|
||||||
}};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "icon.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
namespace icons {
|
|
||||||
const Icon<24, 24> checked{{
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0010 (16) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0020 (32) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0030 (48) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0040 (64) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2945, 0x6B4D, 0x5AEB, 0x5AEB, // 0x0050 (80) pixels
|
|
||||||
0x5AEB, 0x5AEB, 0x5AEB, 0x5AEB, 0x5AEB, 0x5AEB, 0x5AEB, 0x8BF1, 0x0240, 0x01E0, 0x02C0, 0x0280, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0060 (96) pixels
|
|
||||||
0x0000, 0x0000, 0xA514, 0xA534, 0xA534, 0xBDD7, 0xBDF7, 0xBDF7, 0xBDF7, 0xBDF7, 0xBDF7, 0xBDF7, 0xBDF7, 0xBDF7, 0xBDF7, 0x8C91, // 0x0070 (112) pixels
|
|
||||||
0x3807, 0x0000, 0x0000, 0x0260, 0x0260, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xC618, 0xBDD7, 0xCE59, 0xAD75, 0xB596, 0xB596, // 0x0080 (128) pixels
|
|
||||||
0xB596, 0xB596, 0xAD75, 0xAD75, 0xAD75, 0xB596, 0xAD75, 0x9CD3, 0x0300, 0x8E31, 0x00E0, 0x0240, 0x0260, 0x0000, 0x0000, 0x0000, // 0x0090 (144) pixels
|
|
||||||
0x0000, 0x8431, 0xA534, 0xA514, 0xA534, 0xAD75, 0xAD75, 0xAD75, 0xAD75, 0xAD75, 0xAD75, 0xAD55, 0xAD75, 0xAD75, 0xA554, 0x5BEB, // 0x00A0 (160) pixels
|
|
||||||
0x4508, 0xBF77, 0x1C43, 0x0240, 0x01C0, 0x02C0, 0x0000, 0x0000, 0x0000, 0x8C51, 0xFFFF, 0x9492, 0xCE59, 0xF7BE, 0xFFBF, 0xF79E, // 0x00B0 (176) pixels
|
|
||||||
0xF79E, 0xF79E, 0xEF7D, 0xEF7D, 0xF7BE, 0xEF9D, 0x8D51, 0x34E6, 0xA6F4, 0xA734, 0xA6F4, 0x54EA, 0x02E0, 0x0240, 0x0000, 0x0000, // 0x00C0 (192) pixels
|
|
||||||
0x0000, 0x7BCF, 0x0000, 0x8C72, 0x7C8F, 0x6CCD, 0xC698, 0xF79E, 0xEF7D, 0xEF7D, 0xEF5D, 0xF79E, 0xF79E, 0x8510, 0x34C6, 0x9EB3, // 0x00D0 (208) pixels
|
|
||||||
0x9692, 0x9672, 0x9692, 0x44C8, 0x02E0, 0x0220, 0x0000, 0x0000, 0x0160, 0x632C, 0x02A0, 0x3B27, 0x3426, 0x8E30, 0x23C4, 0xCEB9, // 0x00E0 (224) pixels
|
|
||||||
0xF77E, 0xEF7D, 0xF79E, 0xF79E, 0x8D51, 0x2463, 0x8E51, 0x8630, 0x8610, 0x8610, 0x44A8, 0x02A0, 0x0160, 0x0000, 0x0000, 0x0000, // 0x00F0 (240) pixels
|
|
||||||
0x0240, 0x02A0, 0x0260, 0x1BA3, 0x75AD, 0x860F, 0x656B, 0x4C29, 0xCED9, 0xF7BE, 0xEF7D, 0x8D31, 0x2C24, 0x7E0E, 0x7DEE, 0x7DCE, // 0x0100 (256) pixels
|
|
||||||
0x7DCE, 0x4CA9, 0x02A0, 0x1843, 0x0220, 0x0280, 0x0000, 0x0000, 0x0240, 0x0000, 0x0321, 0x6D6B, 0x75AC, 0x75AC, 0x75EC, 0x654A, // 0x0110 (272) pixels
|
|
||||||
0x33A6, 0xCED9, 0x9D73, 0x3C26, 0x7E0D, 0x75CC, 0x75AC, 0x6D8C, 0x5CEA, 0x2AE5, 0x634D, 0x2288, 0x7BCE, 0x0000, 0x0000, 0x0000, // 0x0120 (288) pixels
|
|
||||||
0x0260, 0x0220, 0x0200, 0x1361, 0x6549, 0x658A, 0x6DCA, 0x760B, 0x5CE8, 0x02E0, 0x33C4, 0x760B, 0x6DCA, 0x6DCA, 0x6DAA, 0x7D6D, // 0x0130 (304) pixels
|
|
||||||
0x646C, 0x6B6D, 0x6B6E, 0x8C4E, 0x52AD, 0x0000, 0x0000, 0x0000, 0x0200, 0x5B0B, 0x0220, 0x2A85, 0x2B83, 0x6568, 0x5DC8, 0x65E8, // 0x0140 (320) pixels
|
|
||||||
0x7649, 0x6D49, 0x75EA, 0x6E09, 0x65C8, 0x65A9, 0x6CEB, 0x3BA8, 0xE75C, 0x7BD0, 0x634D, 0x73B1, 0x5ACA, 0x0000, 0x0000, 0x0000, // 0x0150 (336) pixels
|
|
||||||
0x0000, 0x5AAD, 0x000A, 0x630D, 0x5BCB, 0x2344, 0x65A6, 0x4D84, 0x55C4, 0x4DC4, 0x4DA3, 0x4D83, 0x4563, 0x4463, 0x1B83, 0xE73C, // 0x0160 (352) pixels
|
|
||||||
0xFFDF, 0x7BF0, 0x6B4D, 0x7BEE, 0x52AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x630E, 0x0010, 0x5AEC, 0xCE79, 0x9DB3, 0x1300, 0x5DC3, // 0x0170 (368) pixels
|
|
||||||
0x4E01, 0x4E22, 0x4E21, 0x4E02, 0x5D24, 0x4388, 0xE73C, 0xF79E, 0xFFDF, 0x8410, 0x6B6E, 0x840D, 0x630E, 0x0000, 0x0000, 0x0000, // 0x0180 (384) pixels
|
|
||||||
0x0000, 0x73AE, 0x8C6A, 0x630D, 0xC638, 0xFFFF, 0xADF5, 0x0B60, 0x6664, 0x56A1, 0x66C3, 0x5503, 0x3B48, 0xDF3B, 0xF7BE, 0xF79E, // 0x0190 (400) pixels
|
|
||||||
0xFFDF, 0x8431, 0x73AF, 0x6B4F, 0x73AE, 0x0000, 0x0000, 0x0000, 0x0000, 0x738D, 0x5280, 0x6B4D, 0xC638, 0xFFFF, 0xFFFF, 0xA5D4, // 0x01A0 (416) pixels
|
|
||||||
0x1280, 0x7F45, 0x5D83, 0x0300, 0xEF9D, 0xFFFF, 0xFFDF, 0xF7BE, 0xFFFF, 0x8C51, 0x7BCF, 0x7BF2, 0x738D, 0x0000, 0x0000, 0x0000, // 0x01B0 (432) pixels
|
|
||||||
0x0000, 0x738D, 0x0000, 0x6B6E, 0xC638, 0xFFFF, 0xFFFF, 0xFFFF, 0x9572, 0x32A5, 0x53C9, 0xEF9D, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, // 0x01C0 (448) pixels
|
|
||||||
0xFFFF, 0x8C72, 0x7BF0, 0x8C53, 0x738D, 0x0000, 0x0000, 0x0000, 0x0000, 0x7BD0, 0xA510, 0x7BCF, 0xA535, 0xCE59, 0xCE59, 0xCE59, // 0x01D0 (464) pixels
|
|
||||||
0xCE79, 0x84B0, 0xADB5, 0xCE59, 0xCE59, 0xCE59, 0xCE59, 0xCE59, 0xC638, 0x8C51, 0x8410, 0x8430, 0x7BD0, 0x0000, 0x0000, 0x0000, // 0x01E0 (480) pixels
|
|
||||||
0x0000, 0x8C71, 0x8431, 0x8431, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x8410, 0x83F0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, // 0x01F0 (496) pixels
|
|
||||||
0x7BF0, 0x8410, 0x8C51, 0x8431, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9CD3, 0x9492, 0xB593, 0x9493, 0x9491, 0x94B1, // 0x0200 (512) pixels
|
|
||||||
0x94B1, 0x94B1, 0x94B1, 0x94B1, 0x94B1, 0x94B1, 0x94B1, 0x9491, 0x9CF3, 0x4200, 0x8430, 0x9492, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0210 (528) pixels
|
|
||||||
0x0000, 0x0020, 0x0000, 0x630D, 0x8C71, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, // 0x0220 (544) pixels
|
|
||||||
0x8C71, 0x8410, 0x8C51, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0230 (560) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels
|
|
||||||
}};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "icon.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
namespace icons {
|
|
||||||
const Icon<24, 24> unchecked{{
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0010 (16) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0020 (32) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0030 (48) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0040 (64) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2945, 0x6B4D, 0x5AEB, 0x5AEB, // 0x0050 (80) pixels
|
|
||||||
0x5AEB, 0x5AEB, 0x5AEB, 0x5AEB, 0x2124, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0060 (96) pixels
|
|
||||||
0x0000, 0x0000, 0xA514, 0xA534, 0xA534, 0xBDD7, 0xBDF7, 0xBDF7, 0xBDF7, 0xBDF7, 0xBDD7, 0xB5B6, 0xB5B6, 0x31A6, 0x31A6, 0x39E7, // 0x0070 (112) pixels
|
|
||||||
0x0180, 0x0000, 0x11E3, 0x4269, 0x4229, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xC618, 0xBDD7, 0xCE59, 0xAD75, 0xB596, 0xB596, // 0x0080 (128) pixels
|
|
||||||
0xB596, 0xB596, 0xAD75, 0xAD55, 0xA514, 0xA514, 0xA514, 0xA514, 0xA514, 0x8C71, 0x8C51, 0x5B0C, 0x4AC9, 0x0000, 0x0000, 0x0000, // 0x0090 (144) pixels
|
|
||||||
0x0000, 0x8431, 0xA534, 0xA514, 0xA534, 0xAD75, 0xAD75, 0xAD75, 0xAD75, 0xAD75, 0xAD75, 0xAD75, 0xAD75, 0xAD75, 0xAD75, 0xAD75, // 0x00A0 (160) pixels
|
|
||||||
0xB596, 0x8C71, 0x8431, 0x5BCC, 0x2A85, 0x52AC, 0x0000, 0x0000, 0x0000, 0x8C51, 0xFFFF, 0x9492, 0xC638, 0xF7BE, 0xFFDF, 0xFFDF, // 0x00B0 (176) pixels
|
|
||||||
0xF7BE, 0xF7BE, 0xFFDF, 0xF7BE, 0xF7DE, 0xF7BE, 0xFFDF, 0xFFDF, 0xFFFF, 0x8C51, 0x6B6E, 0x538A, 0x2A85, 0x528C, 0x0000, 0x0000, // 0x00C0 (192) pixels
|
|
||||||
0x5ACB, 0x52AA, 0xFFFF, 0x8451, 0xC638, 0xF7BE, 0xF7BE, 0xF7BE, 0xF79E, 0xF79E, 0xF79E, 0xF7BE, 0xF7BE, 0xF79E, 0xF7BE, 0xF7BE, // 0x00D0 (208) pixels
|
|
||||||
0xFFDF, 0x8C51, 0x6B6E, 0x53AA, 0x2284, 0x52AC, 0x0000, 0x0000, 0xEF7D, 0xFFFF, 0xEF5D, 0x632D, 0xBDF7, 0xF7BE, 0xF7BE, 0xF79E, // 0x00E0 (224) pixels
|
|
||||||
0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF79E, 0xF7BE, 0xF7BE, 0xFFDF, 0x8431, 0x6B6E, 0x4B0A, 0x52CB, 0x528C, 0x0000, 0x0000, // 0x00F0 (240) pixels
|
|
||||||
0xF7BE, 0xE73C, 0x8CD1, 0x738E, 0xBDF7, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, // 0x0100 (256) pixels
|
|
||||||
0xFFDF, 0x8431, 0x6B6E, 0x5B0C, 0x5ACC, 0x39C8, 0x0000, 0x0000, 0xF7BE, 0xF79E, 0xB616, 0x73CF, 0xC638, 0xFFDF, 0xF79E, 0xF7BE, // 0x0110 (272) pixels
|
|
||||||
0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF79E, 0xF7BE, 0xFFDF, 0xF7BE, 0xFFDF, 0x8431, 0x6B6E, 0x630D, 0x5AED, 0x0000, 0x0000, 0x0000, // 0x0120 (288) pixels
|
|
||||||
0xF79E, 0xFFFF, 0x8CD1, 0x52CB, 0xC618, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF79E, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, // 0x0130 (304) pixels
|
|
||||||
0xFFDF, 0x8431, 0x6B6E, 0x5AEC, 0x52AC, 0x0000, 0x0000, 0x0000, 0x10A2, 0xBDF7, 0x634B, 0x4A4A, 0xC618, 0xF7DE, 0xF7BE, 0xF7BE, // 0x0140 (320) pixels
|
|
||||||
0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xFFFF, 0x8C51, 0x6B6E, 0x7BCF, 0x5AED, 0x0000, 0x0000, 0x0000, // 0x0150 (336) pixels
|
|
||||||
0x0000, 0x0000, 0x528C, 0x4A6A, 0xC618, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7DF, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF79E, 0xF7BE, // 0x0160 (352) pixels
|
|
||||||
0xFFDF, 0x8431, 0x6B6E, 0x7BCF, 0x5AED, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5ACD, 0x4A4A, 0xBDF8, 0xF7BE, 0xF7BE, 0xF7BE, // 0x0170 (368) pixels
|
|
||||||
0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xFFFF, 0x8C51, 0x738E, 0x73AE, 0x632E, 0x0000, 0x0000, 0x0000, // 0x0180 (384) pixels
|
|
||||||
0x0000, 0x0000, 0x6B6D, 0x4209, 0xC618, 0xFFDF, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xF7BE, 0xFFDF, 0xF7BE, // 0x0190 (400) pixels
|
|
||||||
0xFFDF, 0x8C51, 0x73AF, 0x738F, 0x73AE, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6B4C, 0x4A6A, 0xC638, 0xFFFF, 0xFFFF, 0xF7BE, // 0x01A0 (416) pixels
|
|
||||||
0xFFDF, 0xFFDF, 0xF7BE, 0xFFDF, 0xF7BE, 0xF7BE, 0xFFDF, 0xF7BE, 0xFFFF, 0x8C51, 0x7BCF, 0x7BF1, 0x738D, 0x0000, 0x0000, 0x0000, // 0x01B0 (432) pixels
|
|
||||||
0x0000, 0x0000, 0x6B4C, 0x5ACB, 0xC638, 0xFFFF, 0xFFFF, 0xFFDF, 0xF7BE, 0xFFDF, 0xFFDF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFDF, // 0x01C0 (448) pixels
|
|
||||||
0xFFFF, 0x8C72, 0x7BF0, 0x8C53, 0x738D, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9492, 0x738E, 0xA534, 0xCE59, 0xCE59, 0xCE59, // 0x01D0 (464) pixels
|
|
||||||
0xCE59, 0xC638, 0xC618, 0xCE59, 0xCE59, 0xCE59, 0xCE59, 0xCE59, 0xC638, 0x8C51, 0x8410, 0x8430, 0x7BD0, 0x0000, 0x0000, 0x0000, // 0x01E0 (480) pixels
|
|
||||||
0x0000, 0x0000, 0x8C51, 0x8431, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, 0x7BF0, // 0x01F0 (496) pixels
|
|
||||||
0x7BF0, 0x8410, 0x8C51, 0x8431, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x9CD3, 0x9492, 0xB593, 0x9493, 0x9491, 0x94B1, // 0x0200 (512) pixels
|
|
||||||
0x94B1, 0x94B1, 0x94B1, 0x94B1, 0x94B1, 0x94B1, 0x94B1, 0x9491, 0x9CF3, 0x4200, 0x8430, 0x9492, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0210 (528) pixels
|
|
||||||
0x0000, 0x0020, 0x0000, 0x630D, 0x8C71, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, 0x8C51, // 0x0220 (544) pixels
|
|
||||||
0x8C71, 0x8410, 0x8C51, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0230 (560) pixels
|
|
||||||
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, // 0x0240 (576) pixels
|
|
||||||
}};
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,299 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <array>
|
|
||||||
#include <algorithm>
|
|
||||||
#include <functional>
|
|
||||||
#include <cassert>
|
|
||||||
|
|
||||||
#include "display.h"
|
|
||||||
#include "textinterface.h"
|
|
||||||
#include "widgets/label.h"
|
|
||||||
#include "globals.h"
|
|
||||||
#include "menuitem.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
class MenuDisplay : public Display, public virtual TextInterface
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
void start() override;
|
|
||||||
void initScreen() override;
|
|
||||||
void update() override;
|
|
||||||
void redraw() override;
|
|
||||||
void stop() override;
|
|
||||||
|
|
||||||
void rotate(int offset) override;
|
|
||||||
void confirm() override;
|
|
||||||
|
|
||||||
TextInterface *asTextInterface() override { return this; }
|
|
||||||
const TextInterface *asTextInterface() const override { return this; }
|
|
||||||
|
|
||||||
MenuDisplay *asMenuDisplay() override { return this; }
|
|
||||||
const MenuDisplay *asMenuDisplay() const override { return this; }
|
|
||||||
|
|
||||||
int selectedIndex() const { return m_selectedIndex; }
|
|
||||||
|
|
||||||
|
|
||||||
std::size_t menuItemCount() const { return m_menuItems.size(); }
|
|
||||||
|
|
||||||
MenuItem& getMenuItem(std::size_t index)
|
|
||||||
{
|
|
||||||
assert(index < m_menuItems.size());
|
|
||||||
return *m_menuItems[index].get();
|
|
||||||
}
|
|
||||||
|
|
||||||
const MenuItem& getMenuItem(std::size_t index) const
|
|
||||||
{
|
|
||||||
assert(index < m_menuItems.size());
|
|
||||||
return *m_menuItems[index].get();
|
|
||||||
}
|
|
||||||
|
|
||||||
void runForEveryMenuItem(std::function<void(MenuItem&)> &&callback)
|
|
||||||
{
|
|
||||||
for (const auto &ptr : m_menuItems)
|
|
||||||
callback(*ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
void runForEveryMenuItem(std::function<void(const MenuItem&)> &&callback) const
|
|
||||||
{
|
|
||||||
for (const auto &ptr : m_menuItems)
|
|
||||||
callback(*ptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T, typename... Args>
|
|
||||||
T &constructMenuItem(Args&&... args)
|
|
||||||
{
|
|
||||||
auto ptr = std::make_unique<T>(std::forward<Args>(args)...);
|
|
||||||
T &ref = *ptr;
|
|
||||||
emplaceMenuItem(std::move(ptr));
|
|
||||||
return ref;
|
|
||||||
}
|
|
||||||
|
|
||||||
void emplaceMenuItem(std::unique_ptr<MenuItem> &&ptr)
|
|
||||||
{
|
|
||||||
m_menuItems.emplace_back(std::move(ptr));
|
|
||||||
}
|
|
||||||
|
|
||||||
void clearMenuItems()
|
|
||||||
{
|
|
||||||
m_menuItems.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
std::unique_ptr<MenuItem> takeLastMenuItem()
|
|
||||||
{
|
|
||||||
assert(!m_menuItems.empty());
|
|
||||||
std::unique_ptr<MenuItem> ptr = std::move(m_menuItems.back());
|
|
||||||
m_menuItems.pop_back();
|
|
||||||
return ptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
|
||||||
void setSelectedIndex(int selectedIndex) { m_selectedIndex = selectedIndex; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
Label m_titleLabel{5, 5}; // 230, 25
|
|
||||||
|
|
||||||
static constexpr auto iconWidth = 25;
|
|
||||||
static constexpr auto horizontalSpacing = 10;
|
|
||||||
static constexpr auto topMargin = 40;
|
|
||||||
static constexpr auto lineHeight = 25;
|
|
||||||
static constexpr auto verticalSpacing = 3;
|
|
||||||
|
|
||||||
std::array<Label, 10> m_labels {{
|
|
||||||
Label{horizontalSpacing + iconWidth, topMargin+(0*(lineHeight+verticalSpacing))}, // 240-(horizontalSpacing*2)-iconWidth, lineHeight
|
|
||||||
Label{horizontalSpacing + iconWidth, topMargin+(1*(lineHeight+verticalSpacing))}, // 240-(horizontalSpacing*2)-iconWidth, lineHeight
|
|
||||||
Label{horizontalSpacing + iconWidth, topMargin+(2*(lineHeight+verticalSpacing))}, // 240-(horizontalSpacing*2)-iconWidth, lineHeight
|
|
||||||
Label{horizontalSpacing + iconWidth, topMargin+(3*(lineHeight+verticalSpacing))}, // 240-(horizontalSpacing*2)-iconWidth, lineHeight
|
|
||||||
Label{horizontalSpacing + iconWidth, topMargin+(4*(lineHeight+verticalSpacing))}, // 240-(horizontalSpacing*2)-iconWidth, lineHeight
|
|
||||||
Label{horizontalSpacing + iconWidth, topMargin+(5*(lineHeight+verticalSpacing))}, // 240-(horizontalSpacing*2)-iconWidth, lineHeight
|
|
||||||
Label{horizontalSpacing + iconWidth, topMargin+(6*(lineHeight+verticalSpacing))}, // 240-(horizontalSpacing*2)-iconWidth, lineHeight
|
|
||||||
Label{horizontalSpacing + iconWidth, topMargin+(7*(lineHeight+verticalSpacing))}, // 240-(horizontalSpacing*2)-iconWidth, lineHeight
|
|
||||||
Label{horizontalSpacing + iconWidth, topMargin+(8*(lineHeight+verticalSpacing))}, // 240-(horizontalSpacing*2)-iconWidth, lineHeight
|
|
||||||
Label{horizontalSpacing + iconWidth, topMargin+(9*(lineHeight+verticalSpacing))}, // 240-(horizontalSpacing*2)-iconWidth, lineHeight
|
|
||||||
}};
|
|
||||||
|
|
||||||
std::array<const Icon<24, 24> *, 10> m_icons;
|
|
||||||
|
|
||||||
int m_selectedIndex;
|
|
||||||
int m_scrollOffset;
|
|
||||||
int m_highlightedIndex;
|
|
||||||
|
|
||||||
int m_rotateOffset;
|
|
||||||
bool m_pressed;
|
|
||||||
|
|
||||||
std::vector<std::unique_ptr<MenuItem>> m_menuItems;
|
|
||||||
};
|
|
||||||
|
|
||||||
void MenuDisplay::start()
|
|
||||||
{
|
|
||||||
m_selectedIndex = 0;
|
|
||||||
m_scrollOffset = 0;
|
|
||||||
|
|
||||||
m_rotateOffset = 0;
|
|
||||||
m_pressed = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MenuDisplay::initScreen()
|
|
||||||
{
|
|
||||||
tft.fillScreen(TFT_BLACK);
|
|
||||||
|
|
||||||
m_titleLabel.start();
|
|
||||||
tft.fillRect(0, 34, tft.width(), 3, TFT_WHITE);
|
|
||||||
|
|
||||||
for (auto &label : m_labels)
|
|
||||||
label.start();
|
|
||||||
|
|
||||||
runForEveryMenuItem([](MenuItem &item){
|
|
||||||
item.start();
|
|
||||||
});
|
|
||||||
|
|
||||||
m_icons.fill(nullptr);
|
|
||||||
|
|
||||||
m_highlightedIndex = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MenuDisplay::update()
|
|
||||||
{
|
|
||||||
if (!m_pressed)
|
|
||||||
{
|
|
||||||
const auto offset = m_rotateOffset;
|
|
||||||
m_rotateOffset = 0;
|
|
||||||
|
|
||||||
const auto itemCount = menuItemCount();
|
|
||||||
|
|
||||||
if (itemCount)
|
|
||||||
{
|
|
||||||
if (m_selectedIndex == -1)
|
|
||||||
m_selectedIndex = 0;
|
|
||||||
|
|
||||||
m_selectedIndex = m_selectedIndex + offset;
|
|
||||||
|
|
||||||
if (m_selectedIndex < 0)
|
|
||||||
m_selectedIndex += itemCount;
|
|
||||||
if (m_selectedIndex >= itemCount)
|
|
||||||
m_selectedIndex -= itemCount;
|
|
||||||
|
|
||||||
if (m_selectedIndex < m_scrollOffset)
|
|
||||||
m_scrollOffset = m_selectedIndex;
|
|
||||||
if (m_selectedIndex >= m_scrollOffset + m_labels.size())
|
|
||||||
m_scrollOffset = m_selectedIndex - m_labels.size() + 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_selectedIndex = -1;
|
|
||||||
m_scrollOffset = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
runForEveryMenuItem([&](MenuItem &item){
|
|
||||||
item.update();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_pressed = false;
|
|
||||||
if (m_selectedIndex >= 0)
|
|
||||||
getMenuItem(m_selectedIndex).triggered();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MenuDisplay::redraw()
|
|
||||||
{
|
|
||||||
tft.setTextFont(4);
|
|
||||||
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
|
|
||||||
m_titleLabel.redraw(text());
|
|
||||||
|
|
||||||
int i{0};
|
|
||||||
|
|
||||||
auto labelsIter = std::begin(m_labels);
|
|
||||||
|
|
||||||
auto iconsIter = std::begin(m_icons);
|
|
||||||
|
|
||||||
int newHighlightedIndex{-1};
|
|
||||||
|
|
||||||
const auto drawItemRect = [](const auto &label, const auto color){
|
|
||||||
tft.drawRect(5,
|
|
||||||
label.y()-1,
|
|
||||||
240 - 10,
|
|
||||||
lineHeight+2,
|
|
||||||
color);
|
|
||||||
};
|
|
||||||
|
|
||||||
runForEveryMenuItem([&](MenuItem &item){
|
|
||||||
const auto index = i++;
|
|
||||||
|
|
||||||
if (index < m_scrollOffset)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (labelsIter == std::end(m_labels))
|
|
||||||
return;
|
|
||||||
|
|
||||||
const auto relativeIndex = index - m_scrollOffset;
|
|
||||||
const auto selected = index == m_selectedIndex;
|
|
||||||
|
|
||||||
if (selected)
|
|
||||||
newHighlightedIndex = relativeIndex;
|
|
||||||
else if (relativeIndex == m_highlightedIndex)
|
|
||||||
drawItemRect(*labelsIter, TFT_BLACK);
|
|
||||||
|
|
||||||
tft.setTextFont(item.font());
|
|
||||||
tft.setTextColor(item.color(), TFT_BLACK);
|
|
||||||
labelsIter->redraw(item.text());
|
|
||||||
|
|
||||||
if (item.icon() != *iconsIter)
|
|
||||||
{
|
|
||||||
tft.fillRect(5, labelsIter->y()+1, 24, 24, TFT_BLACK);
|
|
||||||
|
|
||||||
auto icon = item.icon();
|
|
||||||
if (icon)
|
|
||||||
{
|
|
||||||
tft.setSwapBytes(!settings.boardcomputerHardware.swapScreenBytes);
|
|
||||||
tft.pushImage(6, labelsIter->y()+1, icon->WIDTH, icon->HEIGHT, icon->buffer);
|
|
||||||
tft.setSwapBytes(settings.boardcomputerHardware.swapScreenBytes);
|
|
||||||
}
|
|
||||||
*iconsIter = icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selected && (relativeIndex != m_highlightedIndex))
|
|
||||||
{
|
|
||||||
drawItemRect(*labelsIter, TFT_WHITE);
|
|
||||||
}
|
|
||||||
|
|
||||||
labelsIter++;
|
|
||||||
iconsIter++;
|
|
||||||
});
|
|
||||||
|
|
||||||
for (; labelsIter != std::end(m_labels); labelsIter++, iconsIter++)
|
|
||||||
{
|
|
||||||
const auto relativeIndex = std::distance(std::begin(m_labels), labelsIter);
|
|
||||||
|
|
||||||
if (relativeIndex == m_highlightedIndex)
|
|
||||||
drawItemRect(*labelsIter, TFT_BLACK);
|
|
||||||
|
|
||||||
labelsIter->clear();
|
|
||||||
|
|
||||||
if (*iconsIter)
|
|
||||||
{
|
|
||||||
tft.fillRect(5, labelsIter->y()+1, 24, 24, TFT_BLACK);
|
|
||||||
*iconsIter = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_highlightedIndex = newHighlightedIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MenuDisplay::stop()
|
|
||||||
{
|
|
||||||
runForEveryMenuItem([](MenuItem &item){
|
|
||||||
item.stop();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void MenuDisplay::rotate(int offset)
|
|
||||||
{
|
|
||||||
m_rotateOffset += offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MenuDisplay::confirm()
|
|
||||||
{
|
|
||||||
m_pressed = true;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "textinterface.h"
|
|
||||||
#include "fontinterface.h"
|
|
||||||
#include "colorinterface.h"
|
|
||||||
#include "iconinterface.h"
|
|
||||||
#include "actioninterface.h"
|
|
||||||
|
|
||||||
namespace {
|
|
||||||
using MenuItemIconInterface = IconInterface<24, 24>;
|
|
||||||
|
|
||||||
using MenuItemIcon = Icon<24, 24>;
|
|
||||||
|
|
||||||
template<const MenuItemIcon *T>
|
|
||||||
using StaticMenuItemIcon = StaticIcon<24, 24, T>;
|
|
||||||
|
|
||||||
class MenuItem :
|
|
||||||
public virtual ActionInterface,
|
|
||||||
public virtual TextInterface,
|
|
||||||
public virtual FontInterface,
|
|
||||||
public virtual ColorInterface,
|
|
||||||
public virtual IconInterface<24, 24>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual void start() {}
|
|
||||||
virtual void update() {}
|
|
||||||
virtual void stop() {}
|
|
||||||
};
|
|
||||||
}
|
|
@ -155,7 +155,6 @@ constexpr Settings::BoardcomputerHardware defaultBoardcomputerHardware {
|
|||||||
.gametrakDistMin = DEFAULT_GAMETRAKDISTMIN,
|
.gametrakDistMin = DEFAULT_GAMETRAKDISTMIN,
|
||||||
.gametrakDistMax = DEFAULT_GAMETRAKDISTMAX,
|
.gametrakDistMax = DEFAULT_GAMETRAKDISTMAX,
|
||||||
#endif
|
#endif
|
||||||
.swapScreenBytes = DEFAULT_SWAPSCREENBYTES,
|
|
||||||
.timersSettings = defaultTimersSettings
|
.timersSettings = defaultTimersSettings
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -119,7 +119,6 @@ void redrawDisplay()
|
|||||||
{
|
{
|
||||||
if (currentDisplay)
|
if (currentDisplay)
|
||||||
{
|
{
|
||||||
tft.setSwapBytes(settings.boardcomputerHardware.swapScreenBytes);
|
|
||||||
currentDisplay->redraw();
|
currentDisplay->redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user