Increment version number. Now supports pausing and resuming frame capture without disconnecting from the GVRET hardware.

This commit is contained in:
Collin Kidder
2015-06-02 21:53:23 -04:00
parent d03c439ce3
commit e3d67f20fc
5 changed files with 54 additions and 5 deletions
+19
View File
@@ -84,6 +84,8 @@ MainWindow::MainWindow(QWidget *parent) :
connect(worker, &SerialWorker::connectionFailure, this, &MainWindow::connectionFailed, Qt::QueuedConnection);
connect(worker, &SerialWorker::deviceInfo, this, &MainWindow::gotDeviceInfo, Qt::QueuedConnection);
connect(this, &MainWindow::closeSerialPort, worker, &SerialWorker::closeSerialPort, Qt::QueuedConnection);
connect(this, &MainWindow::startFrameCapturing, worker, &SerialWorker::startFrameCapture);
connect(this, &MainWindow::stopFrameCapturing, worker, &SerialWorker::stopFrameCapture);
serialWorkerThread.start();
graphingWindow = NULL;
@@ -113,6 +115,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->cbInterpret, SIGNAL(toggled(bool)), this, SLOT(interpretToggled(bool)));
connect(ui->cbOverwrite, SIGNAL(toggled(bool)), this, SLOT(overwriteToggled(bool)));
connect(ui->actionEdit_Messages_Signals, SIGNAL(triggered(bool)), this, SLOT(showDBCEditor()));
connect(ui->btnCaptureToggle, SIGNAL(clicked(bool)), this, SLOT(toggleCapture()));
lbStatusConnected.setText(tr("Not connected"));
updateBaudLabel(0,0);
@@ -125,6 +128,7 @@ MainWindow::MainWindow(QWidget *parent) :
ui->lbNumFrames->setText("0");
isConnected = false;
allowCapture = true;
//create a temporary frame to be able to capture the correct
//default height of an item in the table. Need to do this in case
@@ -731,6 +735,21 @@ void MainWindow::connButtonPress()
}
}
void MainWindow::toggleCapture()
{
allowCapture = !allowCapture;
if (allowCapture)
{
ui->btnCaptureToggle->setText("Suspend Capturing");
emit startFrameCapturing();
}
else
{
ui->btnCaptureToggle->setText("Restart Capturing");
emit stopFrameCapturing();
}
}
void MainWindow::connectionSucceeded(int baud0, int baud1)
{
lbStatusConnected.setText(tr("Connected to GVRET"));
+6 -1
View File
@@ -14,7 +14,7 @@
#include "dbchandler.h"
#include "dbcmaineditor.h"
#define VERSION 105
#define VERSION 106
namespace Ui {
class MainWindow;
@@ -49,6 +49,7 @@ private slots:
void interpretToggled(bool);
void overwriteToggled(bool);
void showDBCEditor();
void toggleCapture();
public slots:
void gotFrames(int, int);
@@ -59,6 +60,9 @@ signals:
void closeSerialPort();
void updateBaudRates(int, int);
void sendCANFrame(const CANFrame *, int);
void stopFrameCapturing();
void startFrameCapturing();
private:
Ui::MainWindow *ui;
@@ -69,6 +73,7 @@ private:
QList<QSerialPortInfo> ports;
QThread serialWorkerThread;
QByteArray inputBuffer;
bool allowCapture;
//References to other windows we can display
GraphingWindow *graphingWindow;
+7
View File
@@ -194,6 +194,13 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnCaptureToggle">
<property name="text">
<string>Suspend Capturing</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnClearFrames">
<property name="text">
+19 -4
View File
@@ -15,6 +15,7 @@ SerialWorker::SerialWorker(CANFrameModel *model, QObject *parent) : QObject(pare
ticker = NULL;
elapsedTime = NULL;
framesPerSec = 0;
capturing = true;
}
SerialWorker::~SerialWorker()
@@ -246,10 +247,11 @@ void SerialWorker::procRXChar(unsigned char c)
rx_state = IDLE;
rx_step = 0;
//qDebug() << "emit from serial handler to main form id: " << buildFrame->ID;
//emit receivedFrame(buildFrame);
canModel->addFrame(*buildFrame, false);
gotFrames++;
//buildFrame = new CANFrame;
if (capturing)
{
canModel->addFrame(*buildFrame, false);
gotFrames++;
}
}
break;
}
@@ -368,3 +370,16 @@ void SerialWorker::closeSerialPort()
delete serial;
serial = NULL;
}
void SerialWorker::stopFrameCapture()
{
qDebug() << "Stopping frame capture";
capturing = false;
}
void SerialWorker::startFrameCapture()
{
qDebug() << "Starting up frame capture";
capturing = true;
}
+3
View File
@@ -48,11 +48,14 @@ public slots:
void closeSerialPort();
void sendFrame(const CANFrame *, int);
void updateBaudRates(int, int);
void stopFrameCapture();
void startFrameCapture(); //only need to call this if previously stopped. Otherwise it's the default
private:
QString portName;
bool quit;
bool connected;
bool capturing;
QSerialPort *serial;
CANFrameModel *canModel;
QTimer *ticker;