|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.MicroPython.MicroPythonWidget</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.MicroPythonWidget</h1> |
|
23 <p> |
|
24 Module implementing the MicroPython REPL widget. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>AnsiColorSchemes</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#MicroPythonWidget">MicroPythonWidget</a></td> |
|
34 <td>Class implementing the MicroPython REPL 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="MicroPythonWidget" ID="MicroPythonWidget"></a> |
|
43 <h2>MicroPythonWidget</h2> |
|
44 <p> |
|
45 Class implementing the MicroPython REPL widget. |
|
46 </p><h3>Signals</h3> |
|
47 <dl> |
|
48 <dt>dataReceived(data)</dt> |
|
49 <dd> |
|
50 emitted to send data received via the serial |
|
51 connection for further processing |
|
52 </dd> |
|
53 </dl> |
|
54 <h3>Derived from</h3> |
|
55 QWidget, Ui_MicroPythonWidget |
|
56 <h3>Class Attributes</h3> |
|
57 <table> |
|
58 <tr><td>DevicePortRole</td></tr><tr><td>DeviceTypeRole</td></tr><tr><td>ZoomMax</td></tr><tr><td>ZoomMin</td></tr> |
|
59 </table> |
|
60 <h3>Class Methods</h3> |
|
61 <table> |
|
62 <tr><td>None</td></tr> |
|
63 </table> |
|
64 <h3>Methods</h3> |
|
65 <table> |
|
66 <tr> |
|
67 <td><a href="#MicroPythonWidget.__init__">MicroPythonWidget</a></td> |
|
68 <td>Constructor</td> |
|
69 </tr><tr> |
|
70 <td><a href="#MicroPythonWidget.__aboutToShowSuperMenu">__aboutToShowSuperMenu</a></td> |
|
71 <td>Private slot to populate the Super Menu before showing it.</td> |
|
72 </tr><tr> |
|
73 <td><a href="#MicroPythonWidget.__clear">__clear</a></td> |
|
74 <td>Private slot to clear the REPL pane.</td> |
|
75 </tr><tr> |
|
76 <td><a href="#MicroPythonWidget.__compileEditor2Mpy">__compileEditor2Mpy</a></td> |
|
77 <td>Private slot to cross compile the current editor to a .mpy file.</td> |
|
78 </tr><tr> |
|
79 <td><a href="#MicroPythonWidget.__compileFile2Mpy">__compileFile2Mpy</a></td> |
|
80 <td>Private slot to cross compile a Python file (*.py) to a .mpy file.</td> |
|
81 </tr><tr> |
|
82 <td><a href="#MicroPythonWidget.__connectToDevice">__connectToDevice</a></td> |
|
83 <td>Private method to connect to the selected device.</td> |
|
84 </tr><tr> |
|
85 <td><a href="#MicroPythonWidget.__crossCompile">__crossCompile</a></td> |
|
86 <td>Private method to cross compile a Python file to a .mpy file.</td> |
|
87 </tr><tr> |
|
88 <td><a href="#MicroPythonWidget.__disconnectFromDevice">__disconnectFromDevice</a></td> |
|
89 <td>Private method to disconnect from the device.</td> |
|
90 </tr><tr> |
|
91 <td><a href="#MicroPythonWidget.__doZoom">__doZoom</a></td> |
|
92 <td>Private slot to zoom the REPL pane.</td> |
|
93 </tr><tr> |
|
94 <td><a href="#MicroPythonWidget.__getDeviceTime">__getDeviceTime</a></td> |
|
95 <td>Private method to get a string containing the date and time of the connected device.</td> |
|
96 </tr><tr> |
|
97 <td><a href="#MicroPythonWidget.__handlePreferencesChanged">__handlePreferencesChanged</a></td> |
|
98 <td>Private slot to handle a change in preferences.</td> |
|
99 </tr><tr> |
|
100 <td><a href="#MicroPythonWidget.__paste">__paste</a></td> |
|
101 <td>Private slot to perform a paste operation.</td> |
|
102 </tr><tr> |
|
103 <td><a href="#MicroPythonWidget.__populateDeviceTypeComboBox">__populateDeviceTypeComboBox</a></td> |
|
104 <td>Private method to populate the device type selector.</td> |
|
105 </tr><tr> |
|
106 <td><a href="#MicroPythonWidget.__processData">__processData</a></td> |
|
107 <td>Private slot to process bytes received from the device.</td> |
|
108 </tr><tr> |
|
109 <td><a href="#MicroPythonWidget.__setCharFormat">__setCharFormat</a></td> |
|
110 <td>Private method setting the current text format of the REPL pane based on the passed ANSI codes.</td> |
|
111 </tr><tr> |
|
112 <td><a href="#MicroPythonWidget.__setConnected">__setConnected</a></td> |
|
113 <td>Private method to set the connection status LED.</td> |
|
114 </tr><tr> |
|
115 <td><a href="#MicroPythonWidget.__showContextMenu">__showContextMenu</a></td> |
|
116 <td>Private slot to show the REPL context menu.</td> |
|
117 </tr><tr> |
|
118 <td><a href="#MicroPythonWidget.__showDeviceTime">__showDeviceTime</a></td> |
|
119 <td>Private slot to show the date and time of the connected device.</td> |
|
120 </tr><tr> |
|
121 <td><a href="#MicroPythonWidget.__showDeviceVersion">__showDeviceVersion</a></td> |
|
122 <td>Private slot to show some version info about MicroPython of the device.</td> |
|
123 </tr><tr> |
|
124 <td><a href="#MicroPythonWidget.__showError">__showError</a></td> |
|
125 <td>Private method to show some error message.</td> |
|
126 </tr><tr> |
|
127 <td><a href="#MicroPythonWidget.__showImplementation">__showImplementation</a></td> |
|
128 <td>Private slot to show some implementation related information.</td> |
|
129 </tr><tr> |
|
130 <td><a href="#MicroPythonWidget.__showLocalTime">__showLocalTime</a></td> |
|
131 <td>Private slot to show the local date and time.</td> |
|
132 </tr><tr> |
|
133 <td><a href="#MicroPythonWidget.__showNoDeviceMessage">__showNoDeviceMessage</a></td> |
|
134 <td>Private method to show a message dialog indicating a missing device.</td> |
|
135 </tr><tr> |
|
136 <td><a href="#MicroPythonWidget.__synchronizeTime">__synchronizeTime</a></td> |
|
137 <td>Private slot to set the time of the connected device to the local computer's time.</td> |
|
138 </tr><tr> |
|
139 <td><a href="#MicroPythonWidget.commandsInterface">commandsInterface</a></td> |
|
140 <td>Public method to get a reference to the commands interface object.</td> |
|
141 </tr><tr> |
|
142 <td><a href="#MicroPythonWidget.eventFilter">eventFilter</a></td> |
|
143 <td>Public method to process events for the REPL pane.</td> |
|
144 </tr><tr> |
|
145 <td><a href="#MicroPythonWidget.getCurrentPort">getCurrentPort</a></td> |
|
146 <td>Public method to determine the port path of the selected device.</td> |
|
147 </tr><tr> |
|
148 <td><a href="#MicroPythonWidget.getDeviceWorkspace">getDeviceWorkspace</a></td> |
|
149 <td>Public method to get the workspace directory of the device.</td> |
|
150 </tr><tr> |
|
151 <td><a href="#MicroPythonWidget.handleDataFlood">handleDataFlood</a></td> |
|
152 <td>Public slot handling a data flood from the device.</td> |
|
153 </tr><tr> |
|
154 <td><a href="#MicroPythonWidget.isConnected">isConnected</a></td> |
|
155 <td>Public method to get the connection state.</td> |
|
156 </tr><tr> |
|
157 <td><a href="#MicroPythonWidget.isMicrobit">isMicrobit</a></td> |
|
158 <td>Public method to check, if the connected/selected device is a BBC micro:bit.</td> |
|
159 </tr><tr> |
|
160 <td><a href="#MicroPythonWidget.on_chartButton_clicked">on_chartButton_clicked</a></td> |
|
161 <td>Private slot to open a chart view to plot data received from the connected device.</td> |
|
162 </tr><tr> |
|
163 <td><a href="#MicroPythonWidget.on_checkButton_clicked">on_checkButton_clicked</a></td> |
|
164 <td>Private slot to check for connected devices.</td> |
|
165 </tr><tr> |
|
166 <td><a href="#MicroPythonWidget.on_connectButton_clicked">on_connectButton_clicked</a></td> |
|
167 <td>Private slot to connect to the selected device or disconnect from the currently connected device.</td> |
|
168 </tr><tr> |
|
169 <td><a href="#MicroPythonWidget.on_deviceTypeComboBox_activated">on_deviceTypeComboBox_activated</a></td> |
|
170 <td>Private slot handling the selection of a device type.</td> |
|
171 </tr><tr> |
|
172 <td><a href="#MicroPythonWidget.on_filesButton_clicked">on_filesButton_clicked</a></td> |
|
173 <td>Private slot to open a file manager window to the connected device.</td> |
|
174 </tr><tr> |
|
175 <td><a href="#MicroPythonWidget.on_openButton_clicked">on_openButton_clicked</a></td> |
|
176 <td>Private slot to open a file of the connected device.</td> |
|
177 </tr><tr> |
|
178 <td><a href="#MicroPythonWidget.on_replButton_clicked">on_replButton_clicked</a></td> |
|
179 <td>Private slot to connect to enable or disable the REPL widget.</td> |
|
180 </tr><tr> |
|
181 <td><a href="#MicroPythonWidget.on_runButton_clicked">on_runButton_clicked</a></td> |
|
182 <td>Private slot to execute the script of the active editor on the selected device.</td> |
|
183 </tr><tr> |
|
184 <td><a href="#MicroPythonWidget.on_saveButton_clicked">on_saveButton_clicked</a></td> |
|
185 <td>Private slot to save the current editor to the connected device.</td> |
|
186 </tr><tr> |
|
187 <td><a href="#MicroPythonWidget.setActionButtons">setActionButtons</a></td> |
|
188 <td>Public method to set the enabled state of the various action buttons.</td> |
|
189 </tr> |
|
190 </table> |
|
191 <h3>Static Methods</h3> |
|
192 <table> |
|
193 <tr><td>None</td></tr> |
|
194 </table> |
|
195 <a NAME="MicroPythonWidget.__init__" ID="MicroPythonWidget.__init__"></a> |
|
196 <h4>MicroPythonWidget (Constructor)</h4> |
|
197 <b>MicroPythonWidget</b>(<i>parent=None</i>) |
|
198 <p> |
|
199 Constructor |
|
200 </p><dl> |
|
201 <dt><i>parent</i> (QWidget)</dt> |
|
202 <dd> |
|
203 reference to the parent widget |
|
204 </dd> |
|
205 </dl><a NAME="MicroPythonWidget.__aboutToShowSuperMenu" ID="MicroPythonWidget.__aboutToShowSuperMenu"></a> |
|
206 <h4>MicroPythonWidget.__aboutToShowSuperMenu</h4> |
|
207 <b>__aboutToShowSuperMenu</b>(<i></i>) |
|
208 <p> |
|
209 Private slot to populate the Super Menu before showing it. |
|
210 </p><a NAME="MicroPythonWidget.__clear" ID="MicroPythonWidget.__clear"></a> |
|
211 <h4>MicroPythonWidget.__clear</h4> |
|
212 <b>__clear</b>(<i></i>) |
|
213 <p> |
|
214 Private slot to clear the REPL pane. |
|
215 </p><a NAME="MicroPythonWidget.__compileEditor2Mpy" ID="MicroPythonWidget.__compileEditor2Mpy"></a> |
|
216 <h4>MicroPythonWidget.__compileEditor2Mpy</h4> |
|
217 <b>__compileEditor2Mpy</b>(<i></i>) |
|
218 <p> |
|
219 Private slot to cross compile the current editor to a .mpy file. |
|
220 </p><a NAME="MicroPythonWidget.__compileFile2Mpy" ID="MicroPythonWidget.__compileFile2Mpy"></a> |
|
221 <h4>MicroPythonWidget.__compileFile2Mpy</h4> |
|
222 <b>__compileFile2Mpy</b>(<i></i>) |
|
223 <p> |
|
224 Private slot to cross compile a Python file (*.py) to a .mpy file. |
|
225 </p><a NAME="MicroPythonWidget.__connectToDevice" ID="MicroPythonWidget.__connectToDevice"></a> |
|
226 <h4>MicroPythonWidget.__connectToDevice</h4> |
|
227 <b>__connectToDevice</b>(<i></i>) |
|
228 <p> |
|
229 Private method to connect to the selected device. |
|
230 </p><a NAME="MicroPythonWidget.__crossCompile" ID="MicroPythonWidget.__crossCompile"></a> |
|
231 <h4>MicroPythonWidget.__crossCompile</h4> |
|
232 <b>__crossCompile</b>(<i>pythonFile="", title=""</i>) |
|
233 <p> |
|
234 Private method to cross compile a Python file to a .mpy file. |
|
235 </p><dl> |
|
236 <dt><i>pythonFile</i> (str)</dt> |
|
237 <dd> |
|
238 name of the Python file to be compiled |
|
239 </dd><dt><i>title</i> (str)</dt> |
|
240 <dd> |
|
241 title for the various dialogs |
|
242 </dd> |
|
243 </dl><a NAME="MicroPythonWidget.__disconnectFromDevice" ID="MicroPythonWidget.__disconnectFromDevice"></a> |
|
244 <h4>MicroPythonWidget.__disconnectFromDevice</h4> |
|
245 <b>__disconnectFromDevice</b>(<i></i>) |
|
246 <p> |
|
247 Private method to disconnect from the device. |
|
248 </p><a NAME="MicroPythonWidget.__doZoom" ID="MicroPythonWidget.__doZoom"></a> |
|
249 <h4>MicroPythonWidget.__doZoom</h4> |
|
250 <b>__doZoom</b>(<i>value</i>) |
|
251 <p> |
|
252 Private slot to zoom the REPL pane. |
|
253 </p><dl> |
|
254 <dt><i>value</i> (int)</dt> |
|
255 <dd> |
|
256 zoom value |
|
257 </dd> |
|
258 </dl><a NAME="MicroPythonWidget.__getDeviceTime" ID="MicroPythonWidget.__getDeviceTime"></a> |
|
259 <h4>MicroPythonWidget.__getDeviceTime</h4> |
|
260 <b>__getDeviceTime</b>(<i></i>) |
|
261 <p> |
|
262 Private method to get a string containing the date and time of the |
|
263 connected device. |
|
264 </p><dl> |
|
265 <dt>Returns:</dt> |
|
266 <dd> |
|
267 date and time of the connected device |
|
268 </dd> |
|
269 </dl><dl> |
|
270 <dt>Return Type:</dt> |
|
271 <dd> |
|
272 str |
|
273 </dd> |
|
274 </dl><a NAME="MicroPythonWidget.__handlePreferencesChanged" ID="MicroPythonWidget.__handlePreferencesChanged"></a> |
|
275 <h4>MicroPythonWidget.__handlePreferencesChanged</h4> |
|
276 <b>__handlePreferencesChanged</b>(<i></i>) |
|
277 <p> |
|
278 Private slot to handle a change in preferences. |
|
279 </p><a NAME="MicroPythonWidget.__paste" ID="MicroPythonWidget.__paste"></a> |
|
280 <h4>MicroPythonWidget.__paste</h4> |
|
281 <b>__paste</b>(<i></i>) |
|
282 <p> |
|
283 Private slot to perform a paste operation. |
|
284 </p><a NAME="MicroPythonWidget.__populateDeviceTypeComboBox" ID="MicroPythonWidget.__populateDeviceTypeComboBox"></a> |
|
285 <h4>MicroPythonWidget.__populateDeviceTypeComboBox</h4> |
|
286 <b>__populateDeviceTypeComboBox</b>(<i></i>) |
|
287 <p> |
|
288 Private method to populate the device type selector. |
|
289 </p><a NAME="MicroPythonWidget.__processData" ID="MicroPythonWidget.__processData"></a> |
|
290 <h4>MicroPythonWidget.__processData</h4> |
|
291 <b>__processData</b>(<i>data</i>) |
|
292 <p> |
|
293 Private slot to process bytes received from the device. |
|
294 </p><dl> |
|
295 <dt><i>data</i> (bytes)</dt> |
|
296 <dd> |
|
297 bytes received from the device |
|
298 </dd> |
|
299 </dl><a NAME="MicroPythonWidget.__setCharFormat" ID="MicroPythonWidget.__setCharFormat"></a> |
|
300 <h4>MicroPythonWidget.__setCharFormat</h4> |
|
301 <b>__setCharFormat</b>(<i>formatCodes, textCursor</i>) |
|
302 <p> |
|
303 Private method setting the current text format of the REPL pane based |
|
304 on the passed ANSI codes. |
|
305 </p><p> |
|
306 Following codes are used: |
|
307 <ul> |
|
308 <li>0: Reset</li> |
|
309 <li>1: Bold font (weight 75)</li> |
|
310 <li>2: Light font (weight 25)</li> |
|
311 <li>3: Italic font</li> |
|
312 <li>4: Underlined font</li> |
|
313 <li>9: Strikeout font</li> |
|
314 <li>21: Bold off (weight 50)</li> |
|
315 <li>22: Light off (weight 50)</li> |
|
316 <li>23: Italic off</li> |
|
317 <li>24: Underline off</li> |
|
318 <li>29: Strikeout off</li> |
|
319 <li>30: foreground Black</li> |
|
320 <li>31: foreground Dark Red</li> |
|
321 <li>32: foreground Dark Green</li> |
|
322 <li>33: foreground Dark Yellow</li> |
|
323 <li>34: foreground Dark Blue</li> |
|
324 <li>35: foreground Dark Magenta</li> |
|
325 <li>36: foreground Dark Cyan</li> |
|
326 <li>37: foreground Light Gray</li> |
|
327 <li>39: reset foreground to default</li> |
|
328 <li>40: background Black</li> |
|
329 <li>41: background Dark Red</li> |
|
330 <li>42: background Dark Green</li> |
|
331 <li>43: background Dark Yellow</li> |
|
332 <li>44: background Dark Blue</li> |
|
333 <li>45: background Dark Magenta</li> |
|
334 <li>46: background Dark Cyan</li> |
|
335 <li>47: background Light Gray</li> |
|
336 <li>49: reset background to default</li> |
|
337 <li>53: Overlined font</li> |
|
338 <li>55: Overline off</li> |
|
339 <li>90: bright foreground Dark Gray</li> |
|
340 <li>91: bright foreground Red</li> |
|
341 <li>92: bright foreground Green</li> |
|
342 <li>93: bright foreground Yellow</li> |
|
343 <li>94: bright foreground Blue</li> |
|
344 <li>95: bright foreground Magenta</li> |
|
345 <li>96: bright foreground Cyan</li> |
|
346 <li>97: bright foreground White</li> |
|
347 <li>100: bright background Dark Gray</li> |
|
348 <li>101: bright background Red</li> |
|
349 <li>102: bright background Green</li> |
|
350 <li>103: bright background Yellow</li> |
|
351 <li>104: bright background Blue</li> |
|
352 <li>105: bright background Magenta</li> |
|
353 <li>106: bright background Cyan</li> |
|
354 <li>107: bright background White</li> |
|
355 </ul> |
|
356 </p><dl> |
|
357 <dt><i>formatCodes</i> (list of str)</dt> |
|
358 <dd> |
|
359 list of format codes |
|
360 </dd><dt><i>textCursor</i> (QTextCursor)</dt> |
|
361 <dd> |
|
362 reference to the text cursor |
|
363 </dd> |
|
364 </dl><a NAME="MicroPythonWidget.__setConnected" ID="MicroPythonWidget.__setConnected"></a> |
|
365 <h4>MicroPythonWidget.__setConnected</h4> |
|
366 <b>__setConnected</b>(<i>connected</i>) |
|
367 <p> |
|
368 Private method to set the connection status LED. |
|
369 </p><dl> |
|
370 <dt><i>connected</i> (bool)</dt> |
|
371 <dd> |
|
372 connection state |
|
373 </dd> |
|
374 </dl><a NAME="MicroPythonWidget.__showContextMenu" ID="MicroPythonWidget.__showContextMenu"></a> |
|
375 <h4>MicroPythonWidget.__showContextMenu</h4> |
|
376 <b>__showContextMenu</b>(<i>pos</i>) |
|
377 <p> |
|
378 Private slot to show the REPL context menu. |
|
379 </p><dl> |
|
380 <dt><i>pos</i> (QPoint)</dt> |
|
381 <dd> |
|
382 position to show the menu at |
|
383 </dd> |
|
384 </dl><a NAME="MicroPythonWidget.__showDeviceTime" ID="MicroPythonWidget.__showDeviceTime"></a> |
|
385 <h4>MicroPythonWidget.__showDeviceTime</h4> |
|
386 <b>__showDeviceTime</b>(<i></i>) |
|
387 <p> |
|
388 Private slot to show the date and time of the connected device. |
|
389 </p><a NAME="MicroPythonWidget.__showDeviceVersion" ID="MicroPythonWidget.__showDeviceVersion"></a> |
|
390 <h4>MicroPythonWidget.__showDeviceVersion</h4> |
|
391 <b>__showDeviceVersion</b>(<i></i>) |
|
392 <p> |
|
393 Private slot to show some version info about MicroPython of the device. |
|
394 </p><a NAME="MicroPythonWidget.__showError" ID="MicroPythonWidget.__showError"></a> |
|
395 <h4>MicroPythonWidget.__showError</h4> |
|
396 <b>__showError</b>(<i>method, error</i>) |
|
397 <p> |
|
398 Private method to show some error message. |
|
399 </p><dl> |
|
400 <dt><i>method</i> (str)</dt> |
|
401 <dd> |
|
402 name of the method the error occured in |
|
403 </dd><dt><i>error</i> (str)</dt> |
|
404 <dd> |
|
405 error message |
|
406 </dd> |
|
407 </dl><a NAME="MicroPythonWidget.__showImplementation" ID="MicroPythonWidget.__showImplementation"></a> |
|
408 <h4>MicroPythonWidget.__showImplementation</h4> |
|
409 <b>__showImplementation</b>(<i></i>) |
|
410 <p> |
|
411 Private slot to show some implementation related information. |
|
412 </p><a NAME="MicroPythonWidget.__showLocalTime" ID="MicroPythonWidget.__showLocalTime"></a> |
|
413 <h4>MicroPythonWidget.__showLocalTime</h4> |
|
414 <b>__showLocalTime</b>(<i></i>) |
|
415 <p> |
|
416 Private slot to show the local date and time. |
|
417 </p><a NAME="MicroPythonWidget.__showNoDeviceMessage" ID="MicroPythonWidget.__showNoDeviceMessage"></a> |
|
418 <h4>MicroPythonWidget.__showNoDeviceMessage</h4> |
|
419 <b>__showNoDeviceMessage</b>(<i></i>) |
|
420 <p> |
|
421 Private method to show a message dialog indicating a missing device. |
|
422 </p><a NAME="MicroPythonWidget.__synchronizeTime" ID="MicroPythonWidget.__synchronizeTime"></a> |
|
423 <h4>MicroPythonWidget.__synchronizeTime</h4> |
|
424 <b>__synchronizeTime</b>(<i>quiet=False</i>) |
|
425 <p> |
|
426 Private slot to set the time of the connected device to the local |
|
427 computer's time. |
|
428 </p><dl> |
|
429 <dt><i>quiet</i> (bool)</dt> |
|
430 <dd> |
|
431 flag indicating to not show a message |
|
432 </dd> |
|
433 </dl><a NAME="MicroPythonWidget.commandsInterface" ID="MicroPythonWidget.commandsInterface"></a> |
|
434 <h4>MicroPythonWidget.commandsInterface</h4> |
|
435 <b>commandsInterface</b>(<i></i>) |
|
436 <p> |
|
437 Public method to get a reference to the commands interface object. |
|
438 </p><dl> |
|
439 <dt>Returns:</dt> |
|
440 <dd> |
|
441 reference to the commands interface object |
|
442 </dd> |
|
443 </dl><dl> |
|
444 <dt>Return Type:</dt> |
|
445 <dd> |
|
446 MicroPythonCommandsInterface |
|
447 </dd> |
|
448 </dl><a NAME="MicroPythonWidget.eventFilter" ID="MicroPythonWidget.eventFilter"></a> |
|
449 <h4>MicroPythonWidget.eventFilter</h4> |
|
450 <b>eventFilter</b>(<i>obj, evt</i>) |
|
451 <p> |
|
452 Public method to process events for the REPL pane. |
|
453 </p><dl> |
|
454 <dt><i>obj</i> (QObject)</dt> |
|
455 <dd> |
|
456 reference to the object the event was meant for |
|
457 </dd><dt><i>evt</i> (QEvent)</dt> |
|
458 <dd> |
|
459 reference to the event object |
|
460 </dd> |
|
461 </dl><dl> |
|
462 <dt>Returns:</dt> |
|
463 <dd> |
|
464 flag to indicate that the event was handled |
|
465 </dd> |
|
466 </dl><dl> |
|
467 <dt>Return Type:</dt> |
|
468 <dd> |
|
469 bool |
|
470 </dd> |
|
471 </dl><a NAME="MicroPythonWidget.getCurrentPort" ID="MicroPythonWidget.getCurrentPort"></a> |
|
472 <h4>MicroPythonWidget.getCurrentPort</h4> |
|
473 <b>getCurrentPort</b>(<i></i>) |
|
474 <p> |
|
475 Public method to determine the port path of the selected device. |
|
476 </p><dl> |
|
477 <dt>Returns:</dt> |
|
478 <dd> |
|
479 path of the port of the selected device |
|
480 </dd> |
|
481 </dl><dl> |
|
482 <dt>Return Type:</dt> |
|
483 <dd> |
|
484 str |
|
485 </dd> |
|
486 </dl><a NAME="MicroPythonWidget.getDeviceWorkspace" ID="MicroPythonWidget.getDeviceWorkspace"></a> |
|
487 <h4>MicroPythonWidget.getDeviceWorkspace</h4> |
|
488 <b>getDeviceWorkspace</b>(<i></i>) |
|
489 <p> |
|
490 Public method to get the workspace directory of the device. |
|
491 </p><dl> |
|
492 <dt>Returns:</dt> |
|
493 <dd> |
|
494 workspace directory of the device |
|
495 </dd> |
|
496 </dl><dl> |
|
497 <dt>Return Type:</dt> |
|
498 <dd> |
|
499 str |
|
500 </dd> |
|
501 </dl><a NAME="MicroPythonWidget.handleDataFlood" ID="MicroPythonWidget.handleDataFlood"></a> |
|
502 <h4>MicroPythonWidget.handleDataFlood</h4> |
|
503 <b>handleDataFlood</b>(<i></i>) |
|
504 <p> |
|
505 Public slot handling a data flood from the device. |
|
506 </p><a NAME="MicroPythonWidget.isConnected" ID="MicroPythonWidget.isConnected"></a> |
|
507 <h4>MicroPythonWidget.isConnected</h4> |
|
508 <b>isConnected</b>(<i></i>) |
|
509 <p> |
|
510 Public method to get the connection state. |
|
511 </p><dl> |
|
512 <dt>Returns:</dt> |
|
513 <dd> |
|
514 connection state |
|
515 </dd> |
|
516 </dl><dl> |
|
517 <dt>Return Type:</dt> |
|
518 <dd> |
|
519 bool |
|
520 </dd> |
|
521 </dl><a NAME="MicroPythonWidget.isMicrobit" ID="MicroPythonWidget.isMicrobit"></a> |
|
522 <h4>MicroPythonWidget.isMicrobit</h4> |
|
523 <b>isMicrobit</b>(<i></i>) |
|
524 <p> |
|
525 Public method to check, if the connected/selected device is a |
|
526 BBC micro:bit. |
|
527 </p><dl> |
|
528 <dt>Returns:</dt> |
|
529 <dd> |
|
530 flag indicating a micro:bit device |
|
531 rtype bool |
|
532 </dd> |
|
533 </dl><a NAME="MicroPythonWidget.on_chartButton_clicked" ID="MicroPythonWidget.on_chartButton_clicked"></a> |
|
534 <h4>MicroPythonWidget.on_chartButton_clicked</h4> |
|
535 <b>on_chartButton_clicked</b>(<i>checked</i>) |
|
536 <p> |
|
537 Private slot to open a chart view to plot data received from the |
|
538 connected device. |
|
539 </p><p> |
|
540 If the selected device is not connected yet, this will be done now. |
|
541 </p><dl> |
|
542 <dt><i>checked</i> (bool)</dt> |
|
543 <dd> |
|
544 state of the button |
|
545 </dd> |
|
546 </dl><a NAME="MicroPythonWidget.on_checkButton_clicked" ID="MicroPythonWidget.on_checkButton_clicked"></a> |
|
547 <h4>MicroPythonWidget.on_checkButton_clicked</h4> |
|
548 <b>on_checkButton_clicked</b>(<i></i>) |
|
549 <p> |
|
550 Private slot to check for connected devices. |
|
551 </p><a NAME="MicroPythonWidget.on_connectButton_clicked" ID="MicroPythonWidget.on_connectButton_clicked"></a> |
|
552 <h4>MicroPythonWidget.on_connectButton_clicked</h4> |
|
553 <b>on_connectButton_clicked</b>(<i></i>) |
|
554 <p> |
|
555 Private slot to connect to the selected device or disconnect from the |
|
556 currently connected device. |
|
557 </p><a NAME="MicroPythonWidget.on_deviceTypeComboBox_activated" ID="MicroPythonWidget.on_deviceTypeComboBox_activated"></a> |
|
558 <h4>MicroPythonWidget.on_deviceTypeComboBox_activated</h4> |
|
559 <b>on_deviceTypeComboBox_activated</b>(<i>index</i>) |
|
560 <p> |
|
561 Private slot handling the selection of a device type. |
|
562 </p><dl> |
|
563 <dt><i>index</i> (int)</dt> |
|
564 <dd> |
|
565 index of the selected device |
|
566 </dd> |
|
567 </dl><a NAME="MicroPythonWidget.on_filesButton_clicked" ID="MicroPythonWidget.on_filesButton_clicked"></a> |
|
568 <h4>MicroPythonWidget.on_filesButton_clicked</h4> |
|
569 <b>on_filesButton_clicked</b>(<i>checked</i>) |
|
570 <p> |
|
571 Private slot to open a file manager window to the connected device. |
|
572 </p><p> |
|
573 If the selected device is not connected yet, this will be done now. |
|
574 </p><dl> |
|
575 <dt><i>checked</i> (bool)</dt> |
|
576 <dd> |
|
577 state of the button |
|
578 </dd> |
|
579 </dl><a NAME="MicroPythonWidget.on_openButton_clicked" ID="MicroPythonWidget.on_openButton_clicked"></a> |
|
580 <h4>MicroPythonWidget.on_openButton_clicked</h4> |
|
581 <b>on_openButton_clicked</b>(<i></i>) |
|
582 <p> |
|
583 Private slot to open a file of the connected device. |
|
584 </p><a NAME="MicroPythonWidget.on_replButton_clicked" ID="MicroPythonWidget.on_replButton_clicked"></a> |
|
585 <h4>MicroPythonWidget.on_replButton_clicked</h4> |
|
586 <b>on_replButton_clicked</b>(<i>checked</i>) |
|
587 <p> |
|
588 Private slot to connect to enable or disable the REPL widget. |
|
589 </p><p> |
|
590 If the selected device is not connected yet, this will be done now. |
|
591 </p><dl> |
|
592 <dt><i>checked</i> (bool)</dt> |
|
593 <dd> |
|
594 state of the button |
|
595 </dd> |
|
596 </dl><a NAME="MicroPythonWidget.on_runButton_clicked" ID="MicroPythonWidget.on_runButton_clicked"></a> |
|
597 <h4>MicroPythonWidget.on_runButton_clicked</h4> |
|
598 <b>on_runButton_clicked</b>(<i></i>) |
|
599 <p> |
|
600 Private slot to execute the script of the active editor on the |
|
601 selected device. |
|
602 </p><p> |
|
603 If the REPL is not active yet, it will be activated, which might cause |
|
604 an unconnected device to be connected. |
|
605 </p><a NAME="MicroPythonWidget.on_saveButton_clicked" ID="MicroPythonWidget.on_saveButton_clicked"></a> |
|
606 <h4>MicroPythonWidget.on_saveButton_clicked</h4> |
|
607 <b>on_saveButton_clicked</b>(<i></i>) |
|
608 <p> |
|
609 Private slot to save the current editor to the connected device. |
|
610 </p><a NAME="MicroPythonWidget.setActionButtons" ID="MicroPythonWidget.setActionButtons"></a> |
|
611 <h4>MicroPythonWidget.setActionButtons</h4> |
|
612 <b>setActionButtons</b>(<i>**kwargs</i>) |
|
613 <p> |
|
614 Public method to set the enabled state of the various action buttons. |
|
615 </p><dl> |
|
616 <dt><i>kwargs=</i> (dict)</dt> |
|
617 <dd> |
|
618 keyword arguments containg the enabled states (keys |
|
619 are 'run', 'repl', 'files', 'chart', 'open', 'save' |
|
620 </dd> |
|
621 </dl> |
|
622 <div align="right"><a href="#top">Up</a></div> |
|
623 <hr /> |
|
624 </body></html> |