NexDualStateButton.cpp
Go to the documentation of this file.
#include "NexDualStateButton.h"
NexDSButton::NexDSButton(uint8_t pid, uint8_t cid, const char *name)
:NexTouch(pid, cid, name)
{
}
bool NexDSButton::getValue(uint32_t *number)
{
String cmd = String("get ");
cmd += getObjName();
cmd += ".val";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::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();
}
uint16_t NexDSButton::getText(char *buffer, uint16_t len)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".txt";
sendCommand(cmd.c_str());
return recvRetString(buffer,len);
}
bool NexDSButton::setText(const char *buffer)
{
String cmd;
cmd += getObjName();
cmd += ".txt=\"";
cmd += buffer;
cmd += "\"";
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexDSButton::Get_state0_color_bco0(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".bco0";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::Set_state0_color_bco0(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".bco0=";
cmd += buf;
sendCommand(cmd.c_str());
cmd="";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexDSButton::Get_state1_color_bco1(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".bco1";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::Set_state1_color_bco1(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".bco1=";
cmd += buf;
sendCommand(cmd.c_str());
cmd="";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexDSButton::Get_font_color_pco(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".pco";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::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();
}
uint32_t NexDSButton::Get_place_xcen(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".xcen";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::Set_place_xcen(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".xcen=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexDSButton::Get_place_ycen(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".ycen";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::Set_place_ycen(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".ycen=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexDSButton::getFont(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".font";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::setFont(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".font=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexDSButton::Get_state0_crop_picc0(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".picc0";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::Set_state0_crop_picc0(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".picc0=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexDSButton::Get_state1_crop_picc1(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".picc1";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::Set_state1_crop_picc1(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".picc1=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexDSButton::Get_state0_image_pic0(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".pic0";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::Set_state0_image_pic0(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".pic0=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexDSButton::Get_state1_image_pic1(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".pic1";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexDSButton::Set_state1_image_pic1(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".pic1=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
NexDSButton::Set_state1_color_bco1
bool Set_state1_color_bco1(uint32_t number)
Set bco1 attribute of component.
Definition: NexDualStateButton.cpp:105
NexDSButton::Get_state1_color_bco1
uint32_t Get_state1_color_bco1(uint32_t *number)
Get bco1 attribute of component.
Definition: NexDualStateButton.cpp:95
NexDSButton::Set_place_ycen
bool Set_place_ycen(uint32_t number)
Set ycen attribute of component.
Definition: NexDualStateButton.cpp:189
NexDSButton::Set_state1_image_pic1
bool Set_state1_image_pic1(uint32_t number)
Set pic1 attribute of component.
Definition: NexDualStateButton.cpp:329
NexDSButton::getFont
uint32_t getFont(uint32_t *number)
Get font attribute of component.
Definition: NexDualStateButton.cpp:207
NexDSButton::Get_state1_image_pic1
uint32_t Get_state1_image_pic1(uint32_t *number)
Get pic1 attribute of component.
Definition: NexDualStateButton.cpp:319
NexDSButton::setFont
bool setFont(uint32_t number)
Set font attribute of component.
Definition: NexDualStateButton.cpp:217
NexDSButton::Set_place_xcen
bool Set_place_xcen(uint32_t number)
Set xcen attribute of component.
Definition: NexDualStateButton.cpp:161
NexDSButton::Get_state0_image_pic0
uint32_t Get_state0_image_pic0(uint32_t *number)
Get pic0 attribute of component.
Definition: NexDualStateButton.cpp:291
NexDSButton::Set_state0_crop_picc0
bool Set_state0_crop_picc0(uint32_t number)
Set picc0 attribute of component.
Definition: NexDualStateButton.cpp:245
NexDSButton::Get_state0_color_bco0
uint32_t Get_state0_color_bco0(uint32_t *number)
Get bco0 attribute of component.
Definition: NexDualStateButton.cpp:67
NexDSButton::Set_font_color_pco
bool Set_font_color_pco(uint32_t number)
Set pco attribute of component.
Definition: NexDualStateButton.cpp:133
NexDSButton::Get_font_color_pco
uint32_t Get_font_color_pco(uint32_t *number)
Get pco attribute of component.
Definition: NexDualStateButton.cpp:123
NexDSButton::getValue
bool getValue(uint32_t *number)
Get number attribute of component.
Definition: NexDualStateButton.cpp:23
NexDSButton::Get_place_ycen
uint32_t Get_place_ycen(uint32_t *number)
Get ycen attribute of component.
Definition: NexDualStateButton.cpp:179
NexDSButton::Set_state0_image_pic0
bool Set_state0_image_pic0(uint32_t number)
Set pic0 attribute of component.
Definition: NexDualStateButton.cpp:301
NexDSButton::NexDSButton
NexDSButton(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexDualStateButton.cpp:18
NexDSButton::Get_state0_crop_picc0
uint32_t Get_state0_crop_picc0(uint32_t *number)
Get picc0 attribute of component.
Definition: NexDualStateButton.cpp:235
NexDSButton::setValue
bool setValue(uint32_t number)
Set number attribute of component.
Definition: NexDualStateButton.cpp:32
NexDSButton::getText
uint16_t getText(char *buffer, uint16_t len)
Get text attribute of component.
Definition: NexDualStateButton.cpp:46
NexDualStateButton.h
The definition of class NexDSButton.
NexDSButton::Set_state1_crop_picc1
bool Set_state1_crop_picc1(uint32_t number)
Set picc1 attribute of component.
Definition: NexDualStateButton.cpp:273
NexDSButton::setText
bool setText(const char *buffer)
Set text attribute of component.
Definition: NexDualStateButton.cpp:56
NexTouch
Father class of the components with touch events.
Definition: NexTouch.h:53
NexDSButton::Get_state1_crop_picc1
uint32_t Get_state1_crop_picc1(uint32_t *number)
Get picc1 attribute of component.
Definition: NexDualStateButton.cpp:263
NexDSButton::Get_place_xcen
uint32_t Get_place_xcen(uint32_t *number)
Get xcen attribute of component.
Definition: NexDualStateButton.cpp:151
NexDSButton::Set_state0_color_bco0
bool Set_state0_color_bco0(uint32_t number)
Set bco0 attribute of component.
Definition: NexDualStateButton.cpp:77