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