diff --git a/candatagrid.cpp b/candatagrid.cpp index e4fff83..dff5487 100644 --- a/candatagrid.cpp +++ b/candatagrid.cpp @@ -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 diff --git a/canframemodel.cpp b/canframemodel.cpp index 136630e..77bd88c 100644 --- a/canframemodel.cpp +++ b/canframemodel.cpp @@ -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) diff --git a/dbcmaineditor.cpp b/dbcmaineditor.cpp index bb2092e..44c1e79 100644 --- a/dbcmaineditor.cpp +++ b/dbcmaineditor.cpp @@ -69,6 +69,7 @@ DBCMainEditor::~DBCMainEditor() void DBCMainEditor::closeEvent(QCloseEvent *event) { + Q_UNUSED(event); writeSettings(); } diff --git a/dbcsignaleditor.cpp b/dbcsignaleditor.cpp index ab159b3..7008da8 100644 --- a/dbcsignaleditor.cpp +++ b/dbcsignaleditor.cpp @@ -163,6 +163,7 @@ DBCSignalEditor::~DBCSignalEditor() void DBCSignalEditor::closeEvent(QCloseEvent *event) { + Q_UNUSED(event); writeSettings(); } diff --git a/filecomparatorwindow.cpp b/filecomparatorwindow.cpp index f05c5a6..1bebe2d 100644 --- a/filecomparatorwindow.cpp +++ b/filecomparatorwindow.cpp @@ -30,6 +30,7 @@ void FileComparatorWindow::showEvent(QShowEvent *) void FileComparatorWindow::closeEvent(QCloseEvent *event) { + Q_UNUSED(event); writeSettings(); } diff --git a/flowviewwindow.cpp b/flowviewwindow.cpp index 8930ccf..6e1cd36 100644 --- a/flowviewwindow.cpp +++ b/flowviewwindow.cpp @@ -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() diff --git a/framefileio.cpp b/framefileio.cpp index 986523c..de72df4 100644 --- a/framefileio.cpp +++ b/framefileio.cpp @@ -108,7 +108,7 @@ bool FrameFileIO::loadCRTDFile(QString filename, QVector* 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 diff --git a/frameinfowindow.cpp b/frameinfowindow.cpp index 6f1390a..a982b8d 100644 --- a/frameinfowindow.cpp +++ b/frameinfowindow.cpp @@ -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); diff --git a/frameplaybackwindow.cpp b/frameplaybackwindow.cpp index 86bf985..64b66fc 100644 --- a/frameplaybackwindow.cpp +++ b/frameplaybackwindow.cpp @@ -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) diff --git a/graphingwindow.cpp b/graphingwindow.cpp index 68e0db2..196b075 100644 --- a/graphingwindow.cpp +++ b/graphingwindow.cpp @@ -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()) diff --git a/mainsettingsdialog.cpp b/mainsettingsdialog.cpp index 5432e8e..3ab2117 100644 --- a/mainsettingsdialog.cpp +++ b/mainsettingsdialog.cpp @@ -55,6 +55,7 @@ MainSettingsDialog::~MainSettingsDialog() void MainSettingsDialog::closeEvent(QCloseEvent *event) { + Q_UNUSED(event); settings->sync(); } diff --git a/mainwindow.cpp b/mainwindow.cpp index a2430a0..11f01e6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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(); } diff --git a/newgraphdialog.cpp b/newgraphdialog.cpp index aa53179..2a24a74 100644 --- a/newgraphdialog.cpp +++ b/newgraphdialog.cpp @@ -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()); diff --git a/serialworker.cpp b/serialworker.cpp index b1e7dcb..ae623a7 100644 --- a/serialworker.cpp +++ b/serialworker.cpp @@ -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); }