From 64a868a907d70f157e214278bb91db43e8f883cb Mon Sep 17 00:00:00 2001 From: MatthewColvin Date: Sat, 16 Sep 2023 14:19:12 -0500 Subject: [PATCH] rename UIAbstract to UIBase and extend basic UI from it --- Platformio/OmoteUI/UIs/Basic/OmoteUI.cpp | 2 +- Platformio/OmoteUI/UIs/Basic/OmoteUI.hpp | 5 ++--- Platformio/OmoteUI/UIs/UIAbstract.hpp | 10 ---------- .../OmoteUI/UIs/{UIAbstract.cpp => UIBase.cpp} | 0 Platformio/OmoteUI/UIs/UIBase.hpp | 16 ++++++++++++++++ 5 files changed, 19 insertions(+), 14 deletions(-) delete mode 100644 Platformio/OmoteUI/UIs/UIAbstract.hpp rename Platformio/OmoteUI/UIs/{UIAbstract.cpp => UIBase.cpp} (100%) create mode 100644 Platformio/OmoteUI/UIs/UIBase.hpp diff --git a/Platformio/OmoteUI/UIs/Basic/OmoteUI.cpp b/Platformio/OmoteUI/UIs/Basic/OmoteUI.cpp index fdf5433..936807f 100644 --- a/Platformio/OmoteUI/UIs/Basic/OmoteUI.cpp +++ b/Platformio/OmoteUI/UIs/Basic/OmoteUI.cpp @@ -9,7 +9,7 @@ std::shared_ptr OmoteUI::mInstance = nullptr; // #if defined(IS_SIMULATOR) && (IS_SIMULATOR == true) // #endif -OmoteUI::OmoteUI(std::shared_ptr aHardware) : mHardware(aHardware){} +OmoteUI::OmoteUI(std::shared_ptr aHardware) : UIBase(aHardware){} // Set the page indicator scroll position relative to the tabview scroll // position diff --git a/Platformio/OmoteUI/UIs/Basic/OmoteUI.hpp b/Platformio/OmoteUI/UIs/Basic/OmoteUI.hpp index 11c7873..9d314a8 100644 --- a/Platformio/OmoteUI/UIs/Basic/OmoteUI.hpp +++ b/Platformio/OmoteUI/UIs/Basic/OmoteUI.hpp @@ -2,7 +2,7 @@ // 2023 Matthew Colvin #pragma once -#include "HardwareAbstract.hpp" +#include "UIBase.hpp" #include "Images.hpp" #include "lvgl.h" #include @@ -13,7 +13,7 @@ /// @brief Singleton to allow UI code to live separately from the Initialization /// of resources. -class OmoteUI { +class OmoteUI : public UIBase { public: OmoteUI(std::shared_ptr aHardware); @@ -74,7 +74,6 @@ public: private: static std::shared_ptr mInstance; - std::shared_ptr mHardware; std::unique_ptr batteryPoller; diff --git a/Platformio/OmoteUI/UIs/UIAbstract.hpp b/Platformio/OmoteUI/UIs/UIAbstract.hpp deleted file mode 100644 index 5133a06..0000000 --- a/Platformio/OmoteUI/UIs/UIAbstract.hpp +++ /dev/null @@ -1,10 +0,0 @@ -// OMOTE UI -// 2023 Matthew Colvin - -#pragma once - -class UIAbstract{ - - UIAbstract(); - -}; \ No newline at end of file diff --git a/Platformio/OmoteUI/UIs/UIAbstract.cpp b/Platformio/OmoteUI/UIs/UIBase.cpp similarity index 100% rename from Platformio/OmoteUI/UIs/UIAbstract.cpp rename to Platformio/OmoteUI/UIs/UIBase.cpp diff --git a/Platformio/OmoteUI/UIs/UIBase.hpp b/Platformio/OmoteUI/UIs/UIBase.hpp new file mode 100644 index 0000000..35295d6 --- /dev/null +++ b/Platformio/OmoteUI/UIs/UIBase.hpp @@ -0,0 +1,16 @@ +// OMOTE UI +// 2023 Matthew Colvin + +#pragma once +#include "HardwareAbstract.hpp" +#include + +class UIBase{ +public: + UIBase(std::shared_ptr aHardware): + mHardware(aHardware){} + +protected: + std::shared_ptr mHardware; + +}; \ No newline at end of file