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