Implementation of a bunch more of the settings (all but hex on/off)

This commit is contained in:
Collin Kidder
2015-06-28 20:41:56 -04:00
parent 6c967d2071
commit 0ba0e6a255
8 changed files with 52 additions and 4 deletions
+6
View File
@@ -243,6 +243,12 @@ void FileComparatorWindow::calculateDetails()
ui->treeDetails->setSortingEnabled(true); ui->treeDetails->setSortingEnabled(true);
ui->treeDetails->sortByColumn(0, Qt::AscendingOrder); ui->treeDetails->sortByColumn(0, Qt::AscendingOrder);
QSettings settings;
if (settings.value("InfoCompare/AutoExpand", false).toBool())
{
ui->treeDetails->expandAll();
}
} }
void FileComparatorWindow::saveDetails() void FileComparatorWindow::saveDetails()
+10
View File
@@ -114,6 +114,16 @@ void FlowViewWindow::readSettings()
resize(settings.value("FlowView/WindowSize", QSize(1078, 621)).toSize()); resize(settings.value("FlowView/WindowSize", QSize(1078, 621)).toSize());
move(settings.value("FlowView/WindowPos", QPoint(50, 50)).toPoint()); move(settings.value("FlowView/WindowPos", QPoint(50, 50)).toPoint());
} }
if (settings.value("FlowView/AutoRef", false).toBool())
{
ui->cbAutoRef->setChecked(true);
}
if (settings.value("FlowView/UseTimestamp", false).toBool())
{
ui->cbTimeGraph->setChecked(true);
}
} }
void FlowViewWindow::writeSettings() void FlowViewWindow::writeSettings()
+6
View File
@@ -272,6 +272,12 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
else else
{ {
} }
QSettings settings;
if (settings.value("InfoCompare/AutoExpand", false).toBool())
{
ui->treeDetails->expandAll();
}
} }
void FrameInfoWindow::refreshIDList() void FrameInfoWindow::refreshIDList()
+5
View File
@@ -97,6 +97,11 @@ void FramePlaybackWindow::readSettings()
resize(settings.value("Playback/WindowSize", QSize(742, 606)).toSize()); resize(settings.value("Playback/WindowSize", QSize(742, 606)).toSize());
move(settings.value("Playback/WindowPos", QPoint(50, 50)).toPoint()); move(settings.value("Playback/WindowPos", QPoint(50, 50)).toPoint());
} }
if (settings.value("Playback/AutoLoop", false).toBool())
{
ui->cbLoop->setChecked(true);
}
ui->spinPlaySpeed->setValue(settings.value("Playback/DefSpeed", 5).toInt());
} }
void FramePlaybackWindow::writeSettings() void FramePlaybackWindow::writeSettings()
+1 -1
View File
@@ -37,7 +37,7 @@
<item> <item>
<widget class="QCheckBox" name="cbValidate"> <widget class="QCheckBox" name="cbValidate">
<property name="text"> <property name="text">
<string>Validate GVRET connection</string> <string>Require validation of GVRET connection</string>
</property> </property>
</widget> </widget>
</item> </item>
+4
View File
@@ -238,6 +238,10 @@ void MainWindow::readSettings()
resize(settings.value("Main/WindowSize", QSize(800, 572)).toSize()); resize(settings.value("Main/WindowSize", QSize(800, 572)).toSize());
move(settings.value("Main/WindowPos", QPoint(100, 100)).toPoint()); move(settings.value("Main/WindowPos", QPoint(100, 100)).toPoint());
} }
if (settings.value("Main/AutoScroll", false).toBool())
{
ui->cbAutoScroll->setChecked(true);
}
} }
void MainWindow::writeSettings() void MainWindow::writeSettings()
+18 -3
View File
@@ -3,9 +3,10 @@
#include <QSerialPort> #include <QSerialPort>
#include <QDebug> #include <QDebug>
#include <QTimer> #include <QTimer>
#include <QSettings>
SerialWorker::SerialWorker(CANFrameModel *model, QObject *parent) : QObject(parent) SerialWorker::SerialWorker(CANFrameModel *model, QObject *parent) : QObject(parent)
{ {
serial = NULL; serial = NULL;
rx_state = IDLE; rx_state = IDLE;
rx_step = 0; rx_step = 0;
@@ -16,6 +17,8 @@ SerialWorker::SerialWorker(CANFrameModel *model, QObject *parent) : QObject(pare
elapsedTime = NULL; elapsedTime = NULL;
framesPerSec = 0; framesPerSec = 0;
capturing = true; capturing = true;
readSettings();
} }
SerialWorker::~SerialWorker() SerialWorker::~SerialWorker()
@@ -34,6 +37,17 @@ SerialWorker::~SerialWorker()
if (ticker != NULL) ticker->stop(); if (ticker != NULL) ticker->stop();
} }
void SerialWorker::readSettings()
{
QSettings settings;
if (settings.value("Main/ValidateComm", true).toBool())
{
doValidation = true;
}
else doValidation = false;
}
void SerialWorker::setSerialPort(QSerialPortInfo *port) void SerialWorker::setSerialPort(QSerialPortInfo *port)
{ {
if (serial != NULL) if (serial != NULL)
@@ -64,9 +78,10 @@ void SerialWorker::setSerialPort(QSerialPortInfo *port)
output.append(0xF1); //another command to the GVRET output.append(0xF1); //another command to the GVRET
output.append(0x07); //request device information output.append(0x07); //request device information
serial->write(output); serial->write(output);
connected = false; if (doValidation) connected = false;
else connected = true;
connect(serial, SIGNAL(readyRead()), this, SLOT(readSerialData())); connect(serial, SIGNAL(readyRead()), this, SLOT(readSerialData()));
QTimer::singleShot(1000, this, SLOT(connectionTimeout())); if (doValidation) QTimer::singleShot(1000, this, SLOT(connectionTimeout()));
if (ticker == NULL) if (ticker == NULL)
{ {
ticker = new QTimer; ticker = new QTimer;
+2
View File
@@ -56,6 +56,7 @@ private:
bool quit; bool quit;
bool connected; bool connected;
bool capturing; bool capturing;
bool doValidation;
QSerialPort *serial; QSerialPort *serial;
CANFrameModel *canModel; CANFrameModel *canModel;
QTimer *ticker; QTimer *ticker;
@@ -71,6 +72,7 @@ private:
int deviceSingleWireMode; int deviceSingleWireMode;
void procRXChar(unsigned char); void procRXChar(unsigned char);
void readSettings();
}; };
#endif // SERIALTHREAD_H #endif // SERIALTHREAD_H