remove linux serial port prefix

This commit is contained in:
Timothy Yin 2024-11-27 23:25:06 +08:00
parent 8dbb7d086f
commit 3f60026f3c
2 changed files with 6 additions and 2 deletions

View File

@ -69,7 +69,8 @@ void MainWindow::on_btn_serial_toggle_clicked()
ui->comboBox_baud->setDisabled(false); ui->comboBox_baud->setDisabled(false);
ui->btn_serial_search->setDisabled(false); ui->btn_serial_search->setDisabled(false);
} else { } else {
m_serialPort->setPortName("/dev/" + ui->comboBox_serial->currentText()); // m_serialPort->setPortName("/dev/" + ui->comboBox_serial->currentText());
m_serialPort->setPortName(ui->comboBox_serial->currentText());
if (!m_serialPort->open(QIODevice::ReadWrite)) { if (!m_serialPort->open(QIODevice::ReadWrite)) {
msgBox(this, "串口打开失败", "串口被占用或不存在"); msgBox(this, "串口打开失败", "串口被占用或不存在");
qDebug() << "Serial open failed"; qDebug() << "Serial open failed";

View File

@ -2,6 +2,9 @@
<ui version="4.0"> <ui version="4.0">
<class>MainWindow</class> <class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow"> <widget class="QMainWindow" name="MainWindow">
<property name="windowModality">
<enum>Qt::WindowModality::WindowModal</enum>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -1431,7 +1434,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>662</width> <width>662</width>
<height>27</height> <height>22</height>
</rect> </rect>
</property> </property>
</widget> </widget>