Hooked up the device info signals - info is displayed on status bar.

This commit is contained in:
Collin Kidder
2015-05-20 19:32:46 -04:00
parent 07c6046b2c
commit e957dd1fc1
2 changed files with 18 additions and 1 deletions
+14
View File
@@ -69,6 +69,8 @@ MainWindow::MainWindow(QWidget *parent) :
connect(this, &MainWindow::updateBaudRates, worker, &SerialWorker::updateBaudRates, Qt::QueuedConnection);
connect(this, &MainWindow::sendCANFrame, worker, &SerialWorker::sendFrame, Qt::QueuedConnection);
connect(worker, &SerialWorker::connectionSuccess, this, &MainWindow::connectionSucceeded, Qt::QueuedConnection);
connect(worker, &SerialWorker::connectionFailure, this, &MainWindow::connectionFailed, Qt::QueuedConnection);
connect(worker, &SerialWorker::deviceInfo, this, &MainWindow::gotDeviceInfo, Qt::QueuedConnection);
serialWorkerThread.start();
graphingWindow = NULL;
@@ -672,6 +674,18 @@ void MainWindow::connectionSucceeded(int baud0, int baud1)
ui->btnConnect->setEnabled(false);
}
void MainWindow::connectionFailed()
{
lbStatusConnected.setText(tr("Failed to connect!"));
}
void MainWindow::gotDeviceInfo(int build, int swCAN)
{
QString str = tr("Connected to GVRET ") + QString::number(build);
if (swCAN == 1) str += "(SW)";
lbStatusConnected.setText(str);
}
void MainWindow::showGraphingWindow()
{
if (!graphingWindow) graphingWindow = new GraphingWindow(model->getListReference());
+4 -1
View File
@@ -39,10 +39,13 @@ private slots:
void showFlowViewWindow();
void showFrameSenderWindow();
void changeBaudRates();
void connectionFailed();
void gotDeviceInfo(int, int);
void connectionSucceeded(int, int);
public slots:
void gotFrame(CANFrame *frame);
void connectionSucceeded(int, int);
signals:
void sendSerialPort(QSerialPortInfo *port);