话不多说,控件的使用不想写了,前辈写的都挺全面的,直接展示按键功能
1.打开软件自动搜索串口:
imf_s = self.comboBox_uart.currentText()
if imf_s != "":
self.state_label.setText(self.Com_Dict[self.comboBox_uart.currentText()])
2.连接下位机:
self.timer.start(2)
self.ser.port = self.comboBox_uart.currentText()
self.ser.baudrate = int(self.comboBox_baud.currentText())
try:
self.ser.open()
input_s = ":PULS:CONNECT(on)"
if input_s != "":
input_s = (input_s + '\r\n').encode('utf-8')