Ocky Kristanto / NextionSerial
Committer:
Ocky Kristanto
Date:
Wed Mar 03 09:01:07 2021 +0100
Revision:
0:87b7b2ae63c3
feat: initial version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Ocky Kristanto 0:87b7b2ae63c3 1 #include "NextionUI.h"
Ocky Kristanto 0:87b7b2ae63c3 2 #include "NextionSerial.h"
Ocky Kristanto 0:87b7b2ae63c3 3
Ocky Kristanto 0:87b7b2ae63c3 4 NextionUI::NextionUI(uint32_t aPage, uint32_t aId, const std::string& aObjectName, NextionSerial& aNextionSerial) :
Ocky Kristanto 0:87b7b2ae63c3 5 iPage(aPage),
Ocky Kristanto 0:87b7b2ae63c3 6 iId(aId),
Ocky Kristanto 0:87b7b2ae63c3 7 iObjectName(aObjectName),
Ocky Kristanto 0:87b7b2ae63c3 8 iNextionSerial(aNextionSerial)
Ocky Kristanto 0:87b7b2ae63c3 9 {
Ocky Kristanto 0:87b7b2ae63c3 10 aNextionSerial.AddNextionUI(this);
Ocky Kristanto 0:87b7b2ae63c3 11 }
Ocky Kristanto 0:87b7b2ae63c3 12
Ocky Kristanto 0:87b7b2ae63c3 13 uint32_t NextionUI::GetPage() const
Ocky Kristanto 0:87b7b2ae63c3 14 {
Ocky Kristanto 0:87b7b2ae63c3 15 return iPage;
Ocky Kristanto 0:87b7b2ae63c3 16 }
Ocky Kristanto 0:87b7b2ae63c3 17
Ocky Kristanto 0:87b7b2ae63c3 18 uint32_t NextionUI::GetId() const
Ocky Kristanto 0:87b7b2ae63c3 19 {
Ocky Kristanto 0:87b7b2ae63c3 20 return iId;
Ocky Kristanto 0:87b7b2ae63c3 21 }
Ocky Kristanto 0:87b7b2ae63c3 22
Ocky Kristanto 0:87b7b2ae63c3 23 void NextionUI::PressReleaseTriggered(TEventType aEventType)
Ocky Kristanto 0:87b7b2ae63c3 24 {
Ocky Kristanto 0:87b7b2ae63c3 25 #ifdef DEBUG
Ocky Kristanto 0:87b7b2ae63c3 26 switch (aEventType)
Ocky Kristanto 0:87b7b2ae63c3 27 {
Ocky Kristanto 0:87b7b2ae63c3 28 case TEventType::EPress:
Ocky Kristanto 0:87b7b2ae63c3 29 printf("Received Press Event\n");
Ocky Kristanto 0:87b7b2ae63c3 30 break;
Ocky Kristanto 0:87b7b2ae63c3 31 case TEventType::ERelease:
Ocky Kristanto 0:87b7b2ae63c3 32 printf("Received Release Event\n");
Ocky Kristanto 0:87b7b2ae63c3 33 break;
Ocky Kristanto 0:87b7b2ae63c3 34 }
Ocky Kristanto 0:87b7b2ae63c3 35 #endif
Ocky Kristanto 0:87b7b2ae63c3 36 }