From 89f12532985d75d30c3ca6c9b761394387b1a69a Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Wed, 18 Sep 2024 16:42:48 +0200 Subject: [PATCH 1/2] Replace fmt::format with std::format --- CMakeLists.txt | 1 - src/changevaluedisplay.cpp | 6 ++++-- src/keyboardhelper.h | 1 - src/textwithvaluehelper.h | 12 +++++++----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3da5c70..b7533c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,7 +107,6 @@ set(dependencies espchrono espcpputils espwifistack - fmt TFT_eSPI esptftlib espfontlib diff --git a/src/changevaluedisplay.cpp b/src/changevaluedisplay.cpp index 38e1620..b32c40a 100644 --- a/src/changevaluedisplay.cpp +++ b/src/changevaluedisplay.cpp @@ -1,7 +1,9 @@ #include "changevaluedisplay.h" +// system includes +#include + // 3rdparty lib includes -#include #include // local includes @@ -38,6 +40,6 @@ void ChangeValueDisplay::redraw(TftInterface &tft) { Base::redraw(tft); - m_valueLabel.redraw(tft, fmt::format("{:.02f}", m_value), TFT_WHITE, TFT_BLACK, 7); + m_valueLabel.redraw(tft, std::format("{:.02f}", m_value), TFT_WHITE, TFT_BLACK, 7); } } // namespace espgui diff --git a/src/keyboardhelper.h b/src/keyboardhelper.h index 1a3cac0..c8afd4c 100644 --- a/src/keyboardhelper.h +++ b/src/keyboardhelper.h @@ -4,7 +4,6 @@ #include // 3rdparty lib includes -#include #include #include diff --git a/src/textwithvaluehelper.h b/src/textwithvaluehelper.h index e484f7b..f610c49 100644 --- a/src/textwithvaluehelper.h +++ b/src/textwithvaluehelper.h @@ -1,7 +1,9 @@ #pragma once +// system includes +#include + // 3rdparty lib includes -#include #include #include #include @@ -26,7 +28,7 @@ struct TextWithValueHelper : public Taccessor, public virtual TextInterface using espchrono::toString; using wifi_stack::toString; - return fmt::format("{} {}", Tprefix, richTextEscape(toString(Taccessor::getValue()))); + return std::format("{} {}", Tprefix, richTextEscape(toString(Taccessor::getValue()))); } }; @@ -42,7 +44,7 @@ struct ChangeableTextWithValueHelper : public Taccessor, public virtual TextInte using espchrono::toString; using wifi_stack::toString; - return fmt::format("{} {}", m_prefix, richTextEscape(toString(Taccessor::getValue()))); + return std::format("{} {}", m_prefix, richTextEscape(toString(Taccessor::getValue()))); } const std::string &prefix() const { return m_prefix; } @@ -65,7 +67,7 @@ struct TextWithHighlightedValueHelper : public Taccessor, public virtual TextInt using espchrono::toString; using wifi_stack::toString; - return fmt::format("{} {}{}", Tprefix, Tguilib_color, richTextEscape(toString(Taccessor::getValue()))); + return std::format("{} {}{}", Tprefix, Tguilib_color, richTextEscape(toString(Taccessor::getValue()))); } }; @@ -81,7 +83,7 @@ struct ChangeableTextWithHighlightedValueHelper : public Taccessor, public virtu using espchrono::toString; using wifi_stack::toString; - return fmt::format("{} {}{}", m_prefix, Tguilib_color, richTextEscape(toString(Taccessor::getValue()))); + return std::format("{} {}{}", m_prefix, Tguilib_color, richTextEscape(toString(Taccessor::getValue()))); } const std::string &prefix() const { return m_prefix; } -- 2.50.1 From 950d9dadbb7c7407a616247ae2b9b6fb8c82638f Mon Sep 17 00:00:00 2001 From: Florian Wetzel Date: Thu, 3 Oct 2024 10:07:14 +0200 Subject: [PATCH 2/2] Add build script --- .gitignore | 3 ++- iconconvert/build.sh | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 iconconvert/build.sh diff --git a/.gitignore b/.gitignore index 1aaaf52..f28b307 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/build-* +build-* +build/ diff --git a/iconconvert/build.sh b/iconconvert/build.sh new file mode 100755 index 0000000..89014f0 --- /dev/null +++ b/iconconvert/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +if [[ $PWD != *"esp-gui-lib/iconconvert"* ]] || [[ $0 != *"build.sh"* ]]; then + echo "This script must be run from the iconconvert directory" + exit 1 +fi + + +# check if qmake is installed +if ! command -v qmake; then + echo "Qmake is not installed" + exit 1 +fi + +# check if make is installed +if ! command -v make; then + echo "Make is not installed" + exit 1 +fi + +mkdir -p build +cd build || exit 1 +qmake .. +make +cd .. -- 2.50.1