plottipy.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:PlottiPy 作者: ruddy17 项目源码 文件源码
def setPort(self, port:Port):
        if port.isOpen():
            port.close()
            port.setBackground(QtGui.QColor(0, 0, 0, 0))
        else:
            try:
                port.open(self.baudrate_combo.currentText(),
                          self.parity_combo.currentText(),
                          self.bytesize_combo.currentText())
                port.setBackground(QtGui.QColor(0, 255, 0, 127))
            except SerialException as e:
                print(e)
                port.setBackground(QtGui.QColor(255, 0, 0, 127))
                self.check_availability_list.append(port)
            except ValueError as e:
                print(e)
                port.setBackground(QtGui.QColor(255, 0, 0, 127))

        port.setSelected(False)

        print(self.getPortList())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号