mirror of
https://github.com/itead/ITEADLIB_Arduino_Nextion.git
synced 2026-03-03 08:44:00 +01:00
Updated comments of NexObject.
Signed-off-by: shennongmin <wupangfee@gmail.com>
This commit is contained in:
@@ -14,68 +14,40 @@
|
||||
*/
|
||||
#include "NexObject.h"
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param pid - page id.
|
||||
* @param cid - component id.
|
||||
* @param name - component name.
|
||||
*/
|
||||
NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name)
|
||||
{
|
||||
this->pid = pid;
|
||||
this->cid = cid;
|
||||
this->name = name;
|
||||
dbSerialPrintln("NexObject called");
|
||||
this->__pid = pid;
|
||||
this->__cid = cid;
|
||||
this->__name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get page id.
|
||||
*
|
||||
* @return the id of page.
|
||||
*/
|
||||
uint8_t NexObject::getObjPid(void)
|
||||
{
|
||||
return pid;
|
||||
return __pid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get component id.
|
||||
*
|
||||
* @return the id of component.
|
||||
*/
|
||||
uint8_t NexObject::getObjCid(void)
|
||||
{
|
||||
return cid;
|
||||
return __cid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get component name.
|
||||
*
|
||||
* @return the name of component.
|
||||
*/
|
||||
const char* NexObject::getObjName(void)
|
||||
{
|
||||
return name;
|
||||
return __name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print current object address,page id,component id,
|
||||
* component name,pop event function address,push event function address.
|
||||
*
|
||||
*/
|
||||
void NexObject::printObjInfo(void)
|
||||
{
|
||||
dbSerialPrint("[");
|
||||
dbSerialPrint((uint32_t)this);
|
||||
dbSerialPrint(":");
|
||||
dbSerialPrint(pid);
|
||||
dbSerialPrint(__pid);
|
||||
dbSerialPrint(",");
|
||||
dbSerialPrint(cid);
|
||||
dbSerialPrint(__cid);
|
||||
dbSerialPrint(",");
|
||||
if (name)
|
||||
if (__name)
|
||||
{
|
||||
dbSerialPrint(name);
|
||||
dbSerialPrint(__name);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
38
NexObject.h
38
NexObject.h
@@ -28,18 +28,50 @@
|
||||
class NexObject
|
||||
{
|
||||
public: /* methods */
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param pid - page id.
|
||||
* @param cid - component id.
|
||||
* @param name - pointer to an unique name in range of all components.
|
||||
*/
|
||||
NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||
|
||||
/**
|
||||
* Print current object'address, page id, component id and name.
|
||||
*
|
||||
* @warning this method does nothing, unless debug message enabled.
|
||||
*/
|
||||
void printObjInfo(void);
|
||||
|
||||
protected: /* methods */
|
||||
|
||||
/*
|
||||
* Get page id.
|
||||
*
|
||||
* @return the id of page.
|
||||
*/
|
||||
uint8_t getObjPid(void);
|
||||
|
||||
/*
|
||||
* Get component id.
|
||||
*
|
||||
* @return the id of component.
|
||||
*/
|
||||
uint8_t getObjCid(void);
|
||||
|
||||
/*
|
||||
* Get component name.
|
||||
*
|
||||
* @return the name of component.
|
||||
*/
|
||||
const char *getObjName(void);
|
||||
|
||||
private: /* data */
|
||||
uint8_t pid; /* Page ID */
|
||||
uint8_t cid; /* Component ID */
|
||||
const char *name; /* An unique name */
|
||||
uint8_t __pid; /* Page ID */
|
||||
uint8_t __cid; /* Component ID */
|
||||
const char *__name; /* An unique name */
|
||||
};
|
||||
|
||||
#endif /* #ifndef __NEXOBJECT_H__ */
|
||||
|
||||
Reference in New Issue
Block a user