minor changes and fixes
This commit is contained in:
+4
-2
@@ -54,7 +54,8 @@ SOURCES += main.cpp\
|
||||
connections/canconnection.cpp \
|
||||
connections/socketcan.cpp \
|
||||
connections/canconfactory.cpp \
|
||||
connections/gvretserial.cpp
|
||||
connections/gvretserial.cpp \
|
||||
connections/canconmanager.cpp
|
||||
|
||||
HEADERS += mainwindow.h \
|
||||
can_structs.h \
|
||||
@@ -97,7 +98,8 @@ HEADERS += mainwindow.h \
|
||||
connections/socketcan.h \
|
||||
connections/canconconst.h \
|
||||
connections/canconfactory.h \
|
||||
connections/gvretserial.h
|
||||
connections/gvretserial.h \
|
||||
connections/canconmanager.h
|
||||
|
||||
FORMS += mainwindow.ui \
|
||||
graphingwindow.ui \
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ public:
|
||||
void setFilter(uint32_t id, uint32_t mask, int bus);
|
||||
bool checkFilter(uint32_t id, int bus);
|
||||
|
||||
private:
|
||||
public:
|
||||
uint32_t ID;
|
||||
uint32_t mask;
|
||||
int bus;
|
||||
|
||||
+2
-2
@@ -74,7 +74,7 @@
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<widget class="QGroupBox" name="gbType">
|
||||
<property name="title">
|
||||
<string>Connection Type</string>
|
||||
</property>
|
||||
@@ -116,7 +116,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="lPort">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
|
||||
+31
-52
@@ -4,7 +4,7 @@
|
||||
#include <QDateTime>
|
||||
#include <QFileDialog>
|
||||
#include <QtSerialPort/QSerialPortInfo>
|
||||
#include "canframemodel.h"
|
||||
#include "connections/canconmanager.h"
|
||||
#include "utility.h"
|
||||
#include "serialworker.h"
|
||||
|
||||
@@ -62,28 +62,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
ui->canFramesView->setColumnWidth(6, 275);
|
||||
QHeaderView *HorzHdr = ui->canFramesView->horizontalHeader();
|
||||
HorzHdr->setStretchLastSection(true); //causes the data column to automatically fill the tableview
|
||||
//enabling the below line kills performance in every way imaginable. Left here as a warning. Do not do this.
|
||||
//ui->canFramesView->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
|
||||
/*
|
||||
worker = new SerialWorker(model);
|
||||
worker->moveToThread(&serialWorkerThread);
|
||||
connect(&serialWorkerThread, &QThread::finished, worker, &QObject::deleteLater);
|
||||
connect(&serialWorkerThread, &QThread::started, worker, &SerialWorker::run); //setup timers within the proper thread
|
||||
connect(this, &MainWindow::sendSerialPort, worker, &SerialWorker::setSerialPort, Qt::QueuedConnection);
|
||||
connect(worker, &SerialWorker::frameUpdateRapid, this, &MainWindow::gotFrames, Qt::QueuedConnection);
|
||||
connect(this, &MainWindow::updateBaudRates, worker, &SerialWorker::updateBaudRates, Qt::QueuedConnection);
|
||||
connect(this, &MainWindow::sendCANFrame, worker, &SerialWorker::sendFrame, 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);
|
||||
connect(this, &MainWindow::closeSerialPort, worker, &SerialWorker::closeSerialPort, Qt::QueuedConnection);
|
||||
connect(this, &MainWindow::startFrameCapturing, worker, &SerialWorker::startFrameCapture);
|
||||
connect(this, &MainWindow::stopFrameCapturing, worker, &SerialWorker::stopFrameCapture);
|
||||
connect(this, &MainWindow::settingsUpdated, worker, &SerialWorker::readSettings);
|
||||
serialWorkerThread.start();
|
||||
serialWorkerThread.setPriority(QThread::HighPriority);
|
||||
*/
|
||||
|
||||
graphingWindow = NULL;
|
||||
frameInfoWindow = NULL;
|
||||
@@ -146,6 +124,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
connect(ui->actionUDS_Scanner, &QAction::triggered, this, &MainWindow::showUDSScanWindow);
|
||||
connect(ui->actionISO_TP_Decoder, &QAction::triggered, this, &MainWindow::showISOInterpreterWindow);
|
||||
|
||||
connect(CANConManager::getInstance(), &CANConManager::framesReceived, model, &CANFrameModel::addFrames);
|
||||
|
||||
lbStatusConnected.setText(tr("Not connected"));
|
||||
updateFileStatus();
|
||||
lbStatusDatabase.setText(tr("No DBC database loaded"));
|
||||
@@ -179,8 +159,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
model->clearFrames();
|
||||
|
||||
//Automatically create the connection window so it can be updated even if we never opened it.
|
||||
connectionWindow = new ConnectionWindow(model);
|
||||
connect(connectionWindow, SIGNAL(updateConnectionSettings(QString,QString,int,int)), this, SLOT(updateConnectionSettings(QString,QString,int,int)));
|
||||
connectionWindow = new ConnectionWindow();
|
||||
connect(this, SIGNAL(suspendCapturing(bool)), connectionWindow, SLOT(setSuspendAll(bool)));
|
||||
}
|
||||
|
||||
@@ -480,28 +459,30 @@ void MainWindow::filterClearAll()
|
||||
|
||||
void MainWindow::tickGUIUpdate()
|
||||
{
|
||||
int elapsed = elapsedTime->elapsed();
|
||||
if(elapsed) {
|
||||
framesPerSec += rxFrames * 1000 / elapsed - (framesPerSec / 4);
|
||||
elapsedTime->restart();
|
||||
}
|
||||
else
|
||||
framesPerSec = 0;
|
||||
|
||||
model->sendBulkRefresh(rxFrames);
|
||||
|
||||
ui->lbNumFrames->setText(QString::number(model->rowCount()));
|
||||
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
||||
ui->lbFPS->setText(QString::number(framesPerSec / 4));
|
||||
if (rxFrames > 0)
|
||||
rxFrames = model->sendBulkRefresh();
|
||||
if(rxFrames>0)
|
||||
{
|
||||
bDirty = true;
|
||||
emit framesUpdated(rxFrames); //anyone care that frames were updated?
|
||||
int elapsed = elapsedTime->elapsed();
|
||||
if(elapsed) {
|
||||
framesPerSec = rxFrames * 1000 / elapsed;
|
||||
elapsedTime->restart();
|
||||
}
|
||||
else
|
||||
framesPerSec = 0;
|
||||
|
||||
ui->lbNumFrames->setText(QString::number(model->rowCount()));
|
||||
if (ui->cbAutoScroll->isChecked()) ui->canFramesView->scrollToBottom();
|
||||
ui->lbFPS->setText(QString::number(framesPerSec));
|
||||
if (rxFrames > 0)
|
||||
{
|
||||
bDirty = true;
|
||||
emit framesUpdated(rxFrames); //anyone care that frames were updated?
|
||||
}
|
||||
|
||||
if (model->needsFilterRefresh()) updateFilterList();
|
||||
|
||||
rxFrames = 0;
|
||||
}
|
||||
|
||||
if (model->needsFilterRefresh()) updateFilterList();
|
||||
|
||||
rxFrames = 0;
|
||||
}
|
||||
|
||||
void MainWindow::gotFrames(int framesSinceLastUpdate)
|
||||
@@ -867,7 +848,7 @@ void MainWindow::showFrameSenderWindow()
|
||||
else
|
||||
frameSenderWindow = new FrameSenderWindow(model->getFilteredListReference());
|
||||
|
||||
connect(frameSenderWindow, &FrameSenderWindow::sendCANFrame, connectionWindow, &ConnectionWindow::sendFrame);
|
||||
//connect(frameSenderWindow, &FrameSenderWindow::sendCANFrame, connectionWindow, &ConnectionWindow::sendFrame);
|
||||
}
|
||||
frameSenderWindow->show();
|
||||
}
|
||||
@@ -881,8 +862,8 @@ void MainWindow::showPlaybackWindow()
|
||||
else
|
||||
playbackWindow = new FramePlaybackWindow(model->getFilteredListReference());
|
||||
|
||||
connect(playbackWindow, SIGNAL(sendCANFrame(const CANFrame*)), connectionWindow, SLOT(sendFrame(const CANFrame*)), Qt::QueuedConnection);
|
||||
connect(playbackWindow, SIGNAL(sendFrameBatch(const QList<CANFrame>*)), connectionWindow, SLOT(sendFrameBatch(const QList<CANFrame>*)), Qt::QueuedConnection);
|
||||
//connect(playbackWindow, SIGNAL(sendCANFrame(const CANFrame*)), connectionWindow, SLOT(sendFrame(const CANFrame*)), Qt::QueuedConnection);
|
||||
//connect(playbackWindow, SIGNAL(sendFrameBatch(const QList<CANFrame>*)), connectionWindow, SLOT(sendFrameBatch(const QList<CANFrame>*)), Qt::QueuedConnection);
|
||||
}
|
||||
playbackWindow->show();
|
||||
}
|
||||
@@ -892,7 +873,7 @@ void MainWindow::showFirmwareUploaderWindow()
|
||||
if (!firmwareUploaderWindow)
|
||||
{
|
||||
firmwareUploaderWindow = new FirmwareUploaderWindow(model->getListReference());
|
||||
connect(firmwareUploaderWindow, SIGNAL(sendCANFrame(const CANFrame*)), connectionWindow, SLOT(sendFrame(const CANFrame*)));
|
||||
//connect(firmwareUploaderWindow, SIGNAL(sendCANFrame(const CANFrame*)), connectionWindow, SLOT(sendFrame(const CANFrame*)));
|
||||
//connect(worker, SIGNAL(gotTargettedFrame(int)), firmwareUploaderWindow, SLOT(gotTargettedFrame(int)));
|
||||
}
|
||||
firmwareUploaderWindow->show();
|
||||
@@ -942,7 +923,6 @@ void MainWindow::showScriptingWindow()
|
||||
if (!scriptingWindow)
|
||||
{
|
||||
scriptingWindow = new ScriptingWindow(model->getListReference());
|
||||
connect(scriptingWindow, &ScriptingWindow::sendCANFrame, connectionWindow, &ConnectionWindow::sendFrame);
|
||||
}
|
||||
scriptingWindow->show();
|
||||
}
|
||||
@@ -995,8 +975,7 @@ void MainWindow::showConnectionSettingsWindow()
|
||||
{
|
||||
if (!connectionWindow)
|
||||
{
|
||||
connectionWindow = new ConnectionWindow(model);
|
||||
connect(connectionWindow, SIGNAL(updateConnectionSettings(QString,QString,int,int)), this, SLOT(updateConnectionSettings(QString,QString,int,int)));
|
||||
connectionWindow = new ConnectionWindow();
|
||||
}
|
||||
connectionWindow->show();
|
||||
}
|
||||
|
||||
+4
-1
@@ -103,6 +103,9 @@
|
||||
<property name="text">
|
||||
<string>Suspend Capturing</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -197,7 +200,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>27</height>
|
||||
<height>19</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menu_RE_Tools">
|
||||
|
||||
Reference in New Issue
Block a user