eric6/MicroPython/MicroPythonDevices.py

changeset 8062
8dc5acb30a8b
parent 8055
52fdd41517f3
child 8067
a467ab075be0
equal deleted inserted replaced
8061:979562f350bf 8062:8dc5acb30a8b
10 10
11 import logging 11 import logging
12 import os 12 import os
13 13
14 from PyQt5.QtCore import pyqtSlot, QObject 14 from PyQt5.QtCore import pyqtSlot, QObject
15 from PyQt5.QtWidgets import QInputDialog
15 16
16 from E5Gui.E5Application import e5App 17 from E5Gui.E5Application import e5App
17 18
18 import UI.PixmapCache 19 import UI.PixmapCache
19 import Preferences 20 import Preferences
56 (0x04D8, 0xED5E), # XinaBox CW03 57 (0x04D8, 0xED5E), # XinaBox CW03
57 (0x3171, 0x0101), # 8086.net Commander 58 (0x3171, 0x0101), # 8086.net Commander
58 (0x04D8, 0xED94), # PyCubed 59 (0x04D8, 0xED94), # PyCubed
59 (0x04D8, 0xEDBE), # SAM32 60 (0x04D8, 0xEDBE), # SAM32
60 (0x1D50, 0x60E8), # PewPew Game Console 61 (0x1D50, 0x60E8), # PewPew Game Console
62 (0x2886, 0x002F), # Seeed XIAO
61 (0x2886, 0x802D), # Seeed Wio Terminal 63 (0x2886, 0x802D), # Seeed Wio Terminal
62 (0x2886, 0x002F), # Seeed XIAO 64 (0x2886, 0x802F), # Seeed XIAO
63 (0x1B4F, 0x0016), # Sparkfun Thing Plus - SAMD51 65 (0x1B4F, 0x0016), # Sparkfun Thing Plus - SAMD51
64 (0x2341, 0x8057), # Arduino Nano 33 IoT board 66 (0x2341, 0x8057), # Arduino Nano 33 IoT board
65 (0x04D8, 0xEAD1), # DynOSSAT-EDU-EPS 67 (0x04D8, 0xEAD1), # DynOSSAT-EDU-EPS
66 (0x04D8, 0xEAD2), # DynOSSAT-EDU-OBC 68 (0x04D8, 0xEAD2), # DynOSSAT-EDU-OBC
67 (0x1209, 0x4DDD), # ODT CP Sapling M0 69 (0x1209, 0x4DDD), # ODT CP Sapling M0
359 @rtype str 361 @rtype str
360 """ 362 """
361 return (Preferences.getMultiProject("Workspace") or 363 return (Preferences.getMultiProject("Workspace") or
362 os.path.expanduser("~")) 364 os.path.expanduser("~"))
363 365
366 def selectDeviceDirectory(self, deviceDirectories):
367 """
368 Public method to select the device directory from a list of detected
369 ones.
370
371 @param deviceDirectories list of directories to select from
372 @type list of str
373 @return selected directory or an empty string
374 @rtype str
375 """
376 deviceDirectory, ok = QInputDialog.getItem(
377 None,
378 self.tr("Select Device Directory"),
379 self.tr("Select the directory for the connected device:"),
380 [""] + deviceDirectories,
381 0, False)
382 if ok:
383 return deviceDirectory
384 else:
385 # user cancelled
386 return ""
387
364 def sendCommands(self, commandsList): 388 def sendCommands(self, commandsList):
365 """ 389 """
366 Public method to send a list of commands to the device. 390 Public method to send a list of commands to the device.
367 391
368 @param commandsList list of commands to be sent to the device 392 @param commandsList list of commands to be sent to the device

eric ide

mercurial