Many little changes to get rid of compile-time warnings.
There now should be no warnings when compiling on LINUX. YMMV elsewhere.
This commit is contained in:
@@ -356,7 +356,7 @@ void ISOTP_HANDLER::setProcessAll(bool state)
|
||||
processAll = state;
|
||||
}
|
||||
|
||||
void ISOTP_HANDLER::addFilter(uint32_t pBusId, uint32_t ID, uint32_t mask)
|
||||
void ISOTP_HANDLER::addFilter(int pBusId, uint32_t ID, uint32_t mask)
|
||||
{
|
||||
CANFilter filt;
|
||||
filt.ID = ID;
|
||||
@@ -366,7 +366,7 @@ void ISOTP_HANDLER::addFilter(uint32_t pBusId, uint32_t ID, uint32_t mask)
|
||||
filters.append(filt);
|
||||
}
|
||||
|
||||
void ISOTP_HANDLER::removeFilter(uint32_t pBusId, uint32_t ID, uint32_t mask)
|
||||
void ISOTP_HANDLER::removeFilter(int pBusId, uint32_t ID, uint32_t mask)
|
||||
{
|
||||
for (int i = 0; i < filters.count(); i++)
|
||||
{
|
||||
|
||||
@@ -22,8 +22,8 @@ public:
|
||||
void sendISOTPFrame(int bus, int ID, QByteArray data);
|
||||
void setProcessAll(bool state);
|
||||
void setFlowCtrl(bool state);
|
||||
void addFilter(uint32_t pBusId, uint32_t ID, uint32_t mask);
|
||||
void removeFilter(uint32_t pBusId, uint32_t ID, uint32_t mask);
|
||||
void addFilter(int pBusId, uint32_t ID, uint32_t mask);
|
||||
void removeFilter(int pBusId, uint32_t ID, uint32_t mask);
|
||||
void clearAllFilters();
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -326,7 +326,6 @@ QString UDS_HANDLER::getNegativeResponseLong(int respCode)
|
||||
QString UDS_HANDLER::getDetailedMessageAnalysis(const UDS_MESSAGE &msg)
|
||||
{
|
||||
QString buildString;
|
||||
bool isResponse = true;
|
||||
int dataSize;
|
||||
int addrSize;
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(msg.payload().constData());
|
||||
@@ -334,18 +333,15 @@ QString UDS_HANDLER::getDetailedMessageAnalysis(const UDS_MESSAGE &msg)
|
||||
|
||||
if (msg.isErrorReply)
|
||||
{
|
||||
isResponse = true;
|
||||
buildString.append("UDS ERROR Response\n");
|
||||
buildString.append("Service: " + getServiceLongDesc(msg.service) + "\n");
|
||||
}
|
||||
else if (msg.service < 0x3F || (msg.service > 0x7F && msg.service < 0xAF)) {
|
||||
isResponse = false;
|
||||
buildString.append("UDS Request\n");
|
||||
buildString.append("Service: " + getServiceLongDesc(msg.service) + "\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
isResponse = true;
|
||||
buildString.append("UDS Positive Response\n");
|
||||
buildString.append("Service: " + getServiceLongDesc(msg.service - 0x40) + "\n");
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@ public:
|
||||
CANBus();
|
||||
CANBus(const CANBus&);
|
||||
bool operator==(const CANBus&) const;
|
||||
virtual ~CANBus(){};
|
||||
CANBus& operator=(const CANBus& other) = default;
|
||||
//virtual ~CANBus(){}
|
||||
|
||||
int speed;
|
||||
bool listenOnly;
|
||||
|
||||
@@ -214,7 +214,7 @@ bool CANConManager::sendFrame(const CANFrame& pFrame)
|
||||
foreach (CANConnection* conn, mConns)
|
||||
{
|
||||
//check if this CAN connection is supposed to handle the requested bus
|
||||
if (pFrame.bus < (uint32_t)(busBase + conn->getNumBuses()))
|
||||
if (pFrame.bus < (busBase + conn->getNumBuses()))
|
||||
{
|
||||
workingFrame.bus -= busBase;
|
||||
workingFrame.isReceived = false;
|
||||
|
||||
@@ -8,8 +8,8 @@ CANConnection::CANConnection(QString pPort,
|
||||
int pNumBuses,
|
||||
int pQueueLen,
|
||||
bool pUseThread) :
|
||||
mQueue(),
|
||||
mNumBuses(pNumBuses),
|
||||
mQueue(),
|
||||
mPort(pPort),
|
||||
mDriver(pDriver),
|
||||
mType(pType),
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
#include "gvretserial.h"
|
||||
|
||||
GVRetSerial::GVRetSerial(QString portName, bool useTcp) :
|
||||
CANConnection(portName, "gvret", CANCon::GVRET_SERIAL, 3, 4000, true),
|
||||
useTcp(useTcp),
|
||||
mTimer(this) /*NB: set this as parent of timer to manage it from working thread */
|
||||
CANConnection(portName, "gvret", CANCon::GVRET_SERIAL, 3, 4000, true),
|
||||
mTimer(this), /*NB: set this as parent of timer to manage it from working thread */
|
||||
useTcp(useTcp)
|
||||
{
|
||||
sendDebug("GVRetSerial()");
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ protected:
|
||||
QUdpSocket *udpClient;
|
||||
int framesRapid;
|
||||
STATE rx_state;
|
||||
uint32_t rx_step;
|
||||
int rx_step;
|
||||
CANFrame buildFrame;
|
||||
qint64 buildTimestamp;
|
||||
quint32 buildId;
|
||||
|
||||
+3
-3
@@ -46,7 +46,7 @@ bool DBCSignalHandler::addSignal(DBC_SIGNAL &sig)
|
||||
|
||||
bool DBCSignalHandler::removeSignal(DBC_SIGNAL *sig)
|
||||
{
|
||||
Q_UNUSED(sig);
|
||||
Q_UNUSED(sig)
|
||||
//if (sigs.removeAll(*sig) > 0) return true;
|
||||
return false;
|
||||
}
|
||||
@@ -1698,7 +1698,7 @@ void DBCHandler::swapFiles(int pos1, int pos2)
|
||||
if (pos2 < 0) return;
|
||||
if (pos2 >= loadedFiles.count()) return;
|
||||
|
||||
loadedFiles.swap(pos1, pos2);
|
||||
loadedFiles.swapItemsAt(pos1, pos2);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1711,7 +1711,7 @@ DBC_MESSAGE* DBCHandler::findMessage(const CANFrame &frame)
|
||||
{
|
||||
for(int i = 0; i < loadedFiles.count(); i++)
|
||||
{
|
||||
if (loadedFiles[i].getAssocBus() == -1 || frame.bus == (unsigned int)loadedFiles[i].getAssocBus())
|
||||
if (loadedFiles[i].getAssocBus() == -1 || frame.bus == loadedFiles[i].getAssocBus())
|
||||
{
|
||||
DBC_MESSAGE* msg = loadedFiles[i].messageHandler->findMsgByID(frame.frameId());
|
||||
if (msg != nullptr) return msg;
|
||||
|
||||
@@ -270,6 +270,8 @@ void DBCLoadSaveWindow::editFile()
|
||||
|
||||
void DBCLoadSaveWindow::matchingCriteriaChanged(int index)
|
||||
{
|
||||
Q_UNUSED(index)
|
||||
|
||||
if (inhibitCellProcessing) return;
|
||||
// We don't know which combobox changed, so we just update all of them
|
||||
for (int row=0; row<ui->tableFiles->rowCount(); row++)
|
||||
@@ -312,7 +314,7 @@ void DBCLoadSaveWindow::cellChanged(int row, int col)
|
||||
{
|
||||
DBCFile *file = dbcHandler->getFileByIdx(row);
|
||||
int bus = ui->tableFiles->item(row, col)->text().toInt();
|
||||
int numBuses = CANConManager::getInstance()->getNumBuses();
|
||||
//int numBuses = CANConManager::getInstance()->getNumBuses();
|
||||
if (bus > -2)
|
||||
{
|
||||
file->setAssocBus(bus);
|
||||
|
||||
+16
-16
@@ -102,7 +102,7 @@ void DBCMainEditor::setFileIdx(int idx)
|
||||
|
||||
void DBCMainEditor::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
Q_UNUSED(event)
|
||||
writeSettings();
|
||||
sigEditor->close();
|
||||
}
|
||||
@@ -197,7 +197,7 @@ void DBCMainEditor::onCellChangedNode(int row,int col)
|
||||
if (dbcFile->findNodeByName(newName) != nullptr) //duplicates an existing node!
|
||||
{
|
||||
QMessageBox msg;
|
||||
msg.setParent(0);
|
||||
msg.setParent(nullptr);
|
||||
msg.setText("An existing node with that name already exists! Aborting!");
|
||||
msg.exec();
|
||||
return;
|
||||
@@ -275,7 +275,7 @@ void DBCMainEditor::onCellChangedMessage(int row,int col)
|
||||
if (msg != nullptr)
|
||||
{
|
||||
QMessageBox msg;
|
||||
msg.setParent(0);
|
||||
msg.setParent(nullptr);
|
||||
msg.setText("An existing msg with that ID already exists! Aborting!");
|
||||
msg.exec();
|
||||
|
||||
@@ -296,7 +296,7 @@ void DBCMainEditor::onCellChangedMessage(int row,int col)
|
||||
{
|
||||
if ((uint) referenceFrames->at(i).frameId() == msgID)
|
||||
{
|
||||
newMsg.len = referenceFrames->at(i).payload().length();
|
||||
newMsg.len = static_cast<unsigned int>(referenceFrames->at(i).payload().length());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -395,14 +395,14 @@ void DBCMainEditor::onCellClickedMessage(int row, int col)
|
||||
QTableWidgetItem* firstCol = ui->MessagesTable->item(row, 0);
|
||||
bool ret = false;
|
||||
DBC_MESSAGE *msg;
|
||||
int msgID;
|
||||
uint32_t msgID;
|
||||
|
||||
if (col == 3) //3 is the signals field. If clicked we go to the signals dialog
|
||||
{
|
||||
QTableWidgetItem* msg = ui->MessagesTable->item(row, 0);
|
||||
if(msg) {
|
||||
QString idString = msg->text();
|
||||
DBC_MESSAGE *message = dbcFile->messageHandler->findMsgByID(Utility::ParseStringToNum(idString));
|
||||
DBC_MESSAGE *message = dbcFile->messageHandler->findMsgByID(static_cast<uint32_t>(Utility::ParseStringToNum(idString)));
|
||||
sigEditor->setMessageRef(message);
|
||||
sigEditor->setFileIdx(fileIdx);
|
||||
sigEditor->setWindowModality(Qt::WindowModal);
|
||||
@@ -416,8 +416,8 @@ void DBCMainEditor::onCellClickedMessage(int row, int col)
|
||||
}
|
||||
if (col == 4)
|
||||
{
|
||||
QColor newColor = QColorDialog::getColor(thisItem->backgroundColor());
|
||||
thisItem->setBackgroundColor(newColor);
|
||||
QColor newColor = QColorDialog::getColor(thisItem->background().color());
|
||||
thisItem->setBackground(newColor);
|
||||
|
||||
if(!firstCol) return;
|
||||
|
||||
@@ -443,8 +443,8 @@ void DBCMainEditor::onCellClickedMessage(int row, int col)
|
||||
}
|
||||
if (col == 5)
|
||||
{
|
||||
QColor newColor = QColorDialog::getColor(thisItem->backgroundColor());
|
||||
thisItem->setBackgroundColor(newColor);
|
||||
QColor newColor = QColorDialog::getColor(thisItem->background().color());
|
||||
thisItem->setBackground(newColor);
|
||||
|
||||
if(!firstCol) return;
|
||||
|
||||
@@ -523,11 +523,11 @@ void DBCMainEditor::refreshMessagesTable(const DBC_NODE *node)
|
||||
QTableWidgetItem *msgLen = new QTableWidgetItem(QString::number(msg->len));
|
||||
QTableWidgetItem *msgSignals = new QTableWidgetItem(QString::number(msg->sigHandler->getCount()));
|
||||
QTableWidgetItem *fgColor = new QTableWidgetItem("");
|
||||
if (msg->fgColor.isValid()) fgColor->setBackgroundColor(msg->fgColor);
|
||||
else fgColor->setBackgroundColor(QColor(dbcFile->findAttributeByName("GenMsgForegroundColor")->defaultValue.toString()));
|
||||
if (msg->fgColor.isValid()) fgColor->setBackground(msg->fgColor);
|
||||
else fgColor->setBackground(QColor(dbcFile->findAttributeByName("GenMsgForegroundColor")->defaultValue.toString()));
|
||||
QTableWidgetItem *bgColor = new QTableWidgetItem("");
|
||||
if (msg->bgColor.isValid()) bgColor->setBackgroundColor(msg->bgColor);
|
||||
else bgColor->setBackgroundColor(QColor(dbcFile->findAttributeByName("GenMsgBackgroundColor")->defaultValue.toString()));
|
||||
if (msg->bgColor.isValid()) bgColor->setBackground(msg->bgColor);
|
||||
else bgColor->setBackground(QColor(dbcFile->findAttributeByName("GenMsgBackgroundColor")->defaultValue.toString()));
|
||||
|
||||
QTableWidgetItem *msgComment = new QTableWidgetItem(msg->comment);
|
||||
|
||||
@@ -558,8 +558,8 @@ void DBCMainEditor::insertBlankRow()
|
||||
for(int i=1 ; i < ui->MessagesTable->columnCount(); i++)
|
||||
{
|
||||
QTableWidgetItem *item = new QTableWidgetItem("");
|
||||
if (i == 4) item->setBackgroundColor(QApplication::palette().color(QPalette::WindowText)); //foreground color
|
||||
if (i == 5) item->setBackgroundColor(QApplication::palette().color(QPalette::Base));
|
||||
if (i == 4) item->setBackground(QApplication::palette().color(QPalette::WindowText)); //foreground color
|
||||
if (i == 5) item->setBackground(QApplication::palette().color(QPalette::Base));
|
||||
item->setFlags(item->flags() & ~Qt::ItemIsEditable);
|
||||
ui->MessagesTable->setItem(rowIdx, i, item);
|
||||
}
|
||||
|
||||
+2
-2
@@ -997,11 +997,11 @@ void JSEdit::updateSidebar()
|
||||
int maxLines = blockCount();
|
||||
for (int number = 10; number < maxLines; number *= 10)
|
||||
++digits;
|
||||
sw += fontMetrics().width('w') * digits;
|
||||
sw += fontMetrics().horizontalAdvance('w') * digits;
|
||||
}
|
||||
if (d->codeFolding) {
|
||||
int fh = fontMetrics().lineSpacing();
|
||||
int fw = fontMetrics().width('w');
|
||||
int fw = fontMetrics().horizontalAdvance('w');
|
||||
d->sidebar->foldIndicatorWidth = qMax(fw, fh);
|
||||
sw += d->sidebar->foldIndicatorWidth;
|
||||
}
|
||||
|
||||
+8
-8
@@ -849,14 +849,14 @@ void MainWindow::showGraphingWindow()
|
||||
{
|
||||
if (!graphingWindow) {
|
||||
graphingWindow = new GraphingWindow(model->getListReference());
|
||||
connect(graphingWindow, SIGNAL(sendCenterTimeID(int32_t,double)), this, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(this, SIGNAL(sendCenterTimeID(int32_t,double)), graphingWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(graphingWindow, SIGNAL(sendCenterTimeID(uint32_t,double)), this, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(this, SIGNAL(sendCenterTimeID(uint32_t,double)), graphingWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
}
|
||||
|
||||
if (flowViewWindow) //connect the two external windows together
|
||||
{
|
||||
connect(graphingWindow, SIGNAL(sendCenterTimeID(int32_t,double)), flowViewWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(flowViewWindow, SIGNAL(sendCenterTimeID(int32_t,double)), graphingWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(graphingWindow, SIGNAL(sendCenterTimeID(uint32_t,double)), flowViewWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(flowViewWindow, SIGNAL(sendCenterTimeID(uint32_t,double)), graphingWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
}
|
||||
graphingWindow->show();
|
||||
}
|
||||
@@ -1026,14 +1026,14 @@ void MainWindow::showFlowViewWindow()
|
||||
flowViewWindow = new FlowViewWindow(model->getListReference());
|
||||
else
|
||||
flowViewWindow = new FlowViewWindow(model->getFilteredListReference());
|
||||
connect(flowViewWindow, SIGNAL(sendCenterTimeID(int32_t,double)), this, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(this, SIGNAL(sendCenterTimeID(int32_t,double)), flowViewWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(flowViewWindow, SIGNAL(sendCenterTimeID(uint32_t,double)), this, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(this, SIGNAL(sendCenterTimeID(uint32_t,double)), flowViewWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
}
|
||||
|
||||
if (graphingWindow)
|
||||
{
|
||||
connect(graphingWindow, SIGNAL(sendCenterTimeID(int32_t,double)), flowViewWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(flowViewWindow, SIGNAL(sendCenterTimeID(int32_t,double)), graphingWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(graphingWindow, SIGNAL(sendCenterTimeID(uint32_t,double)), flowViewWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
connect(flowViewWindow, SIGNAL(sendCenterTimeID(uint32_t,double)), graphingWindow, SLOT(gotCenterTimeID(int32_t,double)));
|
||||
}
|
||||
|
||||
flowViewWindow->show();
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ signals:
|
||||
void framesUpdated(int numFrames); //something has updated the frame list (send at gui update frequency)
|
||||
void frameUpdateRapid(int numFrames);
|
||||
void settingsUpdated();
|
||||
void sendCenterTimeID(int32_t ID, double timestamp);
|
||||
void sendCenterTimeID(uint32_t ID, double timestamp);
|
||||
|
||||
private:
|
||||
Ui::MainWindow *ui;
|
||||
|
||||
@@ -51,9 +51,8 @@ MotorControllerConfigWindow::~MotorControllerConfigWindow()
|
||||
void MotorControllerConfigWindow::updatedFrames(int numFrames)
|
||||
{
|
||||
CANFrame thisFrame;
|
||||
int id;
|
||||
int param;
|
||||
QTableWidgetItem *item;
|
||||
uint32_t id;
|
||||
QTableWidgetItem *item = nullptr;
|
||||
if (numFrames == -1) //all frames deleted
|
||||
{
|
||||
|
||||
@@ -74,12 +73,12 @@ void MotorControllerConfigWindow::updatedFrames(int numFrames)
|
||||
{
|
||||
if ((char)thisFrame.payload()[2] == 0)
|
||||
{
|
||||
int paramID = thisFrame.payload()[0] + (thisFrame.payload()[1] * 256);
|
||||
uint32_t paramID = static_cast<uint32_t>(thisFrame.payload()[0] + (thisFrame.payload()[1] * 256));
|
||||
for (int i = 0; i < params.length(); i++)
|
||||
{
|
||||
if (params[i].paramID == paramID)
|
||||
{
|
||||
params[i].value = thisFrame.payload()[4] + (thisFrame.payload()[5] * 256);
|
||||
params[i].value = static_cast<uint16_t>(thisFrame.payload()[4] + (thisFrame.payload()[5] * 256));
|
||||
if (params[i].paramType == ASCII) item = new QTableWidgetItem(); //QString::fromUtf8((char *)params[i].value, 2));
|
||||
if (params[i].paramType == HEX) item = new QTableWidgetItem(Utility::formatHexNum(params[i].value));
|
||||
if (params[i].paramType == DEC)
|
||||
|
||||
+13
-13
@@ -36,7 +36,7 @@ void FileComparatorWindow::showEvent(QShowEvent *)
|
||||
|
||||
void FileComparatorWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
Q_UNUSED(event)
|
||||
writeSettings();
|
||||
}
|
||||
|
||||
@@ -118,8 +118,8 @@ void FileComparatorWindow::clearReference()
|
||||
|
||||
void FileComparatorWindow::calculateDetails()
|
||||
{
|
||||
QMap<int, FrameData> interestedIDs;
|
||||
QMap<int, FrameData> referenceIDs;
|
||||
QMap<uint32_t, FrameData> interestedIDs;
|
||||
QMap<uint32_t, FrameData> referenceIDs;
|
||||
QTreeWidgetItem *interestedOnlyBase, *referenceOnlyBase = nullptr, *sharedBase, *bitmapBaseInterested, *bitmapBaseReference = nullptr;
|
||||
QTreeWidgetItem *valuesBase, *detail, *sharedItem, *valuesInterested, *valuesReference = nullptr;
|
||||
uint64_t tmp;
|
||||
@@ -131,7 +131,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
QProgressDialog progress(this);
|
||||
progress.setWindowModality(Qt::WindowModal);
|
||||
progress.setLabelText("Calculating differences");
|
||||
progress.setCancelButton(0);
|
||||
progress.setCancelButton(nullptr);
|
||||
progress.setRange(0,0);
|
||||
progress.setMinimumDuration(0);
|
||||
progress.show();
|
||||
@@ -159,7 +159,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
|
||||
if (interestedIDs.contains(frame.frameId())) //if we saw this ID before then add to the QList in there
|
||||
{
|
||||
for (unsigned int y = 0; y < dataLen; y++)
|
||||
for (int y = 0; y < dataLen; y++)
|
||||
{
|
||||
interestedIDs[frame.frameId()].values[y][data[y]]++;
|
||||
tmp = data[y];
|
||||
@@ -184,7 +184,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
}
|
||||
}
|
||||
//memset(newData->values, 0, 256 * 8);
|
||||
for (unsigned int y = 0; y < dataLen; y++)
|
||||
for (int y = 0; y < dataLen; y++)
|
||||
{
|
||||
newData->values[y][data[y]] = 1;
|
||||
tmp = data[y];
|
||||
@@ -206,7 +206,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
|
||||
if (referenceIDs.contains(frame.frameId())) //if we saw this ID before then add to the QList in there
|
||||
{
|
||||
for (unsigned int y = 0; y < dataLen; y++)
|
||||
for (int y = 0; y < dataLen; y++)
|
||||
{
|
||||
referenceIDs[frame.frameId()].values[y][data[y]]++;
|
||||
tmp = data[y];
|
||||
@@ -229,7 +229,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
}
|
||||
}
|
||||
//memset(newData->values, 0, 256 * 8);
|
||||
for (unsigned int y = 0; y < dataLen; y++)
|
||||
for (int y = 0; y < dataLen; y++)
|
||||
{
|
||||
newData->values[y][data[y]] = 1;
|
||||
tmp = data[y];
|
||||
@@ -246,7 +246,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
//now we iterate through the IDs within both files and see which are unique to one file and which
|
||||
//are shared
|
||||
bool interestedHadUnique = false;
|
||||
QMap<int, FrameData>::iterator i;
|
||||
QMap<uint32_t, FrameData>::iterator i;
|
||||
int framesCounter = 0;
|
||||
for (i = interestedIDs.begin(); i != interestedIDs.end(); ++i)
|
||||
{
|
||||
@@ -257,7 +257,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
qApp->processEvents();
|
||||
}
|
||||
|
||||
int keyone = i.key();
|
||||
uint32_t keyone = i.key();
|
||||
if (!referenceIDs.contains(keyone))
|
||||
{
|
||||
valuesBase = new QTreeWidgetItem();
|
||||
@@ -324,7 +324,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
for (int j = 0; j < 256; j++)
|
||||
{
|
||||
detail = new QTreeWidgetItem();
|
||||
detail->setText(0, Utility::formatHexNum(j));
|
||||
detail->setText(0, Utility::formatHexNum(static_cast<unsigned int>(j)));
|
||||
if ((interested.values[i][j] > 0) && (reference.values[i][j] == 0) )
|
||||
{
|
||||
valuesInterested->addChild(detail);
|
||||
@@ -344,10 +344,10 @@ void FileComparatorWindow::calculateDetails()
|
||||
|
||||
if (!uniqueInterested)
|
||||
{
|
||||
QMap<int, FrameData>::iterator itwo;
|
||||
QMap<uint32_t, FrameData>::iterator itwo;
|
||||
for (itwo = referenceIDs.begin(); itwo != referenceIDs.end(); ++itwo)
|
||||
{
|
||||
int keytwo = itwo.key();
|
||||
unsigned int keytwo = itwo.key();
|
||||
if (!interestedIDs.contains(keytwo))
|
||||
{
|
||||
valuesBase = new QTreeWidgetItem();
|
||||
|
||||
@@ -14,7 +14,7 @@ class FileComparatorWindow;
|
||||
|
||||
struct FrameData
|
||||
{
|
||||
int ID;
|
||||
uint32_t ID;
|
||||
int dataLen;
|
||||
uint64_t bitmap;
|
||||
int values[8][256]; //first index is the data byte, second is # of times we saw that value
|
||||
|
||||
@@ -501,9 +501,8 @@ void FlowViewWindow::removeAllGraphs()
|
||||
void FlowViewWindow::createGraph(int byteNum)
|
||||
{
|
||||
int tempVal;
|
||||
float minval=1000000, maxval = -100000;
|
||||
double minval = 1000000.0, maxval = -100000.0;
|
||||
const unsigned char *data;
|
||||
int dataLen = 0;
|
||||
const CANFrame *frame;
|
||||
|
||||
qDebug() << "Create Graph " << byteNum;
|
||||
@@ -521,14 +520,13 @@ void FlowViewWindow::createGraph(int byteNum)
|
||||
{
|
||||
frame = &frameCache[j];
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().length();
|
||||
|
||||
tempVal = data[byteNum];
|
||||
|
||||
if (graphByTime)
|
||||
{
|
||||
if (secondsMode){
|
||||
x[byteNum][j] = (double)(frame->timeStamp().microSeconds()) / 1000000.0;
|
||||
x[byteNum][j] = frame->timeStamp().microSeconds() / 1000000.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ private slots:
|
||||
void gotCellClick(int x, int y);
|
||||
|
||||
signals:
|
||||
void sendCenterTimeID(int32_t ID, double timestamp);
|
||||
void sendCenterTimeID(uint32_t ID, double timestamp);
|
||||
|
||||
private:
|
||||
Ui::FlowViewWindow *ui;
|
||||
|
||||
+22
-22
@@ -244,10 +244,10 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
{
|
||||
int targettedID;
|
||||
int minLen, maxLen, thisLen;
|
||||
uint64_t avgInterval;
|
||||
uint64_t minInterval;
|
||||
uint64_t maxInterval;
|
||||
uint64_t thisInterval;
|
||||
int64_t avgInterval;
|
||||
int64_t minInterval;
|
||||
int64_t maxInterval;
|
||||
int64_t thisInterval;
|
||||
int minData[8];
|
||||
int maxData[8];
|
||||
int dataHistogram[256][8];
|
||||
@@ -377,8 +377,8 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
//qDebug() << referenceBits[c];
|
||||
}
|
||||
|
||||
std::vector<uint64_t> sortedIntervals;
|
||||
uint64_t intervalSum = 0;
|
||||
std::vector<int64_t> sortedIntervals;
|
||||
int64_t intervalSum = 0;
|
||||
|
||||
//then find all data points
|
||||
for (int j = 0; j < frameCache.count(); j++)
|
||||
@@ -387,7 +387,7 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
dataLen = frameCache.at(j).payload().length();
|
||||
|
||||
byteGraphX.append(j);
|
||||
for (uint32_t bytcnt = 0; bytcnt < dataLen; bytcnt++)
|
||||
for (int bytcnt = 0; bytcnt < dataLen; bytcnt++)
|
||||
{
|
||||
byteGraphY[bytcnt].append(data[bytcnt]);
|
||||
}
|
||||
@@ -429,7 +429,7 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
}
|
||||
|
||||
std::sort(sortedIntervals.begin(), sortedIntervals.end());
|
||||
uint64_t intervalStdDiv = 0, intervalPctl5 = 0, intervalPctl95 = 0, intervalMean = 0, intervalVariance = 0;
|
||||
int64_t intervalStdDiv = 0, intervalPctl5 = 0, intervalPctl95 = 0, intervalMean = 0, intervalVariance = 0;
|
||||
|
||||
int maxTimeCounter = -1;
|
||||
if (sortedIntervals.size() > 0)
|
||||
@@ -441,17 +441,17 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
}
|
||||
|
||||
intervalVariance /= sortedIntervals.size();
|
||||
intervalStdDiv = sqrt(intervalVariance);
|
||||
intervalStdDiv = static_cast<int>(sqrt(intervalVariance));
|
||||
|
||||
intervalPctl5 = sortedIntervals[floor(0.05 * sortedIntervals.size())];
|
||||
intervalPctl95 = sortedIntervals[floor(0.95 * sortedIntervals.size())];
|
||||
intervalPctl5 = sortedIntervals[static_cast<unsigned int>(floor(0.05 * sortedIntervals.size()))];
|
||||
intervalPctl95 = sortedIntervals[static_cast<unsigned int>(floor(0.95 * sortedIntervals.size()))];
|
||||
|
||||
uint64_t step = ceil((maxInterval - minInterval) / numIntervalHistBars);
|
||||
uint64_t step = static_cast<unsigned int>(ceil((maxInterval - minInterval) / numIntervalHistBars));
|
||||
qDebug() << "Step: " << step << " minInt: " << minInterval << " maxInt: " << maxInterval;
|
||||
int index = 0;
|
||||
unsigned int index = 0;
|
||||
int counter = 0;
|
||||
for(int l = 0; l <= numIntervalHistBars; l++) {
|
||||
uint64_t currentMax = maxInterval - ((numIntervalHistBars - l) * step); // avoid missing the biggest value due to rounding errors
|
||||
int64_t currentMax = maxInterval - ((numIntervalHistBars - l) * step); // avoid missing the biggest value due to rounding errors
|
||||
qDebug() << "CurrentMax: " << currentMax;
|
||||
while(index < sortedIntervals.size()) {
|
||||
if(sortedIntervals[index] <= currentMax) {
|
||||
@@ -483,22 +483,22 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
baseNode->addChild(tempItem);
|
||||
|
||||
tempItem = new QTreeWidgetItem();
|
||||
tempItem->setText(0, tr("Average inter-frame interval: ") + QString::number(avgInterval / 1000.0f) + "ms");
|
||||
tempItem->setText(0, tr("Average inter-frame interval: ") + QString::number(avgInterval / 1000.0) + "ms");
|
||||
baseNode->addChild(tempItem);
|
||||
tempItem = new QTreeWidgetItem();
|
||||
tempItem->setText(0, tr("Minimum inter-frame interval: ") + QString::number(minInterval / 1000.0f) + "ms");
|
||||
tempItem->setText(0, tr("Minimum inter-frame interval: ") + QString::number(minInterval / 1000.0) + "ms");
|
||||
baseNode->addChild(tempItem);
|
||||
tempItem = new QTreeWidgetItem();
|
||||
tempItem->setText(0, tr("Maximum inter-frame interval: ") + QString::number(maxInterval / 1000.0f) + "ms");
|
||||
tempItem->setText(0, tr("Maximum inter-frame interval: ") + QString::number(maxInterval / 1000.0) + "ms");
|
||||
baseNode->addChild(tempItem);
|
||||
tempItem = new QTreeWidgetItem();
|
||||
tempItem->setText(0, tr("Inter-frame interval variation: ") + QString::number((maxInterval - minInterval) / 1000.0f) + "ms");
|
||||
tempItem->setText(0, tr("Inter-frame interval variation: ") + QString::number((maxInterval - minInterval) / 1000.0) + "ms");
|
||||
baseNode->addChild(tempItem);
|
||||
tempItem = new QTreeWidgetItem();
|
||||
tempItem->setText(0, tr("Interval standard deviation: ") + QString::number(intervalStdDiv / 1000.0f) + "ms");
|
||||
tempItem->setText(0, tr("Interval standard deviation: ") + QString::number(intervalStdDiv / 1000.0) + "ms");
|
||||
baseNode->addChild(tempItem);
|
||||
tempItem = new QTreeWidgetItem();
|
||||
tempItem->setText(0, tr("Minimum range to fit 90% of inter-frame intervals: ") + QString::number((intervalPctl95 - intervalPctl5) / 1000.0f) + "ms");
|
||||
tempItem->setText(0, tr("Minimum range to fit 90% of inter-frame intervals: ") + QString::number((intervalPctl95 - intervalPctl5) / 1000.0) + "ms");
|
||||
baseNode->addChild(tempItem);
|
||||
for (int c = 0; c < maxLen; c++)
|
||||
{
|
||||
@@ -515,7 +515,7 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
dataBase->addChild(tempItem);
|
||||
|
||||
tempItem = new QTreeWidgetItem();
|
||||
tempItem->setText(0, tr("Range: ") + Utility::formatNumber((char)minData[c]) + tr(" to ") + Utility::formatNumber((char)maxData[c]));
|
||||
tempItem->setText(0, tr("Range: ") + Utility::formatNumber((unsigned int)minData[c]) + tr(" to ") + Utility::formatNumber((unsigned int)maxData[c]));
|
||||
dataBase->addChild(tempItem);
|
||||
histBase->setText(0, tr("Histogram"));
|
||||
dataBase->addChild(histBase);
|
||||
@@ -525,7 +525,7 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
if (dataHistogram[d][c] > 0)
|
||||
{
|
||||
tempItem = new QTreeWidgetItem();
|
||||
tempItem->setText(0, QString::number(d) + "/0x" + QString::number(d, 16) +" (" + Utility::formatByteAsBinary(d) +") -> " + QString::number(dataHistogram[d][c]));
|
||||
tempItem->setText(0, QString::number(d) + "/0x" + QString::number(d, 16) +" (" + Utility::formatByteAsBinary(static_cast<uint8_t>(d)) +") -> " + QString::number(dataHistogram[d][c]));
|
||||
histBase->addChild(tempItem);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ private slots:
|
||||
void zoomOut();
|
||||
|
||||
signals:
|
||||
void sendCenterTimeID(int32_t ID, double timestamp);
|
||||
void sendCenterTimeID(uint32_t ID, double timestamp);
|
||||
|
||||
private:
|
||||
Ui::GraphingWindow *ui;
|
||||
|
||||
Reference in New Issue
Block a user