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->sortByColumn(0, Qt::AscendingOrder);
QSettings settings;
if (settings.value("InfoCompare/AutoExpand", false).toBool())
{
ui->treeDetails->expandAll();
}
}
void FileComparatorWindow::saveDetails()
+10
View File
@@ -114,6 +114,16 @@ void FlowViewWindow::readSettings()
resize(settings.value("FlowView/WindowSize", QSize(1078, 621)).toSize());
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()
+6
View File
@@ -272,6 +272,12 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
else
{
}
QSettings settings;
if (settings.value("InfoCompare/AutoExpand", false).toBool())
{
ui->treeDetails->expandAll();
}
}
void FrameInfoWindow::refreshIDList()
+5
View File
@@ -97,6 +97,11 @@ void FramePlaybackWindow::readSettings()
resize(settings.value("Playback/WindowSize", QSize(742, 606)).toSize());
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()
+1 -1
View File
@@ -37,7 +37,7 @@
<item>
<widget class="QCheckBox" name="cbValidate">
<property name="text">
<string>Validate GVRET connection</string>
<string>Require validation of GVRET connection</string>
</property>
</widget>
</item>
+4
View File
@@ -238,6 +238,10 @@ void MainWindow::readSettings()
resize(settings.value("Main/WindowSize", QSize(800, 572)).toSize());
move(settings.value("Main/WindowPos", QPoint(100, 100)).toPoint());
}
if (settings.value("Main/AutoScroll", false).toBool())
{
ui->cbAutoScroll->setChecked(true);
}
}
void MainWindow::writeSettings()
+17 -2
View File
@@ -3,6 +3,7 @@
#include <QSerialPort>
#include <QDebug>
#include <QTimer>
#include <QSettings>
SerialWorker::SerialWorker(CANFrameModel *model, QObject *parent) : QObject(parent)
{
@@ -16,6 +17,8 @@ SerialWorker::SerialWorker(CANFrameModel *model, QObject *parent) : QObject(pare
elapsedTime = NULL;
framesPerSec = 0;
capturing = true;
readSettings();
}
SerialWorker::~SerialWorker()
@@ -34,6 +37,17 @@ SerialWorker::~SerialWorker()
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)
{
if (serial != NULL)
@@ -64,9 +78,10 @@ void SerialWorker::setSerialPort(QSerialPortInfo *port)
output.append(0xF1); //another command to the GVRET
output.append(0x07); //request device information
serial->write(output);
connected = false;
if (doValidation) connected = false;
else connected = true;
connect(serial, SIGNAL(readyRead()), this, SLOT(readSerialData()));
QTimer::singleShot(1000, this, SLOT(connectionTimeout()));
if (doValidation) QTimer::singleShot(1000, this, SLOT(connectionTimeout()));
if (ticker == NULL)
{
ticker = new QTimer;
+2
View File
@@ -56,6 +56,7 @@ private:
bool quit;
bool connected;
bool capturing;
bool doValidation;
QSerialPort *serial;
CANFrameModel *canModel;
QTimer *ticker;
@@ -71,6 +72,7 @@ private:
int deviceSingleWireMode;
void procRXChar(unsigned char);
void readSettings();
};
#endif // SERIALTHREAD_H