309 "board name, description, port name") |
310 "board name, description, port name") |
310 .format(boardName, description, portName) |
311 .format(boardName, description, portName) |
311 ) |
312 ) |
312 self.deviceTypeComboBox.setItemData( |
313 self.deviceTypeComboBox.setItemData( |
313 index, boardType, self.DeviceTypeRole) |
314 index, boardType, self.DeviceTypeRole) |
|
315 self.deviceTypeComboBox.setItemData( |
|
316 index, boardName, self.DeviceBoardRole) |
314 self.deviceTypeComboBox.setItemData( |
317 self.deviceTypeComboBox.setItemData( |
315 index, portName, self.DevicePortRole) |
318 index, portName, self.DevicePortRole) |
316 |
319 |
317 else: |
320 else: |
318 self.deviceInfoLabel.setText( |
321 self.deviceInfoLabel.setText( |
896 Public method to determine the port path of the selected device. |
899 Public method to determine the port path of the selected device. |
897 |
900 |
898 @return path of the port of the selected device |
901 @return path of the port of the selected device |
899 @rtype str |
902 @rtype str |
900 """ |
903 """ |
901 portName = self.deviceTypeComboBox.itemData( |
904 portName = self.deviceTypeComboBox.currentData(self.DevicePortRole) |
902 self.deviceTypeComboBox.currentIndex(), |
|
903 self.DevicePortRole) |
|
904 |
905 |
905 if Globals.isWindowsPlatform(): |
906 if Globals.isWindowsPlatform(): |
906 # return it unchanged |
907 # return it unchanged |
907 return portName |
908 return portName |
908 else: |
909 else: |
909 # return with device path prepended |
910 # return with device path prepended |
910 return "/dev/{0}".format(portName) |
911 return "/dev/{0}".format(portName) |
|
912 |
|
913 def getCurrentBoard(self): |
|
914 """ |
|
915 Public method to get the board name of the selected device. |
|
916 |
|
917 @return board name of the selected device |
|
918 @rtype str |
|
919 """ |
|
920 boardName = self.deviceTypeComboBox.currentData(self.DeviceBoardRole) |
|
921 return boardName |
911 |
922 |
912 def getDeviceWorkspace(self): |
923 def getDeviceWorkspace(self): |
913 """ |
924 """ |
914 Public method to get the workspace directory of the device. |
925 Public method to get the workspace directory of the device. |
915 |
926 |