NexWaveform.cpp
Go to the documentation of this file.
#include "NexWaveform.h"
NexWaveform::NexWaveform(uint8_t pid, uint8_t cid, const char *name)
:NexObject(pid, cid, name)
{
}
bool NexWaveform::addValue(uint8_t ch, uint8_t number)
{
char buf[15] = {0};
if (ch > 3)
{
return false;
}
sprintf(buf, "add %u,%u,%u", getObjCid(), ch, number);
sendCommand(buf);
return true;
}
uint32_t NexWaveform::Get_background_color_bco(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".bco";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexWaveform::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 NexWaveform::Get_grid_color_gdc(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".gdc";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexWaveform::Set_grid_color_gdc(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".gdc=";
cmd += buf;
sendCommand(cmd.c_str());
cmd="";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexWaveform::Get_grid_width_gdw(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".gdw";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexWaveform::Set_grid_width_gdw(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".gdw=";
cmd += buf;
sendCommand(cmd.c_str());
cmd="";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexWaveform::Get_grid_height_gdh(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".gdh";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexWaveform::Set_grid_height_gdh(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".gdh=";
cmd += buf;
sendCommand(cmd.c_str());
cmd="";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
uint32_t NexWaveform::Get_channel_0_color_pco0(uint32_t *number)
{
String cmd;
cmd += "get ";
cmd += getObjName();
cmd += ".pco0";
sendCommand(cmd.c_str());
return recvRetNumber(number);
}
bool NexWaveform::Set_channel_0_color_pco0(uint32_t number)
{
char buf[10] = {0};
String cmd;
utoa(number, buf, 10);
cmd += getObjName();
cmd += ".pco0=";
cmd += buf;
sendCommand(cmd.c_str());
cmd="";
cmd += "ref ";
cmd += getObjName();
sendCommand(cmd.c_str());
return recvRetCommandFinished();
}
NexWaveform.h
The definition of class NexWaveform.
NexWaveform::Get_grid_width_gdw
uint32_t Get_grid_width_gdw(uint32_t *number)
Get gdw attribute of component.
Definition: NexWaveform.cpp:93
NexWaveform::Get_background_color_bco
uint32_t Get_background_color_bco(uint32_t *number)
Get bco attribute of component.
Definition: NexWaveform.cpp:37
NexWaveform::Set_grid_width_gdw
bool Set_grid_width_gdw(uint32_t number)
Set gdw attribute of component.
Definition: NexWaveform.cpp:103
NexWaveform::Set_grid_height_gdh
bool Set_grid_height_gdh(uint32_t number)
Set gdh attribute of component.
Definition: NexWaveform.cpp:131
NexWaveform::Get_grid_height_gdh
uint32_t Get_grid_height_gdh(uint32_t *number)
Get gdh attribute of component.
Definition: NexWaveform.cpp:121
NexWaveform::addValue
bool addValue(uint8_t ch, uint8_t number)
Add value to show.
Definition: NexWaveform.cpp:22
NexWaveform::Get_channel_0_color_pco0
uint32_t Get_channel_0_color_pco0(uint32_t *number)
Get pco0 attribute of component.
Definition: NexWaveform.cpp:149
NexWaveform::Set_background_color_bco
bool Set_background_color_bco(uint32_t number)
Set bco attribute of component.
Definition: NexWaveform.cpp:47
NexWaveform::NexWaveform
NexWaveform(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexWaveform.cpp:17
NexWaveform::Set_channel_0_color_pco0
bool Set_channel_0_color_pco0(uint32_t number)
Set pco0 attribute of component.
Definition: NexWaveform.cpp:159
NexObject
Root class of all Nextion components.
Definition: NexObject.h:32
NexWaveform::Set_grid_color_gdc
bool Set_grid_color_gdc(uint32_t number)
Set gdc attribute of component.
Definition: NexWaveform.cpp:75
NexWaveform::Get_grid_color_gdc
uint32_t Get_grid_color_gdc(uint32_t *number)
Get gdc attribute of component.
Definition: NexWaveform.cpp:65