2021-08-20 13:16:55 +02:00
|
|
|
#include "changevaluedisplay.h"
|
|
|
|
|
|
2021-11-01 22:21:29 +01:00
|
|
|
// 3rdparty lib includes
|
|
|
|
|
#include <fmt/core.h>
|
|
|
|
|
|
2021-08-20 13:16:55 +02:00
|
|
|
namespace espgui {
|
|
|
|
|
void ChangeValueDisplayInterface::initScreen()
|
|
|
|
|
{
|
2021-11-01 22:21:29 +01:00
|
|
|
Base::initScreen();
|
2021-08-20 13:16:55 +02:00
|
|
|
|
|
|
|
|
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<>
|
|
|
|
|
void ChangeValueDisplay<float>::redraw()
|
|
|
|
|
{
|
2021-11-01 22:21:29 +01:00
|
|
|
Base::redraw();
|
2021-08-20 13:16:55 +02:00
|
|
|
|
|
|
|
|
tft.setTextColor(TFT_WHITE, TFT_BLACK);
|
|
|
|
|
tft.setTextFont(7);
|
|
|
|
|
m_valueLabel.redraw(fmt::format("{:.02f}", m_value));
|
|
|
|
|
}
|
|
|
|
|
} // namespace espgui
|