Modified: class tree structure.

Signed-off-by: shennongmin <wupangfee@gmail.com>
This commit is contained in:
shennongmin
2015-08-13 18:05:42 +08:00
parent ced5da9c0a
commit 88290e6e57
25 changed files with 178 additions and 311 deletions

87
NexObject.cpp Normal file
View File

@@ -0,0 +1,87 @@
/**
* @file NexObject.cpp
*
* The root of all classes in Nextion library.
*
* @author Wu Pengfei (email:<pengfei.wu@itead.cc>)
* @date 2015/8/13
* @copyright
* Copyright (C) 2014-2015 ITEAD Intelligent Systems Co., Ltd. \n
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*/
#include "NexObject.h"
/**
* Constructor
*
* @param pid - page id.
* @param cid - component id.
* @param name - component name.
*/
NexObject::NexObject(NexPid pid, NexCid cid, const char *name)
{
this->pid = pid;
this->cid = cid;
this->name = name;
dbSerialPrintln("NexObject called");
}
/**
* Get page id.
*
* @return the id of page.
*/
NexPid NexObject::getObjPid(void)
{
return pid;
}
/**
* Get component id.
*
* @return the id of component.
*/
NexCid NexObject::getObjCid(void)
{
return cid;
}
/**
* Get component name.
*
* @return the name of component.
*/
const char* NexObject::getObjName(void)
{
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(",");
dbSerialPrint(cid);
dbSerialPrint(",");
if (name)
{
dbSerialPrint(name);
}
else
{
dbSerialPrint("(null)");
}
dbSerialPrintln("]");
}