1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.MicroPythonDevices</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.MicroPythonDevices</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing some utility functions and the MicroPythonDevice base |
|
13 class. |
|
14 </p> |
|
15 <h3>Global Attributes</h3> |
|
16 |
|
17 <table> |
|
18 <tr><td>FirmwareGithubUrls</td></tr><tr><td>IgnoredBoards</td></tr><tr><td>SupportedBoards</td></tr> |
|
19 </table> |
|
20 <h3>Classes</h3> |
|
21 |
|
22 <table> |
|
23 |
|
24 <tr> |
|
25 <td><a href="#MicroPythonDevice">MicroPythonDevice</a></td> |
|
26 <td>Base class for the more specific MicroPython devices.</td> |
|
27 </tr> |
|
28 </table> |
|
29 <h3>Functions</h3> |
|
30 |
|
31 <table> |
|
32 |
|
33 <tr> |
|
34 <td><a href="#getDevice">getDevice</a></td> |
|
35 <td>Public method to instantiate a specific MicroPython device interface.</td> |
|
36 </tr> |
|
37 <tr> |
|
38 <td><a href="#getDeviceIcon">getDeviceIcon</a></td> |
|
39 <td>Function to get the icon for the given board.</td> |
|
40 </tr> |
|
41 <tr> |
|
42 <td><a href="#getFoundDevices">getFoundDevices</a></td> |
|
43 <td>Function to check the serial ports for supported MicroPython devices.</td> |
|
44 </tr> |
|
45 <tr> |
|
46 <td><a href="#getSupportedDevices">getSupportedDevices</a></td> |
|
47 <td>Function to get a list of supported MicroPython devices.</td> |
|
48 </tr> |
|
49 </table> |
|
50 <hr /> |
|
51 <hr /> |
|
52 <a NAME="MicroPythonDevice" ID="MicroPythonDevice"></a> |
|
53 <h2>MicroPythonDevice</h2> |
|
54 |
|
55 <p> |
|
56 Base class for the more specific MicroPython devices. |
|
57 </p> |
|
58 <h3>Derived from</h3> |
|
59 QObject |
|
60 <h3>Class Attributes</h3> |
|
61 |
|
62 <table> |
|
63 <tr><td>None</td></tr> |
|
64 </table> |
|
65 <h3>Class Methods</h3> |
|
66 |
|
67 <table> |
|
68 <tr><td>None</td></tr> |
|
69 </table> |
|
70 <h3>Methods</h3> |
|
71 |
|
72 <table> |
|
73 |
|
74 <tr> |
|
75 <td><a href="#MicroPythonDevice.__init__">MicroPythonDevice</a></td> |
|
76 <td>Constructor</td> |
|
77 </tr> |
|
78 <tr> |
|
79 <td><a href="#MicroPythonDevice.addDeviceMenuEntries">addDeviceMenuEntries</a></td> |
|
80 <td>Public method to add device specific entries to the given menu.</td> |
|
81 </tr> |
|
82 <tr> |
|
83 <td><a href="#MicroPythonDevice.canRunScript">canRunScript</a></td> |
|
84 <td>Public method to determine, if a script can be executed.</td> |
|
85 </tr> |
|
86 <tr> |
|
87 <td><a href="#MicroPythonDevice.canStartFileManager">canStartFileManager</a></td> |
|
88 <td>Public method to determine, if a File Manager can be started.</td> |
|
89 </tr> |
|
90 <tr> |
|
91 <td><a href="#MicroPythonDevice.canStartPlotter">canStartPlotter</a></td> |
|
92 <td>Public method to determine, if a Plotter can be started.</td> |
|
93 </tr> |
|
94 <tr> |
|
95 <td><a href="#MicroPythonDevice.canStartRepl">canStartRepl</a></td> |
|
96 <td>Public method to determine, if a REPL can be started.</td> |
|
97 </tr> |
|
98 <tr> |
|
99 <td><a href="#MicroPythonDevice.checkDeviceData">checkDeviceData</a></td> |
|
100 <td>Public method to check the validity of the device data determined during connecting the device.</td> |
|
101 </tr> |
|
102 <tr> |
|
103 <td><a href="#MicroPythonDevice.deviceName">deviceName</a></td> |
|
104 <td>Public method to get the name of the device.</td> |
|
105 </tr> |
|
106 <tr> |
|
107 <td><a href="#MicroPythonDevice.downloadFirmware">downloadFirmware</a></td> |
|
108 <td>Public method to download the device firmware.</td> |
|
109 </tr> |
|
110 <tr> |
|
111 <td><a href="#MicroPythonDevice.forceInterrupt">forceInterrupt</a></td> |
|
112 <td>Public method to determine the need for an interrupt when opening the serial connection.</td> |
|
113 </tr> |
|
114 <tr> |
|
115 <td><a href="#MicroPythonDevice.getDeviceData">getDeviceData</a></td> |
|
116 <td>Public method to get a copy of the determined device data.</td> |
|
117 </tr> |
|
118 <tr> |
|
119 <td><a href="#MicroPythonDevice.getDeviceType">getDeviceType</a></td> |
|
120 <td>Public method to get the device type.</td> |
|
121 </tr> |
|
122 <tr> |
|
123 <td><a href="#MicroPythonDevice.getDocumentationUrl">getDocumentationUrl</a></td> |
|
124 <td>Public method to get the device documentation URL.</td> |
|
125 </tr> |
|
126 <tr> |
|
127 <td><a href="#MicroPythonDevice.getDownloadMenuEntries">getDownloadMenuEntries</a></td> |
|
128 <td>Public method to retrieve the entries for the downloads menu.</td> |
|
129 </tr> |
|
130 <tr> |
|
131 <td><a href="#MicroPythonDevice.getFirmwareUrl">getFirmwareUrl</a></td> |
|
132 <td>Public method to get the device firmware download URL.</td> |
|
133 </tr> |
|
134 <tr> |
|
135 <td><a href="#MicroPythonDevice.getWorkspace">getWorkspace</a></td> |
|
136 <td>Public method to get the workspace directory.</td> |
|
137 </tr> |
|
138 <tr> |
|
139 <td><a href="#MicroPythonDevice.handleDataFlood">handleDataFlood</a></td> |
|
140 <td>Public slot handling a data floof from the device.</td> |
|
141 </tr> |
|
142 <tr> |
|
143 <td><a href="#MicroPythonDevice.hasDocumentationUrl">hasDocumentationUrl</a></td> |
|
144 <td>Public method to check, if the device has a configured documentation URL.</td> |
|
145 </tr> |
|
146 <tr> |
|
147 <td><a href="#MicroPythonDevice.hasFirmwareUrl">hasFirmwareUrl</a></td> |
|
148 <td>Public method to check, if the device has a configured firmware download URL.</td> |
|
149 </tr> |
|
150 <tr> |
|
151 <td><a href="#MicroPythonDevice.hasFlashMenuEntry">hasFlashMenuEntry</a></td> |
|
152 <td>Public method to check, if the device has its own flash menu entry.</td> |
|
153 </tr> |
|
154 <tr> |
|
155 <td><a href="#MicroPythonDevice.hasTimeCommands">hasTimeCommands</a></td> |
|
156 <td>Public method to check, if the device supports time commands.</td> |
|
157 </tr> |
|
158 <tr> |
|
159 <td><a href="#MicroPythonDevice.runScript">runScript</a></td> |
|
160 <td>Public method to run the given Python script.</td> |
|
161 </tr> |
|
162 <tr> |
|
163 <td><a href="#MicroPythonDevice.selectDeviceDirectory">selectDeviceDirectory</a></td> |
|
164 <td>Public method to select the device directory from a list of detected ones.</td> |
|
165 </tr> |
|
166 <tr> |
|
167 <td><a href="#MicroPythonDevice.sendCommands">sendCommands</a></td> |
|
168 <td>Public method to send a list of commands to the device.</td> |
|
169 </tr> |
|
170 <tr> |
|
171 <td><a href="#MicroPythonDevice.setButtons">setButtons</a></td> |
|
172 <td>Public method to enable the supported action buttons.</td> |
|
173 </tr> |
|
174 <tr> |
|
175 <td><a href="#MicroPythonDevice.setConnected">setConnected</a></td> |
|
176 <td>Public method to set the connection state.</td> |
|
177 </tr> |
|
178 <tr> |
|
179 <td><a href="#MicroPythonDevice.setFileManager">setFileManager</a></td> |
|
180 <td>Public method to set the File Manager status and dependent status.</td> |
|
181 </tr> |
|
182 <tr> |
|
183 <td><a href="#MicroPythonDevice.setPlotter">setPlotter</a></td> |
|
184 <td>Public method to set the Plotter status and dependent status.</td> |
|
185 </tr> |
|
186 <tr> |
|
187 <td><a href="#MicroPythonDevice.setRepl">setRepl</a></td> |
|
188 <td>Public method to set the REPL status and dependent status.</td> |
|
189 </tr> |
|
190 <tr> |
|
191 <td><a href="#MicroPythonDevice.supportsLocalFileAccess">supportsLocalFileAccess</a></td> |
|
192 <td>Public method to indicate file access via a local directory.</td> |
|
193 </tr> |
|
194 </table> |
|
195 <h3>Static Methods</h3> |
|
196 |
|
197 <table> |
|
198 <tr><td>None</td></tr> |
|
199 </table> |
|
200 |
|
201 <a NAME="MicroPythonDevice.__init__" ID="MicroPythonDevice.__init__"></a> |
|
202 <h4>MicroPythonDevice (Constructor)</h4> |
|
203 <b>MicroPythonDevice</b>(<i>microPythonWidget, deviceType, parent=None</i>) |
|
204 |
|
205 <p> |
|
206 Constructor |
|
207 </p> |
|
208 <dl> |
|
209 |
|
210 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
|
211 <dd> |
|
212 reference to the main MicroPython widget |
|
213 </dd> |
|
214 <dt><i>deviceType</i> (str)</dt> |
|
215 <dd> |
|
216 device type assigned to this device interface |
|
217 </dd> |
|
218 <dt><i>parent</i> (QObject)</dt> |
|
219 <dd> |
|
220 reference to the parent object |
|
221 </dd> |
|
222 </dl> |
|
223 <a NAME="MicroPythonDevice.addDeviceMenuEntries" ID="MicroPythonDevice.addDeviceMenuEntries"></a> |
|
224 <h4>MicroPythonDevice.addDeviceMenuEntries</h4> |
|
225 <b>addDeviceMenuEntries</b>(<i>menu</i>) |
|
226 |
|
227 <p> |
|
228 Public method to add device specific entries to the given menu. |
|
229 </p> |
|
230 <dl> |
|
231 |
|
232 <dt><i>menu</i> (QMenu)</dt> |
|
233 <dd> |
|
234 reference to the context menu |
|
235 </dd> |
|
236 </dl> |
|
237 <a NAME="MicroPythonDevice.canRunScript" ID="MicroPythonDevice.canRunScript"></a> |
|
238 <h4>MicroPythonDevice.canRunScript</h4> |
|
239 <b>canRunScript</b>(<i></i>) |
|
240 |
|
241 <p> |
|
242 Public method to determine, if a script can be executed. |
|
243 </p> |
|
244 <dl> |
|
245 <dt>Return:</dt> |
|
246 <dd> |
|
247 tuple containing a flag indicating it is safe to start a |
|
248 Plotter and a reason why it cannot. |
|
249 </dd> |
|
250 </dl> |
|
251 <dl> |
|
252 <dt>Return Type:</dt> |
|
253 <dd> |
|
254 tuple of (bool, str) |
|
255 </dd> |
|
256 </dl> |
|
257 <a NAME="MicroPythonDevice.canStartFileManager" ID="MicroPythonDevice.canStartFileManager"></a> |
|
258 <h4>MicroPythonDevice.canStartFileManager</h4> |
|
259 <b>canStartFileManager</b>(<i></i>) |
|
260 |
|
261 <p> |
|
262 Public method to determine, if a File Manager can be started. |
|
263 </p> |
|
264 <dl> |
|
265 <dt>Return:</dt> |
|
266 <dd> |
|
267 tuple containing a flag indicating it is safe to start a |
|
268 File Manager and a reason why it cannot. |
|
269 </dd> |
|
270 </dl> |
|
271 <dl> |
|
272 <dt>Return Type:</dt> |
|
273 <dd> |
|
274 tuple of (bool, str) |
|
275 </dd> |
|
276 </dl> |
|
277 <a NAME="MicroPythonDevice.canStartPlotter" ID="MicroPythonDevice.canStartPlotter"></a> |
|
278 <h4>MicroPythonDevice.canStartPlotter</h4> |
|
279 <b>canStartPlotter</b>(<i></i>) |
|
280 |
|
281 <p> |
|
282 Public method to determine, if a Plotter can be started. |
|
283 </p> |
|
284 <dl> |
|
285 <dt>Return:</dt> |
|
286 <dd> |
|
287 tuple containing a flag indicating it is safe to start a |
|
288 Plotter and a reason why it cannot. |
|
289 </dd> |
|
290 </dl> |
|
291 <dl> |
|
292 <dt>Return Type:</dt> |
|
293 <dd> |
|
294 tuple of (bool, str) |
|
295 </dd> |
|
296 </dl> |
|
297 <a NAME="MicroPythonDevice.canStartRepl" ID="MicroPythonDevice.canStartRepl"></a> |
|
298 <h4>MicroPythonDevice.canStartRepl</h4> |
|
299 <b>canStartRepl</b>(<i></i>) |
|
300 |
|
301 <p> |
|
302 Public method to determine, if a REPL can be started. |
|
303 </p> |
|
304 <dl> |
|
305 <dt>Return:</dt> |
|
306 <dd> |
|
307 tuple containing a flag indicating it is safe to start a REPL |
|
308 and a reason why it cannot. |
|
309 </dd> |
|
310 </dl> |
|
311 <dl> |
|
312 <dt>Return Type:</dt> |
|
313 <dd> |
|
314 tuple of (bool, str) |
|
315 </dd> |
|
316 </dl> |
|
317 <a NAME="MicroPythonDevice.checkDeviceData" ID="MicroPythonDevice.checkDeviceData"></a> |
|
318 <h4>MicroPythonDevice.checkDeviceData</h4> |
|
319 <b>checkDeviceData</b>(<i></i>) |
|
320 |
|
321 <p> |
|
322 Public method to check the validity of the device data determined during |
|
323 connecting the device. |
|
324 </p> |
|
325 <dl> |
|
326 <dt>Return:</dt> |
|
327 <dd> |
|
328 flag indicating valid device data |
|
329 </dd> |
|
330 </dl> |
|
331 <dl> |
|
332 <dt>Return Type:</dt> |
|
333 <dd> |
|
334 bool |
|
335 </dd> |
|
336 </dl> |
|
337 <a NAME="MicroPythonDevice.deviceName" ID="MicroPythonDevice.deviceName"></a> |
|
338 <h4>MicroPythonDevice.deviceName</h4> |
|
339 <b>deviceName</b>(<i></i>) |
|
340 |
|
341 <p> |
|
342 Public method to get the name of the device. |
|
343 </p> |
|
344 <dl> |
|
345 <dt>Return:</dt> |
|
346 <dd> |
|
347 name of the device |
|
348 </dd> |
|
349 </dl> |
|
350 <dl> |
|
351 <dt>Return Type:</dt> |
|
352 <dd> |
|
353 str |
|
354 </dd> |
|
355 </dl> |
|
356 <a NAME="MicroPythonDevice.downloadFirmware" ID="MicroPythonDevice.downloadFirmware"></a> |
|
357 <h4>MicroPythonDevice.downloadFirmware</h4> |
|
358 <b>downloadFirmware</b>(<i></i>) |
|
359 |
|
360 <p> |
|
361 Public method to download the device firmware. |
|
362 </p> |
|
363 <a NAME="MicroPythonDevice.forceInterrupt" ID="MicroPythonDevice.forceInterrupt"></a> |
|
364 <h4>MicroPythonDevice.forceInterrupt</h4> |
|
365 <b>forceInterrupt</b>(<i></i>) |
|
366 |
|
367 <p> |
|
368 Public method to determine the need for an interrupt when opening the |
|
369 serial connection. |
|
370 </p> |
|
371 <dl> |
|
372 <dt>Return:</dt> |
|
373 <dd> |
|
374 flag indicating an interrupt is needed |
|
375 </dd> |
|
376 </dl> |
|
377 <dl> |
|
378 <dt>Return Type:</dt> |
|
379 <dd> |
|
380 bool |
|
381 </dd> |
|
382 </dl> |
|
383 <a NAME="MicroPythonDevice.getDeviceData" ID="MicroPythonDevice.getDeviceData"></a> |
|
384 <h4>MicroPythonDevice.getDeviceData</h4> |
|
385 <b>getDeviceData</b>(<i></i>) |
|
386 |
|
387 <p> |
|
388 Public method to get a copy of the determined device data. |
|
389 </p> |
|
390 <dl> |
|
391 <dt>Return:</dt> |
|
392 <dd> |
|
393 dictionary containing the essential device data |
|
394 </dd> |
|
395 </dl> |
|
396 <dl> |
|
397 <dt>Return Type:</dt> |
|
398 <dd> |
|
399 dict |
|
400 </dd> |
|
401 </dl> |
|
402 <a NAME="MicroPythonDevice.getDeviceType" ID="MicroPythonDevice.getDeviceType"></a> |
|
403 <h4>MicroPythonDevice.getDeviceType</h4> |
|
404 <b>getDeviceType</b>(<i></i>) |
|
405 |
|
406 <p> |
|
407 Public method to get the device type. |
|
408 </p> |
|
409 <dl> |
|
410 <dt>Return:</dt> |
|
411 <dd> |
|
412 type of the device |
|
413 </dd> |
|
414 </dl> |
|
415 <dl> |
|
416 <dt>Return Type:</dt> |
|
417 <dd> |
|
418 str |
|
419 </dd> |
|
420 </dl> |
|
421 <a NAME="MicroPythonDevice.getDocumentationUrl" ID="MicroPythonDevice.getDocumentationUrl"></a> |
|
422 <h4>MicroPythonDevice.getDocumentationUrl</h4> |
|
423 <b>getDocumentationUrl</b>(<i></i>) |
|
424 |
|
425 <p> |
|
426 Public method to get the device documentation URL. |
|
427 </p> |
|
428 <dl> |
|
429 <dt>Return:</dt> |
|
430 <dd> |
|
431 documentation URL of the device |
|
432 </dd> |
|
433 </dl> |
|
434 <dl> |
|
435 <dt>Return Type:</dt> |
|
436 <dd> |
|
437 str |
|
438 </dd> |
|
439 </dl> |
|
440 <a NAME="MicroPythonDevice.getDownloadMenuEntries" ID="MicroPythonDevice.getDownloadMenuEntries"></a> |
|
441 <h4>MicroPythonDevice.getDownloadMenuEntries</h4> |
|
442 <b>getDownloadMenuEntries</b>(<i></i>) |
|
443 |
|
444 <p> |
|
445 Public method to retrieve the entries for the downloads menu. |
|
446 </p> |
|
447 <dl> |
|
448 <dt>Return:</dt> |
|
449 <dd> |
|
450 list of tuples with menu text and URL to be opened for each |
|
451 entry |
|
452 </dd> |
|
453 </dl> |
|
454 <dl> |
|
455 <dt>Return Type:</dt> |
|
456 <dd> |
|
457 list of tuple of (str, str) |
|
458 </dd> |
|
459 </dl> |
|
460 <a NAME="MicroPythonDevice.getFirmwareUrl" ID="MicroPythonDevice.getFirmwareUrl"></a> |
|
461 <h4>MicroPythonDevice.getFirmwareUrl</h4> |
|
462 <b>getFirmwareUrl</b>(<i></i>) |
|
463 |
|
464 <p> |
|
465 Public method to get the device firmware download URL. |
|
466 </p> |
|
467 <dl> |
|
468 <dt>Return:</dt> |
|
469 <dd> |
|
470 firmware download URL of the device |
|
471 </dd> |
|
472 </dl> |
|
473 <dl> |
|
474 <dt>Return Type:</dt> |
|
475 <dd> |
|
476 str |
|
477 </dd> |
|
478 </dl> |
|
479 <a NAME="MicroPythonDevice.getWorkspace" ID="MicroPythonDevice.getWorkspace"></a> |
|
480 <h4>MicroPythonDevice.getWorkspace</h4> |
|
481 <b>getWorkspace</b>(<i></i>) |
|
482 |
|
483 <p> |
|
484 Public method to get the workspace directory. |
|
485 </p> |
|
486 <dl> |
|
487 <dt>Return:</dt> |
|
488 <dd> |
|
489 workspace directory used for saving files |
|
490 </dd> |
|
491 </dl> |
|
492 <dl> |
|
493 <dt>Return Type:</dt> |
|
494 <dd> |
|
495 str |
|
496 </dd> |
|
497 </dl> |
|
498 <a NAME="MicroPythonDevice.handleDataFlood" ID="MicroPythonDevice.handleDataFlood"></a> |
|
499 <h4>MicroPythonDevice.handleDataFlood</h4> |
|
500 <b>handleDataFlood</b>(<i></i>) |
|
501 |
|
502 <p> |
|
503 Public slot handling a data floof from the device. |
|
504 </p> |
|
505 <a NAME="MicroPythonDevice.hasDocumentationUrl" ID="MicroPythonDevice.hasDocumentationUrl"></a> |
|
506 <h4>MicroPythonDevice.hasDocumentationUrl</h4> |
|
507 <b>hasDocumentationUrl</b>(<i></i>) |
|
508 |
|
509 <p> |
|
510 Public method to check, if the device has a configured documentation |
|
511 URL. |
|
512 </p> |
|
513 <dl> |
|
514 <dt>Return:</dt> |
|
515 <dd> |
|
516 flag indicating a configured documentation URL |
|
517 </dd> |
|
518 </dl> |
|
519 <dl> |
|
520 <dt>Return Type:</dt> |
|
521 <dd> |
|
522 bool |
|
523 </dd> |
|
524 </dl> |
|
525 <a NAME="MicroPythonDevice.hasFirmwareUrl" ID="MicroPythonDevice.hasFirmwareUrl"></a> |
|
526 <h4>MicroPythonDevice.hasFirmwareUrl</h4> |
|
527 <b>hasFirmwareUrl</b>(<i></i>) |
|
528 |
|
529 <p> |
|
530 Public method to check, if the device has a configured firmware |
|
531 download URL. |
|
532 </p> |
|
533 <dl> |
|
534 <dt>Return:</dt> |
|
535 <dd> |
|
536 flag indicating a configured firmware download URL |
|
537 </dd> |
|
538 </dl> |
|
539 <dl> |
|
540 <dt>Return Type:</dt> |
|
541 <dd> |
|
542 bool |
|
543 </dd> |
|
544 </dl> |
|
545 <a NAME="MicroPythonDevice.hasFlashMenuEntry" ID="MicroPythonDevice.hasFlashMenuEntry"></a> |
|
546 <h4>MicroPythonDevice.hasFlashMenuEntry</h4> |
|
547 <b>hasFlashMenuEntry</b>(<i></i>) |
|
548 |
|
549 <p> |
|
550 Public method to check, if the device has its own flash menu entry. |
|
551 </p> |
|
552 <dl> |
|
553 <dt>Return:</dt> |
|
554 <dd> |
|
555 flag indicating a specific flash menu entry |
|
556 </dd> |
|
557 </dl> |
|
558 <dl> |
|
559 <dt>Return Type:</dt> |
|
560 <dd> |
|
561 bool |
|
562 </dd> |
|
563 </dl> |
|
564 <a NAME="MicroPythonDevice.hasTimeCommands" ID="MicroPythonDevice.hasTimeCommands"></a> |
|
565 <h4>MicroPythonDevice.hasTimeCommands</h4> |
|
566 <b>hasTimeCommands</b>(<i></i>) |
|
567 |
|
568 <p> |
|
569 Public method to check, if the device supports time commands. |
|
570 </p> |
|
571 <p> |
|
572 The default returns True. |
|
573 </p> |
|
574 <dl> |
|
575 <dt>Return:</dt> |
|
576 <dd> |
|
577 flag indicating support for time commands |
|
578 </dd> |
|
579 </dl> |
|
580 <dl> |
|
581 <dt>Return Type:</dt> |
|
582 <dd> |
|
583 bool |
|
584 </dd> |
|
585 </dl> |
|
586 <a NAME="MicroPythonDevice.runScript" ID="MicroPythonDevice.runScript"></a> |
|
587 <h4>MicroPythonDevice.runScript</h4> |
|
588 <b>runScript</b>(<i>script</i>) |
|
589 |
|
590 <p> |
|
591 Public method to run the given Python script. |
|
592 </p> |
|
593 <dl> |
|
594 |
|
595 <dt><i>script</i> (str)</dt> |
|
596 <dd> |
|
597 script to be executed |
|
598 </dd> |
|
599 </dl> |
|
600 <a NAME="MicroPythonDevice.selectDeviceDirectory" ID="MicroPythonDevice.selectDeviceDirectory"></a> |
|
601 <h4>MicroPythonDevice.selectDeviceDirectory</h4> |
|
602 <b>selectDeviceDirectory</b>(<i>deviceDirectories</i>) |
|
603 |
|
604 <p> |
|
605 Public method to select the device directory from a list of detected |
|
606 ones. |
|
607 </p> |
|
608 <dl> |
|
609 |
|
610 <dt><i>deviceDirectories</i> (list of str)</dt> |
|
611 <dd> |
|
612 list of directories to select from |
|
613 </dd> |
|
614 </dl> |
|
615 <dl> |
|
616 <dt>Return:</dt> |
|
617 <dd> |
|
618 selected directory or an empty string |
|
619 </dd> |
|
620 </dl> |
|
621 <dl> |
|
622 <dt>Return Type:</dt> |
|
623 <dd> |
|
624 str |
|
625 </dd> |
|
626 </dl> |
|
627 <a NAME="MicroPythonDevice.sendCommands" ID="MicroPythonDevice.sendCommands"></a> |
|
628 <h4>MicroPythonDevice.sendCommands</h4> |
|
629 <b>sendCommands</b>(<i>commandsList</i>) |
|
630 |
|
631 <p> |
|
632 Public method to send a list of commands to the device. |
|
633 </p> |
|
634 <dl> |
|
635 |
|
636 <dt><i>commandsList</i> (list of str)</dt> |
|
637 <dd> |
|
638 list of commands to be sent to the device |
|
639 </dd> |
|
640 </dl> |
|
641 <a NAME="MicroPythonDevice.setButtons" ID="MicroPythonDevice.setButtons"></a> |
|
642 <h4>MicroPythonDevice.setButtons</h4> |
|
643 <b>setButtons</b>(<i></i>) |
|
644 |
|
645 <p> |
|
646 Public method to enable the supported action buttons. |
|
647 </p> |
|
648 <a NAME="MicroPythonDevice.setConnected" ID="MicroPythonDevice.setConnected"></a> |
|
649 <h4>MicroPythonDevice.setConnected</h4> |
|
650 <b>setConnected</b>(<i>connected</i>) |
|
651 |
|
652 <p> |
|
653 Public method to set the connection state. |
|
654 </p> |
|
655 <p> |
|
656 Note: This method can be overwritten to perform actions upon connect |
|
657 or disconnect of the device. |
|
658 </p> |
|
659 <dl> |
|
660 |
|
661 <dt><i>connected</i> (bool)</dt> |
|
662 <dd> |
|
663 connection state |
|
664 </dd> |
|
665 </dl> |
|
666 <a NAME="MicroPythonDevice.setFileManager" ID="MicroPythonDevice.setFileManager"></a> |
|
667 <h4>MicroPythonDevice.setFileManager</h4> |
|
668 <b>setFileManager</b>(<i>on</i>) |
|
669 |
|
670 <p> |
|
671 Public method to set the File Manager status and dependent status. |
|
672 </p> |
|
673 <dl> |
|
674 |
|
675 <dt><i>on</i> (bool)</dt> |
|
676 <dd> |
|
677 flag indicating the active status |
|
678 </dd> |
|
679 </dl> |
|
680 <a NAME="MicroPythonDevice.setPlotter" ID="MicroPythonDevice.setPlotter"></a> |
|
681 <h4>MicroPythonDevice.setPlotter</h4> |
|
682 <b>setPlotter</b>(<i>on</i>) |
|
683 |
|
684 <p> |
|
685 Public method to set the Plotter status and dependent status. |
|
686 </p> |
|
687 <dl> |
|
688 |
|
689 <dt><i>on</i> (bool)</dt> |
|
690 <dd> |
|
691 flag indicating the active status |
|
692 </dd> |
|
693 </dl> |
|
694 <a NAME="MicroPythonDevice.setRepl" ID="MicroPythonDevice.setRepl"></a> |
|
695 <h4>MicroPythonDevice.setRepl</h4> |
|
696 <b>setRepl</b>(<i>on</i>) |
|
697 |
|
698 <p> |
|
699 Public method to set the REPL status and dependent status. |
|
700 </p> |
|
701 <dl> |
|
702 |
|
703 <dt><i>on</i> (bool)</dt> |
|
704 <dd> |
|
705 flag indicating the active status |
|
706 </dd> |
|
707 </dl> |
|
708 <a NAME="MicroPythonDevice.supportsLocalFileAccess" ID="MicroPythonDevice.supportsLocalFileAccess"></a> |
|
709 <h4>MicroPythonDevice.supportsLocalFileAccess</h4> |
|
710 <b>supportsLocalFileAccess</b>(<i></i>) |
|
711 |
|
712 <p> |
|
713 Public method to indicate file access via a local directory. |
|
714 </p> |
|
715 <dl> |
|
716 <dt>Return:</dt> |
|
717 <dd> |
|
718 flag indicating file access via local directory |
|
719 </dd> |
|
720 </dl> |
|
721 <dl> |
|
722 <dt>Return Type:</dt> |
|
723 <dd> |
|
724 bool |
|
725 </dd> |
|
726 </dl> |
|
727 <div align="right"><a href="#top">Up</a></div> |
|
728 <hr /> |
|
729 <hr /> |
|
730 <a NAME="getDevice" ID="getDevice"></a> |
|
731 <h2>getDevice</h2> |
|
732 <b>getDevice</b>(<i>deviceType, microPythonWidget, vid, pid, boardName="", serialNumber=""</i>) |
|
733 |
|
734 <p> |
|
735 Public method to instantiate a specific MicroPython device interface. |
|
736 </p> |
|
737 <dl> |
|
738 |
|
739 <dt><i>deviceType</i> (str)</dt> |
|
740 <dd> |
|
741 type of the device interface |
|
742 </dd> |
|
743 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
|
744 <dd> |
|
745 reference to the main MicroPython widget |
|
746 </dd> |
|
747 <dt><i>vid</i> (int)</dt> |
|
748 <dd> |
|
749 vendor ID (only used for deviceType 'generic') |
|
750 </dd> |
|
751 <dt><i>pid</i> (int)</dt> |
|
752 <dd> |
|
753 product ID (only used for deviceType 'generic') |
|
754 </dd> |
|
755 <dt><i>boardName</i> (str (optional))</dt> |
|
756 <dd> |
|
757 name of the board (defaults to "") |
|
758 </dd> |
|
759 <dt><i>serialNumber</i> (str (optional))</dt> |
|
760 <dd> |
|
761 serial number of the board (defaults to "") |
|
762 </dd> |
|
763 </dl> |
|
764 <dl> |
|
765 <dt>Return:</dt> |
|
766 <dd> |
|
767 instantiated device interface |
|
768 </dd> |
|
769 </dl> |
|
770 <dl> |
|
771 <dt>Return Type:</dt> |
|
772 <dd> |
|
773 MicroPythonDevice |
|
774 </dd> |
|
775 </dl> |
|
776 <div align="right"><a href="#top">Up</a></div> |
|
777 <hr /> |
|
778 <hr /> |
|
779 <a NAME="getDeviceIcon" ID="getDeviceIcon"></a> |
|
780 <h2>getDeviceIcon</h2> |
|
781 <b>getDeviceIcon</b>(<i>boardName, iconFormat=True</i>) |
|
782 |
|
783 <p> |
|
784 Function to get the icon for the given board. |
|
785 </p> |
|
786 <dl> |
|
787 |
|
788 <dt><i>boardName</i> (str)</dt> |
|
789 <dd> |
|
790 name of the board |
|
791 </dd> |
|
792 <dt><i>iconFormat</i> (bool)</dt> |
|
793 <dd> |
|
794 flag indicating to get an icon or a pixmap |
|
795 </dd> |
|
796 </dl> |
|
797 <dl> |
|
798 <dt>Return:</dt> |
|
799 <dd> |
|
800 icon for the board (iconFormat == True) or |
|
801 a pixmap (iconFormat == False) |
|
802 </dd> |
|
803 </dl> |
|
804 <dl> |
|
805 <dt>Return Type:</dt> |
|
806 <dd> |
|
807 QIcon or QPixmap |
|
808 </dd> |
|
809 </dl> |
|
810 <div align="right"><a href="#top">Up</a></div> |
|
811 <hr /> |
|
812 <hr /> |
|
813 <a NAME="getFoundDevices" ID="getFoundDevices"></a> |
|
814 <h2>getFoundDevices</h2> |
|
815 <b>getFoundDevices</b>(<i></i>) |
|
816 |
|
817 <p> |
|
818 Function to check the serial ports for supported MicroPython devices. |
|
819 </p> |
|
820 <dl> |
|
821 <dt>Return:</dt> |
|
822 <dd> |
|
823 tuple containing a list of tuples with the board type, the port |
|
824 description, a description, the serial port it is connected at, the |
|
825 VID and PID for known device types, a list of tuples with VID, PID |
|
826 and description for unknown devices and a list of tuples with VID, |
|
827 PID, description and port name for ports with missing VID or PID |
|
828 </dd> |
|
829 </dl> |
|
830 <dl> |
|
831 <dt>Return Type:</dt> |
|
832 <dd> |
|
833 tuple of (list of tuples of (str, str, str, str, int, int), |
|
834 list of tuples of (int, int, str), |
|
835 list of tuples of (int, int, str, str) |
|
836 </dd> |
|
837 </dl> |
|
838 <div align="right"><a href="#top">Up</a></div> |
|
839 <hr /> |
|
840 <hr /> |
|
841 <a NAME="getSupportedDevices" ID="getSupportedDevices"></a> |
|
842 <h2>getSupportedDevices</h2> |
|
843 <b>getSupportedDevices</b>(<i></i>) |
|
844 |
|
845 <p> |
|
846 Function to get a list of supported MicroPython devices. |
|
847 </p> |
|
848 <dl> |
|
849 <dt>Return:</dt> |
|
850 <dd> |
|
851 set of tuples with the board type and description |
|
852 </dd> |
|
853 </dl> |
|
854 <dl> |
|
855 <dt>Return Type:</dt> |
|
856 <dd> |
|
857 set of tuples of (str, str) |
|
858 </dd> |
|
859 </dl> |
|
860 <div align="right"><a href="#top">Up</a></div> |
|
861 <hr /> |
|
862 </body></html> |
|