Documentation: NexNumber.cpp Source File

| Documentation For Arduino users

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

- File List
- File Members

NexNumber.cpp
Go to the documentation of this file.
1
15 #include "NexNumber.h"
16
17 NexNumber::NexNumber(uint8_t pid, uint8_t cid, const char *name)
18 :NexTouch(pid, cid, name)
19 {
20 }
21
22 bool NexNumber::getValue(uint32_t *number)
23 {
24 String cmd = String("get ");
25 cmd += getObjName();
26 cmd += ".val";
27 sendCommand(cmd.c_str());
28 return recvRetNumber(number);
29 }
30
31 bool NexNumber::setValue(uint32_t number)
32 {
33 char buf[10] = {0};
34 String cmd;
35
36 utoa(number, buf, 10);
37 cmd += getObjName();
38 cmd += ".val=";
39 cmd += buf;
40
41 sendCommand(cmd.c_str());
42 return recvRetCommandFinished();
43 }
44
45 uint32_t NexNumber::Get_background_color_bco(uint32_t *number)
46 {
47 String cmd;
48 cmd += "get ";
49 cmd += getObjName();
50 cmd += ".bco";
51 sendCommand(cmd.c_str());
52 return recvRetNumber(number);
53 }
54
55 bool NexNumber::Set_background_color_bco(uint32_t number)
56 {
57 char buf[10] = {0};
58 String cmd;
59
60 utoa(number, buf, 10);
61 cmd += getObjName();
62 cmd += ".bco=";
63 cmd += buf;
64 sendCommand(cmd.c_str());
65
66 cmd="";
67 cmd += "ref ";
68 cmd += getObjName();
69 sendCommand(cmd.c_str());
70 return recvRetCommandFinished();
71 }
72
73 uint32_t NexNumber::Get_font_color_pco(uint32_t *number)
74 {
75 String cmd;
76 cmd += "get ";
77 cmd += getObjName();
78 cmd += ".pco";
79 sendCommand(cmd.c_str());
80 return recvRetNumber(number);
81 }
82
83 bool NexNumber::Set_font_color_pco(uint32_t number)
84 {
85 char buf[10] = {0};
86 String cmd;
87
88 utoa(number, buf, 10);
89 cmd += getObjName();
90 cmd += ".pco=";
91 cmd += buf;
92 sendCommand(cmd.c_str());
93
94 cmd = "";
95 cmd += "ref ";
96 cmd += getObjName();
97 sendCommand(cmd.c_str());
98 return recvRetCommandFinished();
99 }
100
101 uint32_t NexNumber::Get_place_xcen(uint32_t *number)
102 {
103 String cmd;
104 cmd += "get ";
105 cmd += getObjName();
106 cmd += ".xcen";
107 sendCommand(cmd.c_str());
108 return recvRetNumber(number);
109 }
110
111 bool NexNumber::Set_place_xcen(uint32_t number)
112 {
113 char buf[10] = {0};
114 String cmd;
115
116 utoa(number, buf, 10);
117 cmd += getObjName();
118 cmd += ".xcen=";
119 cmd += buf;
120 sendCommand(cmd.c_str());
121
122 cmd = "";
123 cmd += "ref ";
124 cmd += getObjName();
125 sendCommand(cmd.c_str());
126 return recvRetCommandFinished();
127 }
128
129 uint32_t NexNumber::Get_place_ycen(uint32_t *number)
130 {
131 String cmd;
132 cmd += "get ";
133 cmd += getObjName();
134 cmd += ".ycen";
135 sendCommand(cmd.c_str());
136 return recvRetNumber(number);
137 }
138
139 bool NexNumber::Set_place_ycen(uint32_t number)
140 {
141 char buf[10] = {0};
142 String cmd;
143
144 utoa(number, buf, 10);
145 cmd += getObjName();
146 cmd += ".ycen=";
147 cmd += buf;
148 sendCommand(cmd.c_str());
149
150 cmd = "";
151 cmd += "ref ";
152 cmd += getObjName();
153 sendCommand(cmd.c_str());
154 return recvRetCommandFinished();
155 }
156
157 uint32_t NexNumber::getFont(uint32_t *number)
158 {
159 String cmd;
160 cmd += "get ";
161 cmd += getObjName();
162 cmd += ".font";
163 sendCommand(cmd.c_str());
164 return recvRetNumber(number);
165 }
166
167 bool NexNumber::setFont(uint32_t number)
168 {
169 char buf[10] = {0};
170 String cmd;
171
172 utoa(number, buf, 10);
173 cmd += getObjName();
174 cmd += ".font=";
175 cmd += buf;
176 sendCommand(cmd.c_str());
177
178 cmd = "";
179 cmd += "ref ";
180 cmd += getObjName();
181 sendCommand(cmd.c_str());
182 return recvRetCommandFinished();
183 }
184
185 uint32_t NexNumber::Get_number_lenth(uint32_t *number)
186 {
187 String cmd;
188 cmd += "get ";
189 cmd += getObjName();
190 cmd += ".lenth";
191 sendCommand(cmd.c_str());
192 return recvRetNumber(number);
193 }
194
195 bool NexNumber::Set_number_lenth(uint32_t number)
196 {
197 char buf[10] = {0};
198 String cmd;
199
200 utoa(number, buf, 10);
201 cmd += getObjName();
202 cmd += ".lenth=";
203 cmd += buf;
204 sendCommand(cmd.c_str());
205
206 cmd = "";
207 cmd += "ref ";
208 cmd += getObjName();
209 sendCommand(cmd.c_str());
210 return recvRetCommandFinished();
211 }
212
213 uint32_t NexNumber::Get_background_crop_picc(uint32_t *number)
214 {
215 String cmd;
216 cmd += "get ";
217 cmd += getObjName();
218 cmd += ".picc";
219 sendCommand(cmd.c_str());
220 return recvRetNumber(number);
221 }
222
223 bool NexNumber::Set_background_crop_picc(uint32_t number)
224 {
225 char buf[10] = {0};
226 String cmd;
227
228 utoa(number, buf, 10);
229 cmd += getObjName();
230 cmd += ".picc=";
231 cmd += buf;
232 sendCommand(cmd.c_str());
233
234 cmd = "";
235 cmd += "ref ";
236 cmd += getObjName();
237 sendCommand(cmd.c_str());
238 return recvRetCommandFinished();
239 }
240
241 uint32_t NexNumber::Get_background_image_pic(uint32_t *number)
242 {
243 String cmd = String("get ");
244 cmd += getObjName();
245 cmd += ".pic";
246 sendCommand(cmd.c_str());
247 return recvRetNumber(number);
248 }
249
250 bool NexNumber::Set_background_image_pic(uint32_t number)
251 {
252 char buf[10] = {0};
253 String cmd;
254
255 utoa(number, buf, 10);
256 cmd += getObjName();
257 cmd += ".pic=";
258 cmd += buf;
259 sendCommand(cmd.c_str());
260
261 cmd = "";
262 cmd += "ref ";
263 cmd += getObjName();
264 sendCommand(cmd.c_str());
265 return recvRetCommandFinished();
266 }
NexNumber::Get_background_color_bco
uint32_t Get_background_color_bco(uint32_t *number)
Get bco attribute of component.
Definition: NexNumber.cpp:45
NexNumber::Set_font_color_pco
bool Set_font_color_pco(uint32_t number)
Set pco attribute of component.
Definition: NexNumber.cpp:83
NexNumber::Set_background_crop_picc
bool Set_background_crop_picc(uint32_t number)
Set picc attribute of component.
Definition: NexNumber.cpp:223
NexNumber::NexNumber
NexNumber(uint8_t pid, uint8_t cid, const char *name)
Constructor.
Definition: NexNumber.cpp:17
NexNumber::Get_number_lenth
uint32_t Get_number_lenth(uint32_t *number)
Get lenth attribute of component.
Definition: NexNumber.cpp:185
NexNumber::Get_place_xcen
uint32_t Get_place_xcen(uint32_t *number)
Get xcen attribute of component.
Definition: NexNumber.cpp:101
NexNumber::Set_number_lenth
bool Set_number_lenth(uint32_t number)
Set lenth attribute of component.
Definition: NexNumber.cpp:195
NexNumber::setFont
bool setFont(uint32_t number)
Set font attribute of component.
Definition: NexNumber.cpp:167
NexNumber::Get_background_image_pic
uint32_t Get_background_image_pic(uint32_t *number)
Get pic attribute of component.
Definition: NexNumber.cpp:241
NexNumber::Set_background_image_pic
bool Set_background_image_pic(uint32_t number)
Set pic attribute of component.
Definition: NexNumber.cpp:250
NexNumber::Set_place_ycen
bool Set_place_ycen(uint32_t number)
Set ycen attribute of component.
Definition: NexNumber.cpp:139
NexNumber::Get_place_ycen
uint32_t Get_place_ycen(uint32_t *number)
Get ycen attribute of component.
Definition: NexNumber.cpp:129
NexNumber.h
The definition of class NexNumber.
NexNumber::setValue
bool setValue(uint32_t number)
Set number attribute of component.
Definition: NexNumber.cpp:31
NexNumber::getFont
uint32_t getFont(uint32_t *number)
Get font attribute of component.
Definition: NexNumber.cpp:157
NexNumber::getValue
bool getValue(uint32_t *number)
Get number attribute of component.
Definition: NexNumber.cpp:22
NexNumber::Get_font_color_pco
uint32_t Get_font_color_pco(uint32_t *number)
Get pco attribute of component.
Definition: NexNumber.cpp:73
NexNumber::Set_background_color_bco
bool Set_background_color_bco(uint32_t number)
Set bco attribute of component.
Definition: NexNumber.cpp:55
NexTouch
Father class of the components with touch events.
Definition: NexTouch.h:53
NexNumber::Set_place_xcen
bool Set_place_xcen(uint32_t number)
Set xcen attribute of component.
Definition: NexNumber.cpp:111
NexNumber::Get_background_crop_picc
uint32_t Get_background_crop_picc(uint32_t *number)
Get picc attribute of component.
Definition: NexNumber.cpp:213