mirror of
https://github.com/itead/ITEADLIB_Arduino_Nextion.git
synced 2026-03-10 03:56:49 +01:00
Deleted NexCid and NexPid.
Signed-off-by: shennongmin <wupangfee@gmail.com>
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
* Constructor,inherited NexTouch's constructor function.
|
||||
*
|
||||
*/
|
||||
NexButton::NexButton(NexPid pid, NexCid cid, const char *name)
|
||||
NexButton::NexButton(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexTouch(pid, cid, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class NexButton: public NexTouch
|
||||
{
|
||||
public: /* methods */
|
||||
NexButton(NexPid pid, NexCid cid, const char *name);
|
||||
NexButton(uint8_t pid, uint8_t cid, const char *name);
|
||||
|
||||
uint16_t getText(char *buffer, uint16_t len);
|
||||
bool setText(const char *buffer);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Constructor,inherited NexTouch's constructor function.
|
||||
*
|
||||
*/
|
||||
NexCrop::NexCrop(NexPid pid, NexCid cid, const char *name)
|
||||
NexCrop::NexCrop(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexTouch(pid, cid, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class NexCrop: public NexTouch
|
||||
{
|
||||
public: /* methods */
|
||||
NexCrop(NexPid pid, NexCid cid, const char *name);
|
||||
NexCrop(uint8_t pid, uint8_t cid, const char *name);
|
||||
|
||||
bool getPic(uint32_t *number);
|
||||
bool setPic(uint32_t number);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Constructor,inherited NexTouch's constructor function.
|
||||
*
|
||||
*/
|
||||
NexGauge::NexGauge(NexPid pid, NexCid cid, const char *name)
|
||||
NexGauge::NexGauge(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexObject(pid, cid, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class NexGauge: public NexObject
|
||||
{
|
||||
public: /* methods */
|
||||
NexGauge(NexPid pid, NexCid cid, const char *name);
|
||||
NexGauge(uint8_t pid, uint8_t cid, const char *name);
|
||||
|
||||
bool getValue(uint32_t *number);
|
||||
bool setValue(uint32_t number);
|
||||
|
||||
@@ -249,7 +249,7 @@ static void mainEventLoop(NexTouch **list)
|
||||
|
||||
if (0xFF == __buffer[4] && 0xFF == __buffer[5] && 0xFF == __buffer[6])
|
||||
{
|
||||
NexTouch::iterate(list, (NexPid)__buffer[1], (NexCid)__buffer[2], (NexEventType)__buffer[3]);
|
||||
NexTouch::iterate(list, (uint8_t)__buffer[1], (uint8_t)__buffer[2], (NexEventType)__buffer[3]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Constructor,inherited NexTouch's constructor function.
|
||||
*
|
||||
*/
|
||||
NexHotspot::NexHotspot(NexPid pid, NexCid cid, const char *name)
|
||||
NexHotspot::NexHotspot(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexTouch(pid, cid, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class NexHotspot: public NexTouch
|
||||
{
|
||||
public: /* methods */
|
||||
NexHotspot(NexPid pid, NexCid cid, const char *name);
|
||||
NexHotspot(uint8_t pid, uint8_t cid, const char *name);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* @param cid - component id.
|
||||
* @param name - component name.
|
||||
*/
|
||||
NexObject::NexObject(NexPid pid, NexCid cid, const char *name)
|
||||
NexObject::NexObject(uint8_t pid, uint8_t cid, const char *name)
|
||||
{
|
||||
this->pid = pid;
|
||||
this->cid = cid;
|
||||
@@ -34,7 +34,7 @@ NexObject::NexObject(NexPid pid, NexCid cid, const char *name)
|
||||
*
|
||||
* @return the id of page.
|
||||
*/
|
||||
NexPid NexObject::getObjPid(void)
|
||||
uint8_t NexObject::getObjPid(void)
|
||||
{
|
||||
return pid;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ NexPid NexObject::getObjPid(void)
|
||||
*
|
||||
* @return the id of component.
|
||||
*/
|
||||
NexCid NexObject::getObjCid(void)
|
||||
uint8_t NexObject::getObjCid(void)
|
||||
{
|
||||
return cid;
|
||||
}
|
||||
|
||||
20
NexObject.h
20
NexObject.h
@@ -18,16 +18,6 @@
|
||||
#include <Arduino.h>
|
||||
#include "NexConfig.h"
|
||||
|
||||
/**
|
||||
* Page ID
|
||||
*
|
||||
* Actually, Page is also a component which can contain other components such as
|
||||
* Button, Text, etc.
|
||||
*/
|
||||
typedef uint8_t NexPid;
|
||||
|
||||
typedef uint8_t NexCid; /**< Component ID */
|
||||
|
||||
/**
|
||||
* Root class of all Nextion components.
|
||||
*
|
||||
@@ -38,17 +28,17 @@ typedef uint8_t NexCid; /**< Component ID */
|
||||
class NexObject
|
||||
{
|
||||
public: /* methods */
|
||||
NexObject(NexPid pid, NexCid cid, const char *name);
|
||||
NexObject(uint8_t pid, uint8_t cid, const char *name);
|
||||
void printObjInfo(void);
|
||||
|
||||
protected: /* methods */
|
||||
NexPid getObjPid(void);
|
||||
NexCid getObjCid(void);
|
||||
uint8_t getObjPid(void);
|
||||
uint8_t getObjCid(void);
|
||||
const char *getObjName(void);
|
||||
|
||||
private: /* data */
|
||||
NexPid pid; /* Page ID */
|
||||
NexCid cid; /* Component ID */
|
||||
uint8_t pid; /* Page ID */
|
||||
uint8_t cid; /* Component ID */
|
||||
const char *name; /* An unique name */
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Constructor,inherited NexTouch's constructor function.
|
||||
*
|
||||
*/
|
||||
NexPage::NexPage(NexPid pid, NexCid cid, const char *name)
|
||||
NexPage::NexPage(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexTouch(pid, cid, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -23,11 +23,13 @@
|
||||
/**
|
||||
* NexPage,subclass of NexTouch,provides simple methods to control page component.
|
||||
*
|
||||
* Actually, Page is also a component which can contain other components such as
|
||||
* Button, Text, etc.
|
||||
*/
|
||||
class NexPage: public NexTouch
|
||||
{
|
||||
public: /* methods */
|
||||
NexPage(NexPid pid, NexCid cid, const char *name);
|
||||
NexPage(uint8_t pid, uint8_t cid, const char *name);
|
||||
bool show(void);
|
||||
};
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Constructor,inherited NexTouch's constructor function.
|
||||
*
|
||||
*/
|
||||
NexPicture::NexPicture(NexPid pid, NexCid cid, const char *name)
|
||||
NexPicture::NexPicture(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexTouch(pid, cid, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class NexPicture: public NexTouch
|
||||
{
|
||||
public: /* methods */
|
||||
NexPicture(NexPid pid, NexCid cid, const char *name);
|
||||
NexPicture(uint8_t pid, uint8_t cid, const char *name);
|
||||
|
||||
bool getPic(uint32_t *number);
|
||||
bool setPic(uint32_t number);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Constructor,inherited NexTouch's constructor function.
|
||||
*
|
||||
*/
|
||||
NexProgressBar::NexProgressBar(NexPid pid, NexCid cid, const char *name)
|
||||
NexProgressBar::NexProgressBar(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexObject(pid, cid, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class NexProgressBar: public NexObject
|
||||
{
|
||||
public: /* methods */
|
||||
NexProgressBar(NexPid pid, NexCid cid, const char *name);
|
||||
NexProgressBar(uint8_t pid, uint8_t cid, const char *name);
|
||||
|
||||
bool getValue(uint32_t *number);
|
||||
bool setValue(uint32_t number);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Constructor,inherited NexTouch's constructor function.
|
||||
*
|
||||
*/
|
||||
NexSlider::NexSlider(NexPid pid, NexCid cid, const char *name)
|
||||
NexSlider::NexSlider(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexTouch(pid, cid, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class NexSlider: public NexTouch
|
||||
{
|
||||
public: /* methods */
|
||||
NexSlider(NexPid pid, NexCid cid, const char *name);
|
||||
NexSlider(uint8_t pid, uint8_t cid, const char *name);
|
||||
|
||||
bool getValue(uint32_t *number);
|
||||
bool setValue(uint32_t number);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Constructor,inherited NexTouch's constructor function.
|
||||
*
|
||||
*/
|
||||
NexText::NexText(NexPid pid, NexCid cid, const char *name)
|
||||
NexText::NexText(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexTouch(pid, cid, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
class NexText: public NexTouch
|
||||
{
|
||||
public: /* methods */
|
||||
NexText(NexPid pid, NexCid cid, const char *name);
|
||||
NexText(uint8_t pid, uint8_t cid, const char *name);
|
||||
|
||||
uint16_t getText(char *buffer, uint16_t len);
|
||||
bool setText(const char *buffer);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* @param name - name
|
||||
*
|
||||
*/
|
||||
NexTouch::NexTouch(NexPid pid, NexCid cid, const char *name)
|
||||
NexTouch::NexTouch(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexObject(pid, cid, name)
|
||||
{
|
||||
this->cbPush = NULL;
|
||||
@@ -72,7 +72,7 @@ void NexTouch::pop(void)
|
||||
}
|
||||
}
|
||||
|
||||
void NexTouch::iterate(NexTouch **list, NexPid pid, NexCid cid, NexEventType event)
|
||||
void NexTouch::iterate(NexTouch **list, uint8_t pid, uint8_t cid, NexEventType event)
|
||||
{
|
||||
NexTouch *e = NULL;
|
||||
uint16_t i = 0;
|
||||
|
||||
@@ -36,10 +36,10 @@ typedef enum {
|
||||
class NexTouch: public NexObject
|
||||
{
|
||||
public: /* static methods */
|
||||
static void iterate(NexTouch **list, NexPid pid, NexCid cid, NexEventType event);
|
||||
static void iterate(NexTouch **list, uint8_t pid, uint8_t cid, NexEventType event);
|
||||
|
||||
public: /* methods */
|
||||
NexTouch(NexPid pid, NexCid cid, const char *name);
|
||||
NexTouch(uint8_t pid, uint8_t cid, const char *name);
|
||||
|
||||
void attachPush(NexTouchEventCb push, void *ptr = NULL);
|
||||
void detachPush(void);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
* Constructor,inherited NexTouch's constructor function.
|
||||
*
|
||||
*/
|
||||
NexWaveform::NexWaveform(NexPid pid, NexCid cid, const char *name)
|
||||
NexWaveform::NexWaveform(uint8_t pid, uint8_t cid, const char *name)
|
||||
:NexObject(pid, cid, name)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
class NexWaveform: public NexObject
|
||||
{
|
||||
public: /* methods */
|
||||
NexWaveform(NexPid pid, NexCid cid, const char *name);
|
||||
NexWaveform(uint8_t pid, uint8_t cid, const char *name);
|
||||
bool addValue(uint8_t ch, uint8_t number);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user