Modified the way that the serial port is opened to hopefully be more cross platform.

This commit is contained in:
Collin Kidder
2015-05-13 20:00:59 -04:00
parent 60e5b323cf
commit b634024fb2
4 changed files with 33 additions and 22 deletions
+9 -2
View File
@@ -43,7 +43,7 @@ MainWindow::MainWindow(QWidget *parent) :
ui->canFramesView->setColumnWidth(4, 40);
ui->canFramesView->setColumnWidth(5, 300);
QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts();
ports = QSerialPortInfo::availablePorts();
for (int i = 0; i < ports.count(); i++)
{
@@ -592,7 +592,14 @@ void MainWindow::handleSaveFile()
void MainWindow::connButtonPress()
{
emit sendSerialPort(ui->cbSerialPorts->currentText());
for (int x = 0; x < ports.count(); x++)
{
if (ports.at(x).portName() == ui->cbSerialPorts->currentText())
{
emit sendSerialPort(ports[x]);
return;
}
}
}
void MainWindow::showGraphingWindow()