NexSlider.cpp
Go to the documentation of this file.
#include "NexSlider.h"
NexSlider::NexSlider(uint8_t pid, uint8_t cid, const char *name)
:NexTouch(pid, cid, name)
{
}
bool NexSlider::getValue(uint32_t *number)
{
String cmd = String("get ");
cmd += getObjName();
cmd += ".val";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexSlider::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 NexSlider::Get_background_color_bco(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".bco";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexSlider::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 NexSlider::Get_font_color_pco(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".pco";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexSlider::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 NexSlider::Get_pointer_thickness_wid(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".wid";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexSlider::Set_pointer_thickness_wid(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".wid=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexSlider::Get_cursor_height_hig(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".hig";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexSlider::Set_cursor_height_hig(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".hig=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexSlider::getMaxval(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".maxval";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexSlider::setMaxval(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".maxval=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexSlider::getMinval(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".minval";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexSlider::setMinval(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".minval=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
NexSlider::Get_pointer_thickness_wid
uint32_t Get_pointer_thickness_wid(uint32_t *number)
Get wid attribute of component.
Definition: NexSlider.cpp:101
NexSlider::setValue
bool setValue(uint32_t number)
Set the value of slider.
Definition: NexSlider.cpp:31
NexSlider::Get_cursor_height_hig
uint32_t Get_cursor_height_hig(uint32_t *number)
Get hig attribute of component.
Definition: NexSlider.cpp:129
NexSlider::getMinval
uint32_t getMinval(uint32_t *number)
Get minval attribute of component.
Definition: NexSlider.cpp:185
NexSlider::getValue
bool getValue(uint32_t *number)
Get the value of slider.
Definition: NexSlider.cpp:22
NexSlider.h
The definition of class NexSlider.
NexSlider::Set_cursor_height_hig
bool Set_cursor_height_hig(uint32_t number)
Set hig attribute of component.
Definition: NexSlider.cpp:139
NexSlider::Get_background_color_bco
uint32_t Get_background_color_bco(uint32_t *number)
Get bco attribute of component.
Definition: NexSlider.cpp:45
NexSlider::NexSlider
NexSlider(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexSlider.cpp:17
NexSlider::setMinval
bool setMinval(uint32_t number)
Set minval attribute of component.
Definition: NexSlider.cpp:195
NexSlider::setMaxval
bool setMaxval(uint32_t number)
Set maxval attribute of component.
Definition: NexSlider.cpp:167
NexSlider::getMaxval
uint32_t getMaxval(uint32_t *number)
Get maxval attribute of component.
Definition: NexSlider.cpp:157
NexSlider::Get_font_color_pco
uint32_t Get_font_color_pco(uint32_t *number)
Get pco attribute of component.
Definition: NexSlider.cpp:73
NexSlider::Set_background_color_bco
bool Set_background_color_bco(uint32_t number)
Set bco attribute of component.
Definition: NexSlider.cpp:55
NexSlider::Set_font_color_pco
bool Set_font_color_pco(uint32_t number)
Set pco attribute of component.
Definition: NexSlider.cpp:83
NexTouch
Father class of the components with touch events.
Definition: NexTouch.h:53
NexSlider::Set_pointer_thickness_wid
bool Set_pointer_thickness_wid(uint32_t number)
Set wid attribute of component.
Definition: NexSlider.cpp:111