A bunch of little tweaks to remove compile-time warnings. Just convenience really.
This commit is contained in:
@@ -41,6 +41,7 @@ void CANDataGrid::mousePressEvent(QMouseEvent *event)
|
||||
|
||||
void CANDataGrid::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
int x, y;
|
||||
unsigned char prevByte, thisByte;
|
||||
bool thisBit, prevBit;
|
||||
@@ -140,6 +141,8 @@ void CANDataGrid::paintEvent(QPaintEvent *event)
|
||||
|
||||
void CANDataGrid::saveImage(QString filename, int width, int height)
|
||||
{
|
||||
Q_UNUSED(width); //currently unused but I want to use them in the future
|
||||
Q_UNUSED(height);
|
||||
//can't quite do the below commented out stuff
|
||||
//it works but doesn't scale the image into that pixmap. Need to
|
||||
//figure out how to draw the size of the pixmap
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
int CANFrameModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
Q_UNUSED(parent);
|
||||
return filteredFrames.count();
|
||||
}
|
||||
|
||||
@@ -15,6 +16,7 @@ int CANFrameModel::totalFrameCount()
|
||||
|
||||
int CANFrameModel::columnCount(const QModelIndex &index) const
|
||||
{
|
||||
Q_UNUSED(index);
|
||||
return 6;
|
||||
}
|
||||
|
||||
@@ -244,6 +246,8 @@ QVariant CANFrameModel::headerData(int section, Qt::Orientation orientation,
|
||||
|
||||
else
|
||||
return QString::number(section + 1);
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
void CANFrameModel::addFrame(CANFrame &frame, bool autoRefresh = false)
|
||||
|
||||
@@ -69,6 +69,7 @@ DBCMainEditor::~DBCMainEditor()
|
||||
|
||||
void DBCMainEditor::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
writeSettings();
|
||||
}
|
||||
|
||||
|
||||
@@ -163,6 +163,7 @@ DBCSignalEditor::~DBCSignalEditor()
|
||||
|
||||
void DBCSignalEditor::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
writeSettings();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ void FileComparatorWindow::showEvent(QShowEvent *)
|
||||
|
||||
void FileComparatorWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
writeSettings();
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -106,6 +106,7 @@ FlowViewWindow::~FlowViewWindow()
|
||||
|
||||
void FlowViewWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
writeSettings();
|
||||
}
|
||||
|
||||
@@ -323,7 +324,7 @@ void FlowViewWindow::refreshIDList()
|
||||
if (!foundID.contains(id))
|
||||
{
|
||||
foundID.append(id);
|
||||
QListWidgetItem* item = new QListWidgetItem(Utility::formatNumber(id), ui->listFrameID);
|
||||
//QListWidgetItem* item = new QListWidgetItem(Utility::formatNumber(id), ui->listFrameID);
|
||||
}
|
||||
}
|
||||
//default is to sort in ascending order
|
||||
@@ -430,7 +431,7 @@ void FlowViewWindow::changePlaybackSpeed(int newSpeed)
|
||||
|
||||
void FlowViewWindow::changeLooping(bool check)
|
||||
{
|
||||
|
||||
Q_UNUSED(check);
|
||||
}
|
||||
|
||||
void FlowViewWindow::timerTriggered()
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ bool FrameFileIO::loadCRTDFile(QString filename, QVector<CANFrame>* frames)
|
||||
int multiplier;
|
||||
int idxOfDecimal = tokens[0].indexOf('.');
|
||||
if (idxOfDecimal > -1) {
|
||||
int decimalPlaces = tokens[0].length() - tokens[0].indexOf('.') - 1;
|
||||
//int decimalPlaces = tokens[0].length() - tokens[0].indexOf('.') - 1;
|
||||
//the result of the above is the # of digits after the decimal.
|
||||
//This program deals in microsecond so turn the value into microseconds
|
||||
multiplier = 1000000; //turn the decimal into full microseconds
|
||||
|
||||
+3
-2
@@ -36,6 +36,7 @@ FrameInfoWindow::~FrameInfoWindow()
|
||||
|
||||
void FrameInfoWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
writeSettings();
|
||||
}
|
||||
|
||||
@@ -105,14 +106,14 @@ void FrameInfoWindow::updatedFrames(int numFrames)
|
||||
|
||||
void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
{
|
||||
int idx, numFrames, targettedID;
|
||||
int targettedID;
|
||||
int minLen, maxLen, thisLen;
|
||||
int avgInterval;
|
||||
int minData[8];
|
||||
int maxData[8];
|
||||
int dataHistogram[256][8];
|
||||
int bitfieldHistogram[64];
|
||||
QTreeWidgetItem *baseNode, *dataBase, *histBase, *numBase, *tempItem;
|
||||
QTreeWidgetItem *baseNode, *dataBase, *histBase, *tempItem;
|
||||
|
||||
targettedID = Utility::ParseStringToNum(newID);
|
||||
|
||||
|
||||
@@ -85,6 +85,8 @@ FramePlaybackWindow::~FramePlaybackWindow()
|
||||
{
|
||||
delete ui;
|
||||
|
||||
disconnect(serialWorker);
|
||||
|
||||
playbackTimer->stop();
|
||||
delete playbackTimer;
|
||||
}
|
||||
@@ -96,6 +98,7 @@ void FramePlaybackWindow::showEvent(QShowEvent *)
|
||||
|
||||
void FramePlaybackWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
writeSettings();
|
||||
}
|
||||
|
||||
@@ -140,7 +143,6 @@ void FramePlaybackWindow::saveFilters()
|
||||
{
|
||||
QString filename;
|
||||
QFileDialog dialog(this);
|
||||
bool result = false;
|
||||
|
||||
QStringList filters;
|
||||
filters.append(QString(tr("Filter list (*.ftl)")));
|
||||
@@ -237,8 +239,6 @@ void FramePlaybackWindow::loadFilters()
|
||||
|
||||
void FramePlaybackWindow::refreshIDList()
|
||||
{
|
||||
int id;
|
||||
|
||||
if (currentSeqNum < 0 || currentSeqItem == NULL) return;
|
||||
|
||||
ui->tblSequence->setCurrentCell(currentSeqNum, 0);
|
||||
@@ -484,7 +484,7 @@ void FramePlaybackWindow::changePlaybackSpeed(int newSpeed)
|
||||
|
||||
void FramePlaybackWindow::changeLooping(bool check)
|
||||
{
|
||||
|
||||
Q_UNUSED(check);
|
||||
}
|
||||
|
||||
void FramePlaybackWindow::changeSendingBus(int newIdx)
|
||||
|
||||
+1
-1
@@ -81,6 +81,7 @@ void GraphingWindow::showEvent(QShowEvent* event)
|
||||
|
||||
void GraphingWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
writeSettings();
|
||||
}
|
||||
|
||||
@@ -172,7 +173,6 @@ void GraphingWindow::legendDoubleClick(QCPLegend *legend, QCPAbstractLegendItem
|
||||
|
||||
if (ui->graphingView->selectedGraphs().size() > 0)
|
||||
{
|
||||
int idx = -1;
|
||||
for (int i = 0; i < graphParams.count(); i++)
|
||||
{
|
||||
if (graphParams[i].ref == ui->graphingView->selectedGraphs().first())
|
||||
|
||||
@@ -55,6 +55,7 @@ MainSettingsDialog::~MainSettingsDialog()
|
||||
|
||||
void MainSettingsDialog::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
settings->sync();
|
||||
}
|
||||
|
||||
|
||||
+4
-1
@@ -240,6 +240,7 @@ MainWindow::~MainWindow()
|
||||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
writeSettings();
|
||||
exitApp();
|
||||
}
|
||||
@@ -621,7 +622,6 @@ void MainWindow::handleSaveFilters()
|
||||
{
|
||||
QString filename;
|
||||
QFileDialog dialog(this);
|
||||
bool result = false;
|
||||
|
||||
QStringList filters;
|
||||
filters.append(QString(tr("Filter list (*.ftl)")));
|
||||
@@ -934,6 +934,8 @@ void MainWindow::showFrameSenderWindow()
|
||||
frameSenderWindow = new FrameSenderWindow(model->getListReference());
|
||||
else
|
||||
frameSenderWindow = new FrameSenderWindow(model->getFilteredListReference());
|
||||
|
||||
connect(frameSenderWindow, SIGNAL(sendCANFrame(const CANFrame*,int)), worker, SLOT(sendFrame(const CANFrame*,int)));
|
||||
}
|
||||
frameSenderWindow->show();
|
||||
}
|
||||
@@ -982,6 +984,7 @@ void MainWindow::exitApp()
|
||||
if (flowViewWindow) flowViewWindow->close();
|
||||
if (frameSenderWindow) frameSenderWindow->close();
|
||||
if (dbcMainEditor) dbcMainEditor->close();
|
||||
if (comparatorWindow) comparatorWindow->close();
|
||||
this->close();
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +114,7 @@ void NewGraphDialog::loadMessages()
|
||||
|
||||
void NewGraphDialog::loadSignals(int idx)
|
||||
{
|
||||
Q_UNUSED(idx);
|
||||
//messages were placed into the list in the same order as they exist
|
||||
//in the data structure so it should have been possible to just
|
||||
//look it up based on index but by name is probably safer and this operation
|
||||
@@ -130,6 +131,7 @@ void NewGraphDialog::loadSignals(int idx)
|
||||
|
||||
void NewGraphDialog::fillFormFromSignal(int idx)
|
||||
{
|
||||
Q_UNUSED(idx);
|
||||
GraphParams params;
|
||||
DBC_MESSAGE *msg = dbcHandler->findMsgByName(ui->cbMessages->currentText());
|
||||
|
||||
|
||||
+16
-16
@@ -80,23 +80,23 @@ void SerialWorker::setSerialPort(QSerialPortInfo *port)
|
||||
serial->setDataTerminalReady(true); //you do need to set these or the fan gets dirty
|
||||
serial->setRequestToSend(true);
|
||||
QByteArray output;
|
||||
output.append(0xE7); //this puts the device into binary comm mode
|
||||
output.append(0xE7);
|
||||
output.append(0xF1); //signal we want to issue a command
|
||||
output.append(0x06); //request canbus stats from the board
|
||||
output.append(0xF1); //another command to the GVRET
|
||||
output.append(0x07); //request device information
|
||||
output.append(0xF1);
|
||||
output.append(0x08); //setting singlewire mode
|
||||
output.append(0xF1); //yet another command
|
||||
output.append(0x09); //comm validation command
|
||||
output.append((char)0xE7); //this puts the device into binary comm mode
|
||||
output.append((char)0xE7);
|
||||
output.append((char)0xF1); //signal we want to issue a command
|
||||
output.append((char)0x06); //request canbus stats from the board
|
||||
output.append((char)0xF1); //another command to the GVRET
|
||||
output.append((char)0x07); //request device information
|
||||
output.append((char)0xF1);
|
||||
output.append((char)0x08); //setting singlewire mode
|
||||
output.append((char)0xF1); //yet another command
|
||||
output.append((char)0x09); //comm validation command
|
||||
if (settings.value("Main/SingleWireMode", false).toBool())
|
||||
{
|
||||
output.append(0x10); //signal that we do want single wire mode
|
||||
output.append((char)0x10); //signal that we do want single wire mode
|
||||
}
|
||||
else
|
||||
{
|
||||
output.append(0xFF); //signal we don't want single wire mode
|
||||
output.append((char)0xFF); //signal we don't want single wire mode
|
||||
}
|
||||
|
||||
serial->write(output);
|
||||
@@ -157,7 +157,7 @@ void SerialWorker::sendFrame(const CANFrame *frame, int bus = 0)
|
||||
ID = frame->ID;
|
||||
if (frame->extended) ID |= 1 << 31;
|
||||
|
||||
buffer[0] = 0xF1; //start of a command over serial
|
||||
buffer[0] = (char)0xF1; //start of a command over serial
|
||||
buffer[1] = 0; //command ID for sending a CANBUS frame
|
||||
buffer[2] = (unsigned char)(ID & 0xFF); //four bytes of ID LSB first
|
||||
buffer[3] = (unsigned char)(ID >> 8);
|
||||
@@ -189,7 +189,7 @@ void SerialWorker::updateBaudRates(int Speed1, int Speed2)
|
||||
{
|
||||
QByteArray buffer;
|
||||
qDebug() << "Got signal to update bauds. 1: " << Speed1 <<" 2: " << Speed2;
|
||||
buffer[0] = 0xF1; //start of a command over serial
|
||||
buffer[0] = (char)0xF1; //start of a command over serial
|
||||
buffer[1] = 5; //setup canbus
|
||||
buffer[2] = (unsigned char)(Speed1 & 0xFF); //four bytes of ID LSB first
|
||||
buffer[3] = (unsigned char)(Speed1 >> 8);
|
||||
@@ -432,8 +432,8 @@ void SerialWorker::sendCommValidation()
|
||||
QByteArray output;
|
||||
|
||||
gotValidated = false;
|
||||
output.append(0xF1); //another command to the GVRET
|
||||
output.append(0x09); //request a reply to get validation
|
||||
output.append((char)0xF1); //another command to the GVRET
|
||||
output.append((char)0x09); //request a reply to get validation
|
||||
serial->write(output);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user