--- a/eric6/MicroPython/MicroPythonWidget.py Thu Feb 04 15:18:40 2021 +0100 +++ b/eric6/MicroPython/MicroPythonWidget.py Thu Feb 04 20:15:06 2021 +0100 @@ -187,7 +187,8 @@ ZoomMax = 20 DeviceTypeRole = Qt.UserRole - DevicePortRole = Qt.UserRole + 1 + DeviceBoardRole = Qt.UserRole + 1 + DevicePortRole = Qt.UserRole + 2 dataReceived = pyqtSignal(bytes) @@ -312,6 +313,8 @@ self.deviceTypeComboBox.setItemData( index, boardType, self.DeviceTypeRole) self.deviceTypeComboBox.setItemData( + index, boardName, self.DeviceBoardRole) + self.deviceTypeComboBox.setItemData( index, portName, self.DevicePortRole) else: @@ -898,9 +901,7 @@ @return path of the port of the selected device @rtype str """ - portName = self.deviceTypeComboBox.itemData( - self.deviceTypeComboBox.currentIndex(), - self.DevicePortRole) + portName = self.deviceTypeComboBox.currentData(self.DevicePortRole) if Globals.isWindowsPlatform(): # return it unchanged @@ -909,6 +910,16 @@ # return with device path prepended return "/dev/{0}".format(portName) + def getCurrentBoard(self): + """ + Public method to get the board name of the selected device. + + @return board name of the selected device + @rtype str + """ + boardName = self.deviceTypeComboBox.currentData(self.DeviceBoardRole) + return boardName + def getDeviceWorkspace(self): """ Public method to get the workspace directory of the device.