Documentation: NexSlider.cpp Source File

| Documentation For Arduino users

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

- File List
- File Members

NexSlider.cpp
Go to the documentation of this file.
1
15 #include "NexSlider.h"
16
17 NexSlider::NexSlider(uint8_t pid, uint8_t cid, const char *name)
18 :NexTouch(pid, cid, name)
19 {
20 }
21
22 bool NexSlider::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 NexSlider::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 NexSlider::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 NexSlider::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 NexSlider::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 NexSlider::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 NexSlider::Get_pointer_thickness_wid(uint32_t *number)
102 {
103 String cmd;
104 cmd += "get ";
105 cmd += getObjName();
106 cmd += ".wid";
107 sendCommand(cmd.c_str());
108 return recvRetNumber(number);
109 }
110
111 bool NexSlider::Set_pointer_thickness_wid(uint32_t number)
112 {
113 char buf[10] = {0};
114 String cmd;
115
116 utoa(number, buf, 10);
117 cmd += getObjName();
118 cmd += ".wid=";
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 NexSlider::Get_cursor_height_hig(uint32_t *number)
130 {
131 String cmd;
132 cmd += "get ";
133 cmd += getObjName();
134 cmd += ".hig";
135 sendCommand(cmd.c_str());
136 return recvRetNumber(number);
137 }
138
139 bool NexSlider::Set_cursor_height_hig(uint32_t number)
140 {
141 char buf[10] = {0};
142 String cmd;
143
144 utoa(number, buf, 10);
145 cmd += getObjName();
146 cmd += ".hig=";
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 NexSlider::getMaxval(uint32_t *number)
158 {
159 String cmd;
160 cmd += "get ";
161 cmd += getObjName();
162 cmd += ".maxval";
163 sendCommand(cmd.c_str());
164 return recvRetNumber(number);
165 }
166
167 bool NexSlider::setMaxval(uint32_t number)
168 {
169 char buf[10] = {0};
170 String cmd;
171
172 utoa(number, buf, 10);
173 cmd += getObjName();
174 cmd += ".maxval=";
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 NexSlider::getMinval(uint32_t *number)
186 {
187 String cmd;
188 cmd += "get ";
189 cmd += getObjName();
190 cmd += ".minval";
191 sendCommand(cmd.c_str());
192 return recvRetNumber(number);
193 }
194
195 bool NexSlider::setMinval(uint32_t number)
196 {
197 char buf[10] = {0};
198 String cmd;
199
200 utoa(number, buf, 10);
201 cmd += getObjName();
202 cmd += ".minval=";
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 }
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