NexGauge.cpp
Go to the documentation of this file.
#include "NexGauge.h"
NexGauge::NexGauge(uint8_t pid, uint8_t cid, const char *name)
:NexObject(pid, cid, name)
{
}
bool NexGauge::getValue(uint32_t *number)
{
String cmd = String("get ");
cmd += getObjName();
cmd += ".val";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexGauge::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 NexGauge::Get_background_color_bco(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".bco";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexGauge::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 NexGauge::Get_font_color_pco(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".pco";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexGauge::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 NexGauge::Get_pointer_thickness_wid(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".wid";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexGauge::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 NexGauge::Get_background_cropi_picc(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".picc";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexGauge::Set_background_crop_picc(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".picc=";
cmd += buf;
sendCommand(cmd.c_str());
cmd = "";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
NexGauge::setValue
bool setValue(uint32_t number)
Set the value of gauge.
Definition: NexGauge.cpp:32
NexGauge::Get_font_color_pco
uint32_t Get_font_color_pco(uint32_t *number)
Get pco attribute of component.
Definition: NexGauge.cpp:74
NexGauge::NexGauge
NexGauge(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexGauge.cpp:18
NexGauge::Get_background_cropi_picc
uint32_t Get_background_cropi_picc(uint32_t *number)
Get picc attribute of component.
Definition: NexGauge.cpp:130
NexGauge::Set_pointer_thickness_wid
bool Set_pointer_thickness_wid(uint32_t number)
Set wid attribute of component.
Definition: NexGauge.cpp:112
NexGauge.h
The definition of class NexGauge.
NexGauge::Set_background_crop_picc
bool Set_background_crop_picc(uint32_t number)
Set picc attribute of component.
Definition: NexGauge.cpp:140
NexGauge::Get_pointer_thickness_wid
uint32_t Get_pointer_thickness_wid(uint32_t *number)
Get wid attribute of component.
Definition: NexGauge.cpp:102
NexGauge::Set_font_color_pco
bool Set_font_color_pco(uint32_t number)
Set pco attribute of component.
Definition: NexGauge.cpp:84
NexGauge::getValue
bool getValue(uint32_t *number)
Get the value of gauge.
Definition: NexGauge.cpp:23
NexGauge::Get_background_color_bco
uint32_t Get_background_color_bco(uint32_t *number)
Get bco attribute of component.
Definition: NexGauge.cpp:46
NexGauge::Set_background_color_bco
bool Set_background_color_bco(uint32_t number)
Set bco attribute of component.
Definition: NexGauge.cpp:56
NexObject
Root class of all Nextion components.
Definition: NexObject.h:32