|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.MicroPythonGraphWidget</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.MicroPython.MicroPythonGraphWidget</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the MicroPython graph widget. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#MicroPythonGraphWidget">MicroPythonGraphWidget</a></td> |
|
25 <td>Class implementing the MicroPython graph widget.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="MicroPythonGraphWidget" ID="MicroPythonGraphWidget"></a> |
|
36 <h2>MicroPythonGraphWidget</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing the MicroPython graph widget. |
|
40 </p> |
|
41 <h3>Signals</h3> |
|
42 <dl> |
|
43 |
|
44 <dt>dataFlood</dt> |
|
45 <dd> |
|
46 emitted to indicate, that too much data is received |
|
47 </dd> |
|
48 </dl> |
|
49 <h3>Derived from</h3> |
|
50 QWidget |
|
51 <h3>Class Attributes</h3> |
|
52 |
|
53 <table> |
|
54 <tr><td>None</td></tr> |
|
55 </table> |
|
56 <h3>Class Methods</h3> |
|
57 |
|
58 <table> |
|
59 <tr><td>None</td></tr> |
|
60 </table> |
|
61 <h3>Methods</h3> |
|
62 |
|
63 <table> |
|
64 |
|
65 <tr> |
|
66 <td><a href="#MicroPythonGraphWidget.__init__">MicroPythonGraphWidget</a></td> |
|
67 <td>Constructor</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#MicroPythonGraphWidget.__addData">__addData</a></td> |
|
71 <td>Private method to add a tuple of values to the graph.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#MicroPythonGraphWidget.__handleMaxXChanged">__handleMaxXChanged</a></td> |
|
75 <td>Private slot handling a change of the max.</td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td><a href="#MicroPythonGraphWidget.hasData">hasData</a></td> |
|
79 <td>Public method to check, if the chart contains some valid data.</td> |
|
80 </tr> |
|
81 <tr> |
|
82 <td><a href="#MicroPythonGraphWidget.isDirty">isDirty</a></td> |
|
83 <td>Public method to check, if the chart contains unsaved data.</td> |
|
84 </tr> |
|
85 <tr> |
|
86 <td><a href="#MicroPythonGraphWidget.on_saveButton_clicked">on_saveButton_clicked</a></td> |
|
87 <td>Private slot to save the raw data to a CSV file.</td> |
|
88 </tr> |
|
89 <tr> |
|
90 <td><a href="#MicroPythonGraphWidget.preferencesChanged">preferencesChanged</a></td> |
|
91 <td>Public slot to apply changed preferences.</td> |
|
92 </tr> |
|
93 <tr> |
|
94 <td><a href="#MicroPythonGraphWidget.processData">processData</a></td> |
|
95 <td>Public slot to process the raw data.</td> |
|
96 </tr> |
|
97 <tr> |
|
98 <td><a href="#MicroPythonGraphWidget.saveData">saveData</a></td> |
|
99 <td>Public method to save the dialog's raw data.</td> |
|
100 </tr> |
|
101 </table> |
|
102 <h3>Static Methods</h3> |
|
103 |
|
104 <table> |
|
105 <tr><td>None</td></tr> |
|
106 </table> |
|
107 |
|
108 <a NAME="MicroPythonGraphWidget.__init__" ID="MicroPythonGraphWidget.__init__"></a> |
|
109 <h4>MicroPythonGraphWidget (Constructor)</h4> |
|
110 <b>MicroPythonGraphWidget</b>(<i>parent=None</i>) |
|
111 |
|
112 <p> |
|
113 Constructor |
|
114 </p> |
|
115 <dl> |
|
116 |
|
117 <dt><i>parent</i> (QWidget)</dt> |
|
118 <dd> |
|
119 reference to the parent widget |
|
120 </dd> |
|
121 </dl> |
|
122 <a NAME="MicroPythonGraphWidget.__addData" ID="MicroPythonGraphWidget.__addData"></a> |
|
123 <h4>MicroPythonGraphWidget.__addData</h4> |
|
124 <b>__addData</b>(<i>values</i>) |
|
125 |
|
126 <p> |
|
127 Private method to add a tuple of values to the graph. |
|
128 </p> |
|
129 <p> |
|
130 It ensures there are the required number of line series, adds the data |
|
131 to the line series and updates the range of the chart so the chart |
|
132 displays nicely. |
|
133 </p> |
|
134 <dl> |
|
135 |
|
136 <dt><i>values</i> (tuple of int or float)</dt> |
|
137 <dd> |
|
138 tuple containing the data to be added |
|
139 </dd> |
|
140 </dl> |
|
141 <a NAME="MicroPythonGraphWidget.__handleMaxXChanged" ID="MicroPythonGraphWidget.__handleMaxXChanged"></a> |
|
142 <h4>MicroPythonGraphWidget.__handleMaxXChanged</h4> |
|
143 <b>__handleMaxXChanged</b>(<i>value</i>) |
|
144 |
|
145 <p> |
|
146 Private slot handling a change of the max. X spin box. |
|
147 </p> |
|
148 <dl> |
|
149 |
|
150 <dt><i>value</i> (int)</dt> |
|
151 <dd> |
|
152 value of the spin box |
|
153 </dd> |
|
154 </dl> |
|
155 <a NAME="MicroPythonGraphWidget.hasData" ID="MicroPythonGraphWidget.hasData"></a> |
|
156 <h4>MicroPythonGraphWidget.hasData</h4> |
|
157 <b>hasData</b>(<i></i>) |
|
158 |
|
159 <p> |
|
160 Public method to check, if the chart contains some valid data. |
|
161 </p> |
|
162 <dl> |
|
163 <dt>Return:</dt> |
|
164 <dd> |
|
165 flag indicating valid data |
|
166 </dd> |
|
167 </dl> |
|
168 <dl> |
|
169 <dt>Return Type:</dt> |
|
170 <dd> |
|
171 bool |
|
172 </dd> |
|
173 </dl> |
|
174 <a NAME="MicroPythonGraphWidget.isDirty" ID="MicroPythonGraphWidget.isDirty"></a> |
|
175 <h4>MicroPythonGraphWidget.isDirty</h4> |
|
176 <b>isDirty</b>(<i></i>) |
|
177 |
|
178 <p> |
|
179 Public method to check, if the chart contains unsaved data. |
|
180 </p> |
|
181 <dl> |
|
182 <dt>Return:</dt> |
|
183 <dd> |
|
184 flag indicating unsaved data |
|
185 </dd> |
|
186 </dl> |
|
187 <dl> |
|
188 <dt>Return Type:</dt> |
|
189 <dd> |
|
190 bool |
|
191 </dd> |
|
192 </dl> |
|
193 <a NAME="MicroPythonGraphWidget.on_saveButton_clicked" ID="MicroPythonGraphWidget.on_saveButton_clicked"></a> |
|
194 <h4>MicroPythonGraphWidget.on_saveButton_clicked</h4> |
|
195 <b>on_saveButton_clicked</b>(<i></i>) |
|
196 |
|
197 <p> |
|
198 Private slot to save the raw data to a CSV file. |
|
199 </p> |
|
200 <a NAME="MicroPythonGraphWidget.preferencesChanged" ID="MicroPythonGraphWidget.preferencesChanged"></a> |
|
201 <h4>MicroPythonGraphWidget.preferencesChanged</h4> |
|
202 <b>preferencesChanged</b>(<i></i>) |
|
203 |
|
204 <p> |
|
205 Public slot to apply changed preferences. |
|
206 </p> |
|
207 <a NAME="MicroPythonGraphWidget.processData" ID="MicroPythonGraphWidget.processData"></a> |
|
208 <h4>MicroPythonGraphWidget.processData</h4> |
|
209 <b>processData</b>(<i>data</i>) |
|
210 |
|
211 <p> |
|
212 Public slot to process the raw data. |
|
213 </p> |
|
214 <p> |
|
215 It takes raw bytes, checks the data for a valid tuple of ints or |
|
216 floats and adds the data to the graph. If the the length of the bytes |
|
217 data is greater than 1024 then a dataFlood signal is emitted to ensure |
|
218 eric can take action to remain responsive. |
|
219 </p> |
|
220 <dl> |
|
221 |
|
222 <dt><i>data</i> (bytes)</dt> |
|
223 <dd> |
|
224 raw data received from the connected device via the main |
|
225 device widget |
|
226 </dd> |
|
227 </dl> |
|
228 <a NAME="MicroPythonGraphWidget.saveData" ID="MicroPythonGraphWidget.saveData"></a> |
|
229 <h4>MicroPythonGraphWidget.saveData</h4> |
|
230 <b>saveData</b>(<i></i>) |
|
231 |
|
232 <p> |
|
233 Public method to save the dialog's raw data. |
|
234 </p> |
|
235 <dl> |
|
236 <dt>Return:</dt> |
|
237 <dd> |
|
238 flag indicating success |
|
239 </dd> |
|
240 </dl> |
|
241 <dl> |
|
242 <dt>Return Type:</dt> |
|
243 <dd> |
|
244 bool |
|
245 </dd> |
|
246 </dl> |
|
247 <div align="right"><a href="#top">Up</a></div> |
|
248 <hr /> |
|
249 </body></html> |