mirror of
https://github.com/itead/ITEADLIB_Arduino_Nextion.git
synced 2026-03-03 08:44:00 +01:00
Modified: class tree structure.
Signed-off-by: shennongmin <wupangfee@gmail.com>
This commit is contained in:
87
NexObject.cpp
Normal file
87
NexObject.cpp
Normal 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("]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user