Documentation: NexWaveform.cpp Source File

| Documentation For Arduino users

- Main Page
- Related Pages
- Modules
- Classes
- Files
- Examples

- File List
- File Members

NexWaveform.cpp
Go to the documentation of this file.
1
15 #include "NexWaveform.h"
16
17 NexWaveform::NexWaveform(uint8_t pid, uint8_t cid, const char *name)
18 :NexObject(pid, cid, name)
19 {
20 }
21
22 bool NexWaveform::addValue(uint8_t ch, uint8_t number)
23 {
24 char buf[15] = {0};
25
26 if (ch > 3)
27 {
28 return false;
29 }
30
31 sprintf(buf, "add %u,%u,%u", getObjCid(), ch, number);
32
33 sendCommand(buf);
34 return true;
35 }
36
37 uint32_t NexWaveform::Get_background_color_bco(uint32_t *number)
38 {
39 String cmd;
40 cmd += "get ";
41 cmd += getObjName();
42 cmd += ".bco";
43 sendCommand(cmd.c_str());
44 return recvRetNumber(number);
45 }
46
47 bool NexWaveform::Set_background_color_bco(uint32_t number)
48 {
49 char buf[10] = {0};
50 String cmd;
51
52 utoa(number, buf, 10);
53 cmd += getObjName();
54 cmd += ".bco=";
55 cmd += buf;
56 sendCommand(cmd.c_str());
57
58 cmd="";
59 cmd += "ref ";
60 cmd += getObjName();
61 sendCommand(cmd.c_str());
62 return recvRetCommandFinished();
63 }
64
65 uint32_t NexWaveform::Get_grid_color_gdc(uint32_t *number)
66 {
67 String cmd;
68 cmd += "get ";
69 cmd += getObjName();
70 cmd += ".gdc";
71 sendCommand(cmd.c_str());
72 return recvRetNumber(number);
73 }
74
75 bool NexWaveform::Set_grid_color_gdc(uint32_t number)
76 {
77 char buf[10] = {0};
78 String cmd;
79
80 utoa(number, buf, 10);
81 cmd += getObjName();
82 cmd += ".gdc=";
83 cmd += buf;
84 sendCommand(cmd.c_str());
85
86 cmd="";
87 cmd += "ref ";
88 cmd += getObjName();
89 sendCommand(cmd.c_str());
90 return recvRetCommandFinished();
91 }
92
93 uint32_t NexWaveform::Get_grid_width_gdw(uint32_t *number)
94 {
95 String cmd;
96 cmd += "get ";
97 cmd += getObjName();
98 cmd += ".gdw";
99 sendCommand(cmd.c_str());
100 return recvRetNumber(number);
101 }
102
103 bool NexWaveform::Set_grid_width_gdw(uint32_t number)
104 {
105 char buf[10] = {0};
106 String cmd;
107
108 utoa(number, buf, 10);
109 cmd += getObjName();
110 cmd += ".gdw=";
111 cmd += buf;
112 sendCommand(cmd.c_str());
113
114 cmd="";
115 cmd += "ref ";
116 cmd += getObjName();
117 sendCommand(cmd.c_str());
118 return recvRetCommandFinished();
119 }
120
121 uint32_t NexWaveform::Get_grid_height_gdh(uint32_t *number)
122 {
123 String cmd;
124 cmd += "get ";
125 cmd += getObjName();
126 cmd += ".gdh";
127 sendCommand(cmd.c_str());
128 return recvRetNumber(number);
129 }
130
131 bool NexWaveform::Set_grid_height_gdh(uint32_t number)
132 {
133 char buf[10] = {0};
134 String cmd;
135
136 utoa(number, buf, 10);
137 cmd += getObjName();
138 cmd += ".gdh=";
139 cmd += buf;
140 sendCommand(cmd.c_str());
141
142 cmd="";
143 cmd += "ref ";
144 cmd += getObjName();
145 sendCommand(cmd.c_str());
146 return recvRetCommandFinished();
147 }
148
149 uint32_t NexWaveform::Get_channel_0_color_pco0(uint32_t *number)
150 {
151 String cmd;
152 cmd += "get ";
153 cmd += getObjName();
154 cmd += ".pco0";
155 sendCommand(cmd.c_str());
156 return recvRetNumber(number);
157 }
158
159 bool NexWaveform::Set_channel_0_color_pco0(uint32_t number)
160 {
161 char buf[10] = {0};
162 String cmd;
163
164 utoa(number, buf, 10);
165 cmd += getObjName();
166 cmd += ".pco0=";
167 cmd += buf;
168 sendCommand(cmd.c_str());
169
170 cmd="";
171 cmd += "ref ";
172 cmd += getObjName();
173 sendCommand(cmd.c_str());
174 return recvRetCommandFinished();
175 }
176
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