Skip to content

Commit

Permalink
Deleted NexCid and NexPid.
Browse files Browse the repository at this point in the history
Signed-off-by: shennongmin <[email protected]>
  • Loading branch information
shennongmin committed Aug 14, 2015
1 parent 6d8006c commit 8776da8
Show file tree
Hide file tree
Showing 25 changed files with 35 additions and 43 deletions.
2 changes: 1 addition & 1 deletion NexButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 1 addition & 1 deletion NexButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion NexCrop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 1 addition & 1 deletion NexCrop.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion NexGauge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 1 addition & 1 deletion NexGauge.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion NexHardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}

}
Expand Down
2 changes: 1 addition & 1 deletion NexHotspot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 1 addition & 1 deletion NexHotspot.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};


Expand Down
6 changes: 3 additions & 3 deletions NexObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -44,7 +44,7 @@ NexPid NexObject::getObjPid(void)
*
* @return the id of component.
*/
NexCid NexObject::getObjCid(void)
uint8_t NexObject::getObjCid(void)
{
return cid;
}
Expand Down
20 changes: 5 additions & 15 deletions NexObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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 */
};

Expand Down
2 changes: 1 addition & 1 deletion NexPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
4 changes: 3 additions & 1 deletion NexPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down
2 changes: 1 addition & 1 deletion NexPicture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 1 addition & 1 deletion NexPicture.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion NexProgressBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 1 addition & 1 deletion NexProgressBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion NexSlider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 1 addition & 1 deletion NexSlider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion NexText.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 1 addition & 1 deletion NexText.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions NexTouch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions NexTouch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion NexWaveform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 1 addition & 1 deletion NexWaveform.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};

Expand Down

0 comments on commit 8776da8

Please sign in to comment.