Merge branch 'master' of github.com:qurrent-llc/SavvyCAN
This commit is contained in:
@@ -485,6 +485,7 @@ void GVRetSerial::serialError(QSerialPort::SerialPortError err)
|
|||||||
killConnection = true;
|
killConnection = true;
|
||||||
piStop();
|
piStop();
|
||||||
break;
|
break;
|
||||||
|
#if QT_VERSION <= QT_VERSION_CHECK( 6, 0, 0 )
|
||||||
case QSerialPort::ParityError:
|
case QSerialPort::ParityError:
|
||||||
errMessage = "Parity error on serial port";
|
errMessage = "Parity error on serial port";
|
||||||
break;
|
break;
|
||||||
@@ -494,6 +495,7 @@ void GVRetSerial::serialError(QSerialPort::SerialPortError err)
|
|||||||
case QSerialPort::BreakConditionError:
|
case QSerialPort::BreakConditionError:
|
||||||
errMessage = "Break error on serial port";
|
errMessage = "Break error on serial port";
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case QSerialPort::WriteError:
|
case QSerialPort::WriteError:
|
||||||
errMessage = "Write error on serial port";
|
errMessage = "Write error on serial port";
|
||||||
piStop();
|
piStop();
|
||||||
|
|||||||
+11
-11
@@ -100,8 +100,15 @@ void DBCSignalHandler::sort()
|
|||||||
DBC_MESSAGE* DBCMessageHandler::findMsgByID(uint32_t id)
|
DBC_MESSAGE* DBCMessageHandler::findMsgByID(uint32_t id)
|
||||||
{
|
{
|
||||||
if (messages.count() == 0) return nullptr;
|
if (messages.count() == 0) return nullptr;
|
||||||
|
DBC_MESSAGE *bestMatch = nullptr;
|
||||||
|
|
||||||
for (int i = 0; i < messages.count(); i++)
|
for (int i = 0; i < messages.count(); i++)
|
||||||
{
|
{
|
||||||
|
if ( messages[i].ID == id )
|
||||||
|
{
|
||||||
|
return &messages[i];
|
||||||
|
}
|
||||||
|
|
||||||
if (matchingCriteria == J1939)
|
if (matchingCriteria == J1939)
|
||||||
{
|
{
|
||||||
// include data page and extended data page in the pgn
|
// include data page and extended data page in the pgn
|
||||||
@@ -112,7 +119,7 @@ DBC_MESSAGE* DBCMessageHandler::findMsgByID(uint32_t id)
|
|||||||
pgn &= 0x3FF00;
|
pgn &= 0x3FF00;
|
||||||
if ((messages[i].ID & 0x3FF0000) == (pgn << 8))
|
if ((messages[i].ID & 0x3FF0000) == (pgn << 8))
|
||||||
{
|
{
|
||||||
return &messages[i];
|
bestMatch = &messages[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -120,7 +127,7 @@ DBC_MESSAGE* DBCMessageHandler::findMsgByID(uint32_t id)
|
|||||||
// PDU2 format
|
// PDU2 format
|
||||||
if ((messages[i].ID & 0x3FFFF00) == (pgn << 8))
|
if ((messages[i].ID & 0x3FFFF00) == (pgn << 8))
|
||||||
{
|
{
|
||||||
return &messages[i];
|
bestMatch = &messages[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,17 +136,10 @@ DBC_MESSAGE* DBCMessageHandler::findMsgByID(uint32_t id)
|
|||||||
// Match the bits 14-26 (Arbitration Id) of GMLAN 29bit header
|
// Match the bits 14-26 (Arbitration Id) of GMLAN 29bit header
|
||||||
uint32_t arbId = id &0x3FFE000;
|
uint32_t arbId = id &0x3FFE000;
|
||||||
if ( (arbId != 0) && (messages[i].ID & 0x3FFE000) == arbId )
|
if ( (arbId != 0) && (messages[i].ID & 0x3FFE000) == arbId )
|
||||||
return &messages[i];
|
bestMatch = &messages[i];
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ( messages[i].ID == id )
|
|
||||||
{
|
|
||||||
return &messages[i];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
return bestMatch;
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DBC_MESSAGE* DBCMessageHandler::findMsgByIdx(int idx)
|
DBC_MESSAGE* DBCMessageHandler::findMsgByIdx(int idx)
|
||||||
|
|||||||
@@ -898,7 +898,11 @@ void FrameSenderWindow::processCellChange(int line, int col)
|
|||||||
case 6: //Data bytes
|
case 6: //Data bytes
|
||||||
for (int i = 0; i < 8; i++) sendingData[line].payload().data()[i] = 0;
|
for (int i = 0; i < 8; i++) sendingData[line].payload().data()[i] = 0;
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 14, 0 )
|
||||||
|
tokens = ui->tableSender->item(line, 6)->text().split(" ", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
tokens = ui->tableSender->item(line, 6)->text().split(" ", QString::SkipEmptyParts);
|
tokens = ui->tableSender->item(line, 6)->text().split(" ", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
arr.clear();
|
arr.clear();
|
||||||
arr.reserve(tokens.count());
|
arr.reserve(tokens.count());
|
||||||
for (int j = 0; j < tokens.count(); j++)
|
for (int j = 0; j < tokens.count(); j++)
|
||||||
|
|||||||
+2
-1
@@ -931,7 +931,8 @@ void JSEdit::resizeEvent(QResizeEvent *e)
|
|||||||
void JSEdit::wheelEvent(QWheelEvent *e)
|
void JSEdit::wheelEvent(QWheelEvent *e)
|
||||||
{
|
{
|
||||||
if (e->modifiers() == Qt::ControlModifier) {
|
if (e->modifiers() == Qt::ControlModifier) {
|
||||||
int steps = e->delta() / 20;
|
QPoint numDegrees = e->angleDelta();
|
||||||
|
int steps = numDegrees.y() / 20;
|
||||||
steps = qBound(-3, steps, 3);
|
steps = qBound(-3, steps, 3);
|
||||||
QFont textFont = font();
|
QFont textFont = font();
|
||||||
int pointSize = textFont.pointSize() + steps;
|
int pointSize = textFont.pointSize() + steps;
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ MainSettingsDialog::MainSettingsDialog(QWidget *parent) :
|
|||||||
ui->cbLoadConnections->setChecked(settings.value("Main/SaveRestoreConnections", false).toBool());
|
ui->cbLoadConnections->setChecked(settings.value("Main/SaveRestoreConnections", false).toBool());
|
||||||
|
|
||||||
ui->spinFontSize->setValue(settings.value("Main/FontSize", ui->cbDisplayHex->font().pointSize()).toUInt());
|
ui->spinFontSize->setValue(settings.value("Main/FontSize", ui->cbDisplayHex->font().pointSize()).toUInt());
|
||||||
|
ui->cbFontFixedWidth->setChecked(settings.value("Main/FontFixedWidth", false).toBool());
|
||||||
|
|
||||||
bool secondsMode = settings.value("Main/TimeSeconds", false).toBool();
|
bool secondsMode = settings.value("Main/TimeSeconds", false).toBool();
|
||||||
bool clockMode = settings.value("Main/TimeClock", false).toBool();
|
bool clockMode = settings.value("Main/TimeClock", false).toBool();
|
||||||
@@ -132,6 +133,7 @@ MainSettingsDialog::MainSettingsDialog(QWidget *parent) :
|
|||||||
connect(ui->cbHexGraphInfo, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
|
connect(ui->cbHexGraphInfo, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
|
||||||
connect(ui->cbIgnoreDBCColors, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
|
connect(ui->cbIgnoreDBCColors, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
|
||||||
connect(ui->spinMaximumFrames, SIGNAL(valueChanged(int)), this, SLOT(updateSettings()));
|
connect(ui->spinMaximumFrames, SIGNAL(valueChanged(int)), this, SLOT(updateSettings()));
|
||||||
|
connect(ui->cbFontFixedWidth, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
|
||||||
|
|
||||||
installEventFilter(this);
|
installEventFilter(this);
|
||||||
}
|
}
|
||||||
@@ -199,6 +201,7 @@ void MainSettingsDialog::updateSettings()
|
|||||||
settings.setValue("Main/FilterLabeling", ui->cbFilterLabeling->isChecked());
|
settings.setValue("Main/FilterLabeling", ui->cbFilterLabeling->isChecked());
|
||||||
settings.setValue("Main/IgnoreDBCColors", ui->cbIgnoreDBCColors->isChecked());
|
settings.setValue("Main/IgnoreDBCColors", ui->cbIgnoreDBCColors->isChecked());
|
||||||
settings.setValue("Main/MaximumFrames", ui->spinMaximumFrames->value());
|
settings.setValue("Main/MaximumFrames", ui->spinMaximumFrames->value());
|
||||||
|
settings.setValue("Main/FontFixedWidth", ui->cbFontFixedWidth->isChecked());
|
||||||
|
|
||||||
settings.sync();
|
settings.sync();
|
||||||
emit updatedSettings();
|
emit updatedSettings();
|
||||||
|
|||||||
+7
-1
@@ -57,12 +57,18 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
verticalHeader->setSectionResizeMode(QHeaderView::Fixed);
|
verticalHeader->setSectionResizeMode(QHeaderView::Fixed);
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
int fontSize = settings.value("Main/FontSize", 9).toUInt();
|
int fontSize = settings.value("Main/FontSize", 9).toUInt();
|
||||||
QFont sysFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); //get default font
|
QFont sysFont;
|
||||||
|
if(settings.value("Main/FontFixedWidth", false).toBool())
|
||||||
|
sysFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); //get default fixed width font
|
||||||
|
else
|
||||||
|
sysFont = QFont(); //get default font
|
||||||
sysFont.setPointSize(fontSize);
|
sysFont.setPointSize(fontSize);
|
||||||
verticalHeader->setDefaultSectionSize(sysFont.pixelSize());
|
verticalHeader->setDefaultSectionSize(sysFont.pixelSize());
|
||||||
|
verticalHeader->setFont(QFont());
|
||||||
ui->canFramesView->setFont(sysFont);
|
ui->canFramesView->setFont(sysFont);
|
||||||
|
|
||||||
QHeaderView *HorzHdr = ui->canFramesView->horizontalHeader();
|
QHeaderView *HorzHdr = ui->canFramesView->horizontalHeader();
|
||||||
|
HorzHdr->setFont(QFont());
|
||||||
HorzHdr->setStretchLastSection(true); //causes the data column to automatically fill the tableview
|
HorzHdr->setStretchLastSection(true); //causes the data column to automatically fill the tableview
|
||||||
connect(HorzHdr, SIGNAL(sectionClicked(int)), this, SLOT(headerClicked(int)));
|
connect(HorzHdr, SIGNAL(sectionClicked(int)), this, SLOT(headerClicked(int)));
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -129,7 +129,7 @@ class Q_MQTT_EXPORT Client : public QObject
|
|||||||
Q_PROPERTY(quint8 _willQos READ willQos WRITE setWillQos)
|
Q_PROPERTY(quint8 _willQos READ willQos WRITE setWillQos)
|
||||||
Q_PROPERTY(bool _willRetain READ willRetain WRITE setWillRetain)
|
Q_PROPERTY(bool _willRetain READ willRetain WRITE setWillRetain)
|
||||||
Q_PROPERTY(QByteArray _willMessage READ willMessage WRITE setWillMessage)
|
Q_PROPERTY(QByteArray _willMessage READ willMessage WRITE setWillMessage)
|
||||||
Q_PROPERTY(QString _connectionState READ connectionState)
|
Q_PROPERTY(ConnectionState _connectionState READ connectionState)
|
||||||
#ifndef QT_NO_SSL
|
#ifndef QT_NO_SSL
|
||||||
Q_PROPERTY(QSslConfiguration _sslConfiguration READ sslConfiguration WRITE setSslConfiguration)
|
Q_PROPERTY(QSslConfiguration _sslConfiguration READ sslConfiguration WRITE setSslConfiguration)
|
||||||
#endif // QT_NO_SSL
|
#endif // QT_NO_SSL
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ QMQTT::Socket::Socket(QObject* parent)
|
|||||||
connect(_socket.data(), &QTcpSocket::connected, this, &SocketInterface::connected);
|
connect(_socket.data(), &QTcpSocket::connected, this, &SocketInterface::connected);
|
||||||
connect(_socket.data(), &QTcpSocket::disconnected, this, &SocketInterface::disconnected);
|
connect(_socket.data(), &QTcpSocket::disconnected, this, &SocketInterface::disconnected);
|
||||||
connect(_socket.data(),
|
connect(_socket.data(),
|
||||||
static_cast<void (QTcpSocket::*)(QAbstractSocket::SocketError)>(&QTcpSocket::error),
|
SIGNAL(error(QTcpSocket::error)),
|
||||||
this,
|
this,
|
||||||
static_cast<void (SocketInterface::*)(QAbstractSocket::SocketError)>(&SocketInterface::error));
|
SLOT(errorHandler(SocketInterface::error)));
|
||||||
}
|
}
|
||||||
|
|
||||||
QMQTT::Socket::~Socket()
|
QMQTT::Socket::~Socket()
|
||||||
|
|||||||
@@ -46,9 +46,9 @@ QMQTT::SslSocket::SslSocket(const QSslConfiguration& config, QObject* parent)
|
|||||||
connect(_socket.data(), &QSslSocket::encrypted, this, &SocketInterface::connected);
|
connect(_socket.data(), &QSslSocket::encrypted, this, &SocketInterface::connected);
|
||||||
connect(_socket.data(), &QSslSocket::disconnected, this, &SocketInterface::disconnected);
|
connect(_socket.data(), &QSslSocket::disconnected, this, &SocketInterface::disconnected);
|
||||||
connect(_socket.data(),
|
connect(_socket.data(),
|
||||||
static_cast<void (QSslSocket::*)(QAbstractSocket::SocketError)>(&QSslSocket::error),
|
SIGNAL(error(QSslSocket::error)),
|
||||||
this,
|
this,
|
||||||
static_cast<void (SocketInterface::*)(QAbstractSocket::SocketError)>(&SocketInterface::error));
|
SLOT(errorHandler(SocketInterface::error)));
|
||||||
connect(_socket.data(),
|
connect(_socket.data(),
|
||||||
static_cast<void (QSslSocket::*)(const QList<QSslError>&)>(&QSslSocket::sslErrors),
|
static_cast<void (QSslSocket::*)(const QList<QSslError>&)>(&QSslSocket::sslErrors),
|
||||||
this,
|
this,
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ QVariant SnifferModel::data(const QModelIndex &index, int role) const
|
|||||||
Qt::ItemFlags SnifferModel::flags(const QModelIndex &index) const
|
Qt::ItemFlags SnifferModel::flags(const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return 0;
|
return Qt::NoItemFlags;
|
||||||
|
|
||||||
return QAbstractItemModel::flags(index);
|
return QAbstractItemModel::flags(index);
|
||||||
}
|
}
|
||||||
|
|||||||
+78
-10
@@ -4,6 +4,9 @@
|
|||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
|
#define MSG_COL 1
|
||||||
|
#define VALUE_COL 2
|
||||||
|
|
||||||
SignalViewerWindow::SignalViewerWindow(const QVector<CANFrame> *frames, QWidget *parent) :
|
SignalViewerWindow::SignalViewerWindow(const QVector<CANFrame> *frames, QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::SignalViewerWindow)
|
ui(new Ui::SignalViewerWindow)
|
||||||
@@ -14,15 +17,31 @@ SignalViewerWindow::SignalViewerWindow(const QVector<CANFrame> *frames, QWidget
|
|||||||
modelFrames = frames;
|
modelFrames = frames;
|
||||||
|
|
||||||
QStringList headers;
|
QStringList headers;
|
||||||
headers << "Signal" << "Value";
|
headers << "Node" << "Signal" << "Value";
|
||||||
ui->tableViewer->setHorizontalHeaderLabels(headers);
|
ui->tableViewer->setHorizontalHeaderLabels(headers);
|
||||||
ui->tableViewer->setColumnWidth(0, 150);
|
ui->tableViewer->setColumnWidth(0, 100);
|
||||||
ui->tableViewer->setColumnWidth(1, 300);
|
ui->tableViewer->setColumnWidth(1, 150);
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
QFont sysFont;
|
||||||
|
int fontSize = settings.value("Main/FontSize", 9).toUInt();
|
||||||
|
if(settings.value("Main/FontFixedWidth", false).toBool())
|
||||||
|
sysFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); //get default fixed width font
|
||||||
|
else
|
||||||
|
sysFont = QFont(); //get default font
|
||||||
|
sysFont.setPointSize(fontSize);
|
||||||
|
ui->tableViewer->setFont(sysFont);
|
||||||
|
|
||||||
QHeaderView *HorzHdr = ui->tableViewer->horizontalHeader();
|
QHeaderView *HorzHdr = ui->tableViewer->horizontalHeader();
|
||||||
HorzHdr->setStretchLastSection(true); //causes the data column to automatically fill the tableview
|
HorzHdr->setStretchLastSection(true); //causes the data column to automatically fill the tableview
|
||||||
|
HorzHdr->setFont(QFont());
|
||||||
|
|
||||||
|
QHeaderView *verticalHeader = ui->tableViewer->verticalHeader();
|
||||||
|
verticalHeader->setFont(QFont());
|
||||||
|
|
||||||
dbcHandler = DBCHandler::getReference();
|
dbcHandler = DBCHandler::getReference();
|
||||||
|
|
||||||
|
connect(ui->cbNodes, SIGNAL(currentIndexChanged(int)), this, SLOT(loadMessages(int)));
|
||||||
connect(ui->cbMessages, SIGNAL(currentIndexChanged(int)), this, SLOT(loadSignals(int)));
|
connect(ui->cbMessages, SIGNAL(currentIndexChanged(int)), this, SLOT(loadSignals(int)));
|
||||||
connect(ui->btnAdd, SIGNAL(clicked(bool)), this, SLOT(addSignal()));
|
connect(ui->btnAdd, SIGNAL(clicked(bool)), this, SLOT(addSignal()));
|
||||||
connect(MainWindow::getReference(), SIGNAL(framesUpdated(int)), this, SLOT(updatedFrames(int)));
|
connect(MainWindow::getReference(), SIGNAL(framesUpdated(int)), this, SLOT(updatedFrames(int)));
|
||||||
@@ -32,7 +51,7 @@ SignalViewerWindow::SignalViewerWindow(const QVector<CANFrame> *frames, QWidget
|
|||||||
connect(ui->btnAppend, SIGNAL(clicked(bool)), this, SLOT(appendSignalsFile()));
|
connect(ui->btnAppend, SIGNAL(clicked(bool)), this, SLOT(appendSignalsFile()));
|
||||||
connect(ui->btnClear, SIGNAL(clicked(bool)), this, SLOT(clearSignalsTable()));
|
connect(ui->btnClear, SIGNAL(clicked(bool)), this, SLOT(clearSignalsTable()));
|
||||||
|
|
||||||
loadMessages();
|
loadNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
SignalViewerWindow::~SignalViewerWindow()
|
SignalViewerWindow::~SignalViewerWindow()
|
||||||
@@ -79,11 +98,11 @@ void SignalViewerWindow::processFrame(CANFrame &frame)
|
|||||||
{
|
{
|
||||||
if (sig->processAsText(frame, sigString, false)) //if true we could interpret the signal so update it in the list
|
if (sig->processAsText(frame, sigString, false)) //if true we could interpret the signal so update it in the list
|
||||||
{
|
{
|
||||||
QTableWidgetItem *item = ui->tableViewer->item(i, 1);
|
QTableWidgetItem *item = ui->tableViewer->item(i, VALUE_COL);
|
||||||
if (!item)
|
if (!item)
|
||||||
{
|
{
|
||||||
item = new QTableWidgetItem(sigString);
|
item = new QTableWidgetItem(sigString);
|
||||||
ui->tableViewer->setItem(i, 1, item);
|
ui->tableViewer->setItem(i, VALUE_COL, item);
|
||||||
}
|
}
|
||||||
else item->setText(sigString);
|
else item->setText(sigString);
|
||||||
}
|
}
|
||||||
@@ -99,19 +118,66 @@ void SignalViewerWindow::removeSelectedSignal()
|
|||||||
ui->tableViewer->removeRow(selRow);
|
ui->tableViewer->removeRow(selRow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SignalViewerWindow::loadMessages()
|
void SetComboBoxItemEnabled(QComboBox * comboBox, int index, bool enabled)
|
||||||
|
{
|
||||||
|
auto * model = qobject_cast<QStandardItemModel*>(comboBox->model());
|
||||||
|
assert(model);
|
||||||
|
if(!model) return;
|
||||||
|
|
||||||
|
auto * item = model->item(index);
|
||||||
|
assert(item);
|
||||||
|
if(!item) return;
|
||||||
|
item->setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SignalViewerWindow::loadNodes()
|
||||||
{
|
{
|
||||||
int numFiles;
|
int numFiles;
|
||||||
ui->cbMessages->clear();
|
ui->cbNodes->clear();
|
||||||
if (dbcHandler == nullptr) return;
|
if (dbcHandler == nullptr) return;
|
||||||
if ((numFiles = dbcHandler->getFileCount()) == 0) return;
|
if ((numFiles = dbcHandler->getFileCount()) == 0) return;
|
||||||
qDebug() << numFiles;
|
qDebug() << numFiles;
|
||||||
|
for (int f = 0; f < numFiles; f++)
|
||||||
|
{
|
||||||
|
qDebug() << dbcHandler->getFileByIdx(f)->messageHandler->getCount();
|
||||||
|
|
||||||
|
QList<QString> names;
|
||||||
|
|
||||||
|
for (int x = 0; x < dbcHandler->getFileByIdx(f)->dbc_nodes.count(); x++)
|
||||||
|
{
|
||||||
|
QString name = dbcHandler->getFileByIdx(f)->dbc_nodes[x].name;
|
||||||
|
if(name != "Vector__XXX")
|
||||||
|
names.append(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(names.count() > 0)
|
||||||
|
{
|
||||||
|
names.sort();
|
||||||
|
ui->cbNodes->addItem("----" + dbcHandler->getFileByIdx(f)->getFilename());
|
||||||
|
SetComboBoxItemEnabled(ui->cbNodes, ui->cbNodes->count() -1, false);
|
||||||
|
for(int i=0; i<names.count(); i++)
|
||||||
|
ui->cbNodes->addItem(names[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SignalViewerWindow::loadMessages(int idx)
|
||||||
|
{
|
||||||
|
int numFiles;
|
||||||
|
ui->cbMessages->clear();
|
||||||
|
if (dbcHandler == nullptr) return;
|
||||||
|
if ((numFiles = dbcHandler->getFileCount()) == 0) return;
|
||||||
|
qDebug() << numFiles;
|
||||||
|
|
||||||
|
QString nodeName = ui->cbNodes->itemText(idx);
|
||||||
|
|
||||||
for (int f = 0; f < numFiles; f++)
|
for (int f = 0; f < numFiles; f++)
|
||||||
{
|
{
|
||||||
qDebug() << dbcHandler->getFileByIdx(f)->messageHandler->getCount();
|
qDebug() << dbcHandler->getFileByIdx(f)->messageHandler->getCount();
|
||||||
|
|
||||||
for (int x = 0; x < dbcHandler->getFileByIdx(f)->messageHandler->getCount(); x++)
|
for (int x = 0; x < dbcHandler->getFileByIdx(f)->messageHandler->getCount(); x++)
|
||||||
{
|
{
|
||||||
|
if(dbcHandler->getFileByIdx(f)->messageHandler->findMsgByIdx(x)->sender->name == nodeName)
|
||||||
ui->cbMessages->addItem(dbcHandler->getFileByIdx(f)->messageHandler->findMsgByIdx(x)->name);
|
ui->cbMessages->addItem(dbcHandler->getFileByIdx(f)->messageHandler->findMsgByIdx(x)->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -150,8 +216,10 @@ void SignalViewerWindow::addSignal(DBC_SIGNAL *sig)
|
|||||||
|
|
||||||
int rowIdx = ui->tableViewer->rowCount();
|
int rowIdx = ui->tableViewer->rowCount();
|
||||||
ui->tableViewer->insertRow(rowIdx);
|
ui->tableViewer->insertRow(rowIdx);
|
||||||
QTableWidgetItem *item = new QTableWidgetItem(sig->parentMessage->sender->name + " - " + sig->name);
|
QTableWidgetItem *nodeitem = new QTableWidgetItem(sig->parentMessage->sender->name);
|
||||||
ui->tableViewer->setItem(rowIdx, 0, item);
|
ui->tableViewer->setItem(rowIdx, 0, nodeitem);
|
||||||
|
QTableWidgetItem *msgitem = new QTableWidgetItem(sig->name);
|
||||||
|
ui->tableViewer->setItem(rowIdx, 1, msgitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SignalViewerWindow::saveSignalsFile()
|
void SignalViewerWindow::saveSignalsFile()
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ public:
|
|||||||
~SignalViewerWindow();
|
~SignalViewerWindow();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void loadMessages();
|
void loadNodes();
|
||||||
|
void loadMessages(int idx);
|
||||||
void loadSignals(int idx);
|
void loadSignals(int idx);
|
||||||
void addSignal();
|
void addSignal();
|
||||||
void addSignal(DBC_SIGNAL *sig);
|
void addSignal(DBC_SIGNAL *sig);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>965</width>
|
<width>965</width>
|
||||||
<height>678</height>
|
<height>713</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -191,9 +191,23 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QGroupBox" name="groupBox_7">
|
<widget class="QGroupBox" name="groupBox_7">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Font Size</string>
|
<string>Font</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="cbFontFixedWidth">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use fixed-width font in tables</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_11">
|
||||||
|
<property name="text">
|
||||||
|
<string>Size</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSpinBox" name="spinFontSize">
|
<widget class="QSpinBox" name="spinFontSize">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
|
|||||||
@@ -18,8 +18,11 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTableWidget" name="tableViewer">
|
<widget class="QTableWidget" name="tableViewer">
|
||||||
|
<property name="sortingEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="columnCount">
|
<property name="columnCount">
|
||||||
<number>2</number>
|
<number>3</number>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||||
<number>300</number>
|
<number>300</number>
|
||||||
@@ -32,6 +35,7 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
<column/>
|
<column/>
|
||||||
<column/>
|
<column/>
|
||||||
|
<column/>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
@@ -45,6 +49,16 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Node</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="cbNodes"/>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|||||||
Reference in New Issue
Block a user