Ocky Kristanto / NextionSerial
Revision:
0:87b7b2ae63c3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NextionUI.cpp	Wed Mar 03 09:01:07 2021 +0100
@@ -0,0 +1,36 @@
+#include "NextionUI.h"
+#include "NextionSerial.h"
+
+NextionUI::NextionUI(uint32_t aPage, uint32_t aId, const std::string& aObjectName, NextionSerial& aNextionSerial) :
+  iPage(aPage),
+  iId(aId),
+  iObjectName(aObjectName),
+  iNextionSerial(aNextionSerial)
+{
+    aNextionSerial.AddNextionUI(this);
+}
+
+uint32_t NextionUI::GetPage() const
+{
+    return iPage;
+}
+
+uint32_t NextionUI::GetId() const
+{
+    return iId;
+}
+
+void NextionUI::PressReleaseTriggered(TEventType aEventType)
+{
+    #ifdef DEBUG
+        switch (aEventType)
+        {
+            case TEventType::EPress:
+                printf("Received Press Event\n");
+                break;
+            case TEventType::ERelease:
+                printf("Received Release Event\n");
+                break;
+        }
+    #endif
+}
\ No newline at end of file