NexCheckbox.cpp
Go to the documentation of this file.
#include "NexCheckbox.h"
NexCheckbox::NexCheckbox(uint8_t pid, uint8_t cid, const char *name)
:NexTouch(pid, cid, name)
{
}
uint32_t NexCheckbox::getValue(uint32_t *number)
{
String cmd = String("get ");
cmd += getObjName();
cmd += ".val";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexCheckbox::setValue(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".val=";
cmd += buf;
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexCheckbox::Get_background_color_bco(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".bco";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexCheckbox::Set_background_color_bco(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".bco=";
cmd += buf;
sendCommand(cmd.c_str());
cmd="";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexCheckbox::Get_font_color_pco(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".pco";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexCheckbox::Set_font_color_pco(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".pco=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
NexCheckbox::setValue
bool setValue(uint32_t number)
Set val attribute of component.
Definition: NexCheckbox.cpp:31
NexCheckbox::Set_background_color_bco
bool Set_background_color_bco(uint32_t number)
Set bco attribute of component.
Definition: NexCheckbox.cpp:55
NexCheckbox::Set_font_color_pco
bool Set_font_color_pco(uint32_t number)
Set pco attribute of component.
Definition: NexCheckbox.cpp:83
NexCheckbox::Get_background_color_bco
uint32_t Get_background_color_bco(uint32_t *number)
Get bco attribute of component.
Definition: NexCheckbox.cpp:45
NexCheckbox::Get_font_color_pco
uint32_t Get_font_color_pco(uint32_t *number)
Get pco attribute of component.
Definition: NexCheckbox.cpp:73
NexCheckbox.h
The definition of class NexCheckbox.
NexCheckbox::getValue
uint32_t getValue(uint32_t *number)
Get val attribute of component.
Definition: NexCheckbox.cpp:22
NexCheckbox::NexCheckbox
NexCheckbox(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexCheckbox.cpp:17
NexTouch
Father class of the components with touch events.
Definition: NexTouch.h:53