Hooked up the device info signals - info is displayed on status bar.
This commit is contained in:
@@ -69,6 +69,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
connect(this, &MainWindow::updateBaudRates, worker, &SerialWorker::updateBaudRates, Qt::QueuedConnection);
|
connect(this, &MainWindow::updateBaudRates, worker, &SerialWorker::updateBaudRates, Qt::QueuedConnection);
|
||||||
connect(this, &MainWindow::sendCANFrame, worker, &SerialWorker::sendFrame, Qt::QueuedConnection);
|
connect(this, &MainWindow::sendCANFrame, worker, &SerialWorker::sendFrame, Qt::QueuedConnection);
|
||||||
connect(worker, &SerialWorker::connectionSuccess, this, &MainWindow::connectionSucceeded, 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();
|
serialWorkerThread.start();
|
||||||
|
|
||||||
graphingWindow = NULL;
|
graphingWindow = NULL;
|
||||||
@@ -672,6 +674,18 @@ void MainWindow::connectionSucceeded(int baud0, int baud1)
|
|||||||
ui->btnConnect->setEnabled(false);
|
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()
|
void MainWindow::showGraphingWindow()
|
||||||
{
|
{
|
||||||
if (!graphingWindow) graphingWindow = new GraphingWindow(model->getListReference());
|
if (!graphingWindow) graphingWindow = new GraphingWindow(model->getListReference());
|
||||||
|
|||||||
+4
-1
@@ -39,10 +39,13 @@ private slots:
|
|||||||
void showFlowViewWindow();
|
void showFlowViewWindow();
|
||||||
void showFrameSenderWindow();
|
void showFrameSenderWindow();
|
||||||
void changeBaudRates();
|
void changeBaudRates();
|
||||||
|
void connectionFailed();
|
||||||
|
void gotDeviceInfo(int, int);
|
||||||
|
void connectionSucceeded(int, int);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void gotFrame(CANFrame *frame);
|
void gotFrame(CANFrame *frame);
|
||||||
void connectionSucceeded(int, int);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sendSerialPort(QSerialPortInfo *port);
|
void sendSerialPort(QSerialPortInfo *port);
|
||||||
|
|||||||
Reference in New Issue
Block a user