@@ -72,12 +72,6 @@ void GVRetSerial::sendToSerial(const QByteArray &bytes)
|
|||||||
void GVRetSerial::piStarted()
|
void GVRetSerial::piStarted()
|
||||||
{
|
{
|
||||||
connectDevice();
|
connectDevice();
|
||||||
|
|
||||||
/* start timer */
|
|
||||||
connect(&mTimer, SIGNAL(timeout()), this, SLOT(handleTick()));
|
|
||||||
mTimer.setInterval(250); //tick four times per second
|
|
||||||
mTimer.setSingleShot(false); //keep ticking
|
|
||||||
mTimer.start();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -287,12 +281,14 @@ void GVRetSerial::connectDevice()
|
|||||||
/* open new device */
|
/* open new device */
|
||||||
if (getPort().contains('.')) //TCP/IP mode then since it looks like an IP address
|
if (getPort().contains('.')) //TCP/IP mode then since it looks like an IP address
|
||||||
{
|
{
|
||||||
|
qDebug() << "TCP Connection to a GVRET device";
|
||||||
tcpClient = new QTcpSocket();
|
tcpClient = new QTcpSocket();
|
||||||
tcpClient->connectToHost(getPort(), 23);
|
tcpClient->connectToHost(getPort(), 23);
|
||||||
connect(tcpClient, SIGNAL(readyRead()), this, SLOT(readSerialData()));
|
connect(tcpClient, SIGNAL(readyRead()), this, SLOT(readSerialData()));
|
||||||
connect(tcpClient, SIGNAL(connected()), this, SLOT(tcpConnected()));
|
connect(tcpClient, SIGNAL(connected()), this, SLOT(tcpConnected()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
qDebug() << "Serial connection to a GVRET device";
|
||||||
serial = new QSerialPort(QSerialPortInfo(getPort()));
|
serial = new QSerialPort(QSerialPortInfo(getPort()));
|
||||||
if(!serial) {
|
if(!serial) {
|
||||||
qDebug() << "can't open serial port " << getPort();
|
qDebug() << "can't open serial port " << getPort();
|
||||||
@@ -362,6 +358,12 @@ void GVRetSerial::tcpConnected()
|
|||||||
|
|
||||||
sendToSerial(output);
|
sendToSerial(output);
|
||||||
|
|
||||||
|
/* start timer */
|
||||||
|
connect(&mTimer, SIGNAL(timeout()), this, SLOT(handleTick()));
|
||||||
|
mTimer.setInterval(250); //tick four times per second
|
||||||
|
mTimer.setSingleShot(false); //keep ticking
|
||||||
|
mTimer.start();
|
||||||
|
|
||||||
if(doValidation) {
|
if(doValidation) {
|
||||||
QTimer::singleShot(1000, this, SLOT(connectionTimeout()));
|
QTimer::singleShot(1000, this, SLOT(connectionTimeout()));
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -325,7 +325,7 @@ bool FrameFileIO::loadCRTDFile(QString filename, QVector<CANFrame>* frames)
|
|||||||
{
|
{
|
||||||
QList<QByteArray> tokens = line.split(' ');
|
QList<QByteArray> tokens = line.split(' ');
|
||||||
int multiplier;
|
int multiplier;
|
||||||
if (tokens.length() > 3)
|
if (tokens.length() > 2)
|
||||||
{
|
{
|
||||||
int idxOfDecimal = tokens[0].indexOf('.');
|
int idxOfDecimal = tokens[0].indexOf('.');
|
||||||
if (idxOfDecimal > -1) {
|
if (idxOfDecimal > -1) {
|
||||||
@@ -699,7 +699,7 @@ bool FrameFileIO::loadNativeCSVFile(QString filename, QVector<CANFrame>* frames)
|
|||||||
if (line.length() > 2)
|
if (line.length() > 2)
|
||||||
{
|
{
|
||||||
QList<QByteArray> tokens = line.split(',');
|
QList<QByteArray> tokens = line.split(',');
|
||||||
if (tokens.length() >= 6)
|
if (tokens.length() >= 5)
|
||||||
{
|
{
|
||||||
if (tokens[0].length() > 3)
|
if (tokens[0].length() > 3)
|
||||||
{
|
{
|
||||||
|
|||||||
+6
-16
@@ -10,7 +10,7 @@ HelpWindow::HelpWindow(QWidget *parent) :
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
m_helpEngine = new QHelpEngineCore("SavvyCAN.qhc", this);
|
m_helpEngine = new QHelpEngineCore(QApplication::applicationDirPath() +"/SavvyCAN.qhc", this);
|
||||||
if (!m_helpEngine->setupData()) {
|
if (!m_helpEngine->setupData()) {
|
||||||
delete m_helpEngine;
|
delete m_helpEngine;
|
||||||
m_helpEngine = 0;
|
m_helpEngine = 0;
|
||||||
@@ -66,8 +66,10 @@ HelpWindow* HelpWindow::getRef()
|
|||||||
void HelpWindow::showHelp(QString help)
|
void HelpWindow::showHelp(QString help)
|
||||||
{
|
{
|
||||||
if (m_helpEngine) {
|
if (m_helpEngine) {
|
||||||
qDebug() << "Searching for " << help;
|
QString url = "qthelp://org.sphinx.savvycan.181/doc/" + help;
|
||||||
QByteArray helpData = m_helpEngine->fileData(QUrl("qthelp://org.sphinx.savvycan.181/doc/" + help));
|
qDebug() << "Searching for " << url;
|
||||||
|
QByteArray helpData = m_helpEngine->fileData(QUrl(url));
|
||||||
|
qDebug() << "Help file size: " << helpData.length();
|
||||||
ui->textHelp->setText(helpData);
|
ui->textHelp->setText(helpData);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -78,17 +80,5 @@ void HelpWindow::showHelp(QString help)
|
|||||||
readSettings();
|
readSettings();
|
||||||
self->show();
|
self->show();
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
|
|
||||||
QVariant HelpBrowser::loadResource(int type, const QUrl &name)
|
|
||||||
{
|
|
||||||
QByteArray ba;
|
|
||||||
if (type < 4 && m_helpEngine) {
|
|
||||||
QUrl url(name);
|
|
||||||
if (name.isRelative())
|
|
||||||
url = source().resolved(url);
|
|
||||||
ba = m_helpEngine->fileData(url);
|
|
||||||
}
|
|
||||||
return ba;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|||||||
+14
-1
@@ -545,7 +545,20 @@ void MainWindow::handleLoadFile()
|
|||||||
QString filename;
|
QString filename;
|
||||||
QVector<CANFrame> tempFrames;
|
QVector<CANFrame> tempFrames;
|
||||||
|
|
||||||
if (FrameFileIO::loadFrameFile(filename, &tempFrames))
|
QMessageBox::StandardButton confirmDialog;
|
||||||
|
|
||||||
|
bool loadResult = FrameFileIO::loadFrameFile(filename, &tempFrames);
|
||||||
|
|
||||||
|
if (!loadResult)
|
||||||
|
{
|
||||||
|
confirmDialog = QMessageBox::question(this, "Error Loading", "Do you want to salvage what could be loaded?",
|
||||||
|
QMessageBox::Yes|QMessageBox::No);
|
||||||
|
if (confirmDialog == QMessageBox::Yes) {
|
||||||
|
loadResult = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (loadResult)
|
||||||
{
|
{
|
||||||
ui->canFramesView->scrollToTop();
|
ui->canFramesView->scrollToTop();
|
||||||
model->clearFrames();
|
model->clearFrames();
|
||||||
|
|||||||
Reference in New Issue
Block a user