1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.GenericMicroPythonDevices</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.GenericMicroPythonDevices</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the device interface class for generic MicroPython devices |
|
13 (i.e. those devices not specifically supported yet). |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 |
|
17 <table> |
|
18 <tr><td>None</td></tr> |
|
19 </table> |
|
20 <h3>Classes</h3> |
|
21 |
|
22 <table> |
|
23 |
|
24 <tr> |
|
25 <td><a href="#GenericMicroPythonDevice">GenericMicroPythonDevice</a></td> |
|
26 <td>Class implementing the device interface for generic MicroPython boards.</td> |
|
27 </tr> |
|
28 </table> |
|
29 <h3>Functions</h3> |
|
30 |
|
31 <table> |
|
32 |
|
33 <tr> |
|
34 <td><a href="#createDevice">createDevice</a></td> |
|
35 <td>Function to instantiate a MicroPython device object.</td> |
|
36 </tr> |
|
37 </table> |
|
38 <hr /> |
|
39 <hr /> |
|
40 <a NAME="GenericMicroPythonDevice" ID="GenericMicroPythonDevice"></a> |
|
41 <h2>GenericMicroPythonDevice</h2> |
|
42 |
|
43 <p> |
|
44 Class implementing the device interface for generic MicroPython boards. |
|
45 </p> |
|
46 <h3>Derived from</h3> |
|
47 MicroPythonDevice |
|
48 <h3>Class Attributes</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Class Methods</h3> |
|
54 |
|
55 <table> |
|
56 <tr><td>None</td></tr> |
|
57 </table> |
|
58 <h3>Methods</h3> |
|
59 |
|
60 <table> |
|
61 |
|
62 <tr> |
|
63 <td><a href="#GenericMicroPythonDevice.__init__">GenericMicroPythonDevice</a></td> |
|
64 <td>Constructor</td> |
|
65 </tr> |
|
66 <tr> |
|
67 <td><a href="#GenericMicroPythonDevice.__deviceVolumeMounted">__deviceVolumeMounted</a></td> |
|
68 <td>Private method to check, if the device volume is mounted.</td> |
|
69 </tr> |
|
70 <tr> |
|
71 <td><a href="#GenericMicroPythonDevice.__findWorkspace">__findWorkspace</a></td> |
|
72 <td>Private method to find the workspace directory.</td> |
|
73 </tr> |
|
74 <tr> |
|
75 <td><a href="#GenericMicroPythonDevice.canRunScript">canRunScript</a></td> |
|
76 <td>Public method to determine, if a script can be executed.</td> |
|
77 </tr> |
|
78 <tr> |
|
79 <td><a href="#GenericMicroPythonDevice.canStartFileManager">canStartFileManager</a></td> |
|
80 <td>Public method to determine, if a File Manager can be started.</td> |
|
81 </tr> |
|
82 <tr> |
|
83 <td><a href="#GenericMicroPythonDevice.canStartPlotter">canStartPlotter</a></td> |
|
84 <td>Public method to determine, if a Plotter can be started.</td> |
|
85 </tr> |
|
86 <tr> |
|
87 <td><a href="#GenericMicroPythonDevice.canStartRepl">canStartRepl</a></td> |
|
88 <td>Public method to determine, if a REPL can be started.</td> |
|
89 </tr> |
|
90 <tr> |
|
91 <td><a href="#GenericMicroPythonDevice.deviceName">deviceName</a></td> |
|
92 <td>Public method to get the name of the device.</td> |
|
93 </tr> |
|
94 <tr> |
|
95 <td><a href="#GenericMicroPythonDevice.getWorkspace">getWorkspace</a></td> |
|
96 <td>Public method to get the workspace directory.</td> |
|
97 </tr> |
|
98 <tr> |
|
99 <td><a href="#GenericMicroPythonDevice.runScript">runScript</a></td> |
|
100 <td>Public method to run the given Python script.</td> |
|
101 </tr> |
|
102 <tr> |
|
103 <td><a href="#GenericMicroPythonDevice.setButtons">setButtons</a></td> |
|
104 <td>Public method to enable the supported action buttons.</td> |
|
105 </tr> |
|
106 <tr> |
|
107 <td><a href="#GenericMicroPythonDevice.supportsLocalFileAccess">supportsLocalFileAccess</a></td> |
|
108 <td>Public method to indicate file access via a local directory.</td> |
|
109 </tr> |
|
110 </table> |
|
111 <h3>Static Methods</h3> |
|
112 |
|
113 <table> |
|
114 <tr><td>None</td></tr> |
|
115 </table> |
|
116 |
|
117 <a NAME="GenericMicroPythonDevice.__init__" ID="GenericMicroPythonDevice.__init__"></a> |
|
118 <h4>GenericMicroPythonDevice (Constructor)</h4> |
|
119 <b>GenericMicroPythonDevice</b>(<i>microPythonWidget, deviceType, vid, pid, parent=None</i>) |
|
120 |
|
121 <p> |
|
122 Constructor |
|
123 </p> |
|
124 <dl> |
|
125 |
|
126 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
|
127 <dd> |
|
128 reference to the main MicroPython widget |
|
129 </dd> |
|
130 <dt><i>deviceType</i> (str)</dt> |
|
131 <dd> |
|
132 device type assigned to this device interface |
|
133 </dd> |
|
134 <dt><i>vid</i> (int)</dt> |
|
135 <dd> |
|
136 vendor ID |
|
137 </dd> |
|
138 <dt><i>pid</i> (int)</dt> |
|
139 <dd> |
|
140 product ID |
|
141 </dd> |
|
142 <dt><i>parent</i> (QObject)</dt> |
|
143 <dd> |
|
144 reference to the parent object |
|
145 </dd> |
|
146 </dl> |
|
147 <a NAME="GenericMicroPythonDevice.__deviceVolumeMounted" ID="GenericMicroPythonDevice.__deviceVolumeMounted"></a> |
|
148 <h4>GenericMicroPythonDevice.__deviceVolumeMounted</h4> |
|
149 <b>__deviceVolumeMounted</b>(<i></i>) |
|
150 |
|
151 <p> |
|
152 Private method to check, if the device volume is mounted. |
|
153 </p> |
|
154 <dl> |
|
155 <dt>Return:</dt> |
|
156 <dd> |
|
157 flag indicated a mounted device |
|
158 </dd> |
|
159 </dl> |
|
160 <dl> |
|
161 <dt>Return Type:</dt> |
|
162 <dd> |
|
163 bool |
|
164 </dd> |
|
165 </dl> |
|
166 <a NAME="GenericMicroPythonDevice.__findWorkspace" ID="GenericMicroPythonDevice.__findWorkspace"></a> |
|
167 <h4>GenericMicroPythonDevice.__findWorkspace</h4> |
|
168 <b>__findWorkspace</b>(<i>silent=False</i>) |
|
169 |
|
170 <p> |
|
171 Private method to find the workspace directory. |
|
172 </p> |
|
173 <dl> |
|
174 |
|
175 <dt><i>silent</i> (bool)</dt> |
|
176 <dd> |
|
177 flag indicating silent operations |
|
178 </dd> |
|
179 </dl> |
|
180 <dl> |
|
181 <dt>Return:</dt> |
|
182 <dd> |
|
183 workspace directory used for saving files |
|
184 </dd> |
|
185 </dl> |
|
186 <dl> |
|
187 <dt>Return Type:</dt> |
|
188 <dd> |
|
189 str |
|
190 </dd> |
|
191 </dl> |
|
192 <a NAME="GenericMicroPythonDevice.canRunScript" ID="GenericMicroPythonDevice.canRunScript"></a> |
|
193 <h4>GenericMicroPythonDevice.canRunScript</h4> |
|
194 <b>canRunScript</b>(<i></i>) |
|
195 |
|
196 <p> |
|
197 Public method to determine, if a script can be executed. |
|
198 </p> |
|
199 <dl> |
|
200 <dt>Return:</dt> |
|
201 <dd> |
|
202 tuple containing a flag indicating it is safe to start a |
|
203 Plotter and a reason why it cannot. |
|
204 </dd> |
|
205 </dl> |
|
206 <dl> |
|
207 <dt>Return Type:</dt> |
|
208 <dd> |
|
209 tuple of (bool, str) |
|
210 </dd> |
|
211 </dl> |
|
212 <a NAME="GenericMicroPythonDevice.canStartFileManager" ID="GenericMicroPythonDevice.canStartFileManager"></a> |
|
213 <h4>GenericMicroPythonDevice.canStartFileManager</h4> |
|
214 <b>canStartFileManager</b>(<i></i>) |
|
215 |
|
216 <p> |
|
217 Public method to determine, if a File Manager can be started. |
|
218 </p> |
|
219 <dl> |
|
220 <dt>Return:</dt> |
|
221 <dd> |
|
222 tuple containing a flag indicating it is safe to start a |
|
223 File Manager and a reason why it cannot. |
|
224 </dd> |
|
225 </dl> |
|
226 <dl> |
|
227 <dt>Return Type:</dt> |
|
228 <dd> |
|
229 tuple of (bool, str) |
|
230 </dd> |
|
231 </dl> |
|
232 <a NAME="GenericMicroPythonDevice.canStartPlotter" ID="GenericMicroPythonDevice.canStartPlotter"></a> |
|
233 <h4>GenericMicroPythonDevice.canStartPlotter</h4> |
|
234 <b>canStartPlotter</b>(<i></i>) |
|
235 |
|
236 <p> |
|
237 Public method to determine, if a Plotter can be started. |
|
238 </p> |
|
239 <dl> |
|
240 <dt>Return:</dt> |
|
241 <dd> |
|
242 tuple containing a flag indicating it is safe to start a |
|
243 Plotter and a reason why it cannot. |
|
244 </dd> |
|
245 </dl> |
|
246 <dl> |
|
247 <dt>Return Type:</dt> |
|
248 <dd> |
|
249 tuple of (bool, str) |
|
250 </dd> |
|
251 </dl> |
|
252 <a NAME="GenericMicroPythonDevice.canStartRepl" ID="GenericMicroPythonDevice.canStartRepl"></a> |
|
253 <h4>GenericMicroPythonDevice.canStartRepl</h4> |
|
254 <b>canStartRepl</b>(<i></i>) |
|
255 |
|
256 <p> |
|
257 Public method to determine, if a REPL can be started. |
|
258 </p> |
|
259 <dl> |
|
260 <dt>Return:</dt> |
|
261 <dd> |
|
262 tuple containing a flag indicating it is safe to start a REPL |
|
263 and a reason why it cannot. |
|
264 </dd> |
|
265 </dl> |
|
266 <dl> |
|
267 <dt>Return Type:</dt> |
|
268 <dd> |
|
269 tuple of (bool, str) |
|
270 </dd> |
|
271 </dl> |
|
272 <a NAME="GenericMicroPythonDevice.deviceName" ID="GenericMicroPythonDevice.deviceName"></a> |
|
273 <h4>GenericMicroPythonDevice.deviceName</h4> |
|
274 <b>deviceName</b>(<i></i>) |
|
275 |
|
276 <p> |
|
277 Public method to get the name of the device. |
|
278 </p> |
|
279 <dl> |
|
280 <dt>Return:</dt> |
|
281 <dd> |
|
282 name of the device |
|
283 </dd> |
|
284 </dl> |
|
285 <dl> |
|
286 <dt>Return Type:</dt> |
|
287 <dd> |
|
288 str |
|
289 </dd> |
|
290 </dl> |
|
291 <a NAME="GenericMicroPythonDevice.getWorkspace" ID="GenericMicroPythonDevice.getWorkspace"></a> |
|
292 <h4>GenericMicroPythonDevice.getWorkspace</h4> |
|
293 <b>getWorkspace</b>(<i>silent=False</i>) |
|
294 |
|
295 <p> |
|
296 Public method to get the workspace directory. |
|
297 </p> |
|
298 <dl> |
|
299 |
|
300 <dt><i>silent</i> (bool)</dt> |
|
301 <dd> |
|
302 flag indicating silent operations |
|
303 </dd> |
|
304 </dl> |
|
305 <dl> |
|
306 <dt>Return:</dt> |
|
307 <dd> |
|
308 workspace directory used for saving files |
|
309 </dd> |
|
310 </dl> |
|
311 <dl> |
|
312 <dt>Return Type:</dt> |
|
313 <dd> |
|
314 str |
|
315 </dd> |
|
316 </dl> |
|
317 <a NAME="GenericMicroPythonDevice.runScript" ID="GenericMicroPythonDevice.runScript"></a> |
|
318 <h4>GenericMicroPythonDevice.runScript</h4> |
|
319 <b>runScript</b>(<i>script</i>) |
|
320 |
|
321 <p> |
|
322 Public method to run the given Python script. |
|
323 </p> |
|
324 <dl> |
|
325 |
|
326 <dt><i>script</i> (str)</dt> |
|
327 <dd> |
|
328 script to be executed |
|
329 </dd> |
|
330 </dl> |
|
331 <a NAME="GenericMicroPythonDevice.setButtons" ID="GenericMicroPythonDevice.setButtons"></a> |
|
332 <h4>GenericMicroPythonDevice.setButtons</h4> |
|
333 <b>setButtons</b>(<i></i>) |
|
334 |
|
335 <p> |
|
336 Public method to enable the supported action buttons. |
|
337 </p> |
|
338 <a NAME="GenericMicroPythonDevice.supportsLocalFileAccess" ID="GenericMicroPythonDevice.supportsLocalFileAccess"></a> |
|
339 <h4>GenericMicroPythonDevice.supportsLocalFileAccess</h4> |
|
340 <b>supportsLocalFileAccess</b>(<i></i>) |
|
341 |
|
342 <p> |
|
343 Public method to indicate file access via a local directory. |
|
344 </p> |
|
345 <dl> |
|
346 <dt>Return:</dt> |
|
347 <dd> |
|
348 flag indicating file access via local directory |
|
349 </dd> |
|
350 </dl> |
|
351 <dl> |
|
352 <dt>Return Type:</dt> |
|
353 <dd> |
|
354 bool |
|
355 </dd> |
|
356 </dl> |
|
357 <div align="right"><a href="#top">Up</a></div> |
|
358 <hr /> |
|
359 <hr /> |
|
360 <a NAME="createDevice" ID="createDevice"></a> |
|
361 <h2>createDevice</h2> |
|
362 <b>createDevice</b>(<i>microPythonWidget, deviceType, vid, pid, boardName, serialNumber</i>) |
|
363 |
|
364 <p> |
|
365 Function to instantiate a MicroPython device object. |
|
366 </p> |
|
367 <dl> |
|
368 |
|
369 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
|
370 <dd> |
|
371 reference to the main MicroPython widget |
|
372 </dd> |
|
373 <dt><i>deviceType</i> (str)</dt> |
|
374 <dd> |
|
375 device type assigned to this device interface |
|
376 </dd> |
|
377 <dt><i>vid</i> (int)</dt> |
|
378 <dd> |
|
379 vendor ID |
|
380 </dd> |
|
381 <dt><i>pid</i> (int)</dt> |
|
382 <dd> |
|
383 product ID |
|
384 </dd> |
|
385 <dt><i>boardName</i> (str)</dt> |
|
386 <dd> |
|
387 name of the board |
|
388 </dd> |
|
389 <dt><i>serialNumber</i> (str)</dt> |
|
390 <dd> |
|
391 serial number of the board |
|
392 </dd> |
|
393 </dl> |
|
394 <dl> |
|
395 <dt>Return:</dt> |
|
396 <dd> |
|
397 reference to the instantiated device object |
|
398 </dd> |
|
399 </dl> |
|
400 <dl> |
|
401 <dt>Return Type:</dt> |
|
402 <dd> |
|
403 GenericMicroPythonDevice |
|
404 </dd> |
|
405 </dl> |
|
406 <div align="right"><a href="#top">Up</a></div> |
|
407 <hr /> |
|
408 </body></html> |
|