Many little fixes to clean up warnings and bugs.

This commit is contained in:
Collin Kidder
2016-12-29 20:50:02 -05:00
parent beea680106
commit 7222870b1e
29 changed files with 69 additions and 60 deletions
+7 -5
View File
@@ -37,6 +37,7 @@ bool DBCSignalHandler::addSignal(DBC_SIGNAL &sig)
bool DBCSignalHandler::removeSignal(DBC_SIGNAL *sig)
{
Q_UNUSED(sig);
//if (sigs.removeAll(*sig) > 0) return true;
return false;
}
@@ -75,7 +76,7 @@ int DBCSignalHandler::getCount()
return sigs.count();
}
DBC_MESSAGE* DBCMessageHandler::findMsgByID(int id)
DBC_MESSAGE* DBCMessageHandler::findMsgByID(uint32_t id)
{
if (messages.count() == 0) return NULL;
for (int i = 0; i < messages.count(); i++)
@@ -117,6 +118,7 @@ bool DBCMessageHandler::addMessage(DBC_MESSAGE &msg)
bool DBCMessageHandler::removeMessage(DBC_MESSAGE *msg)
{
Q_UNUSED(msg);
//if (messages.removeAll(*msg) > 0) return true;
return false;
}
@@ -130,7 +132,7 @@ bool DBCMessageHandler::removeMessageByIndex(int idx)
return true;
}
bool DBCMessageHandler::removeMessage(int ID)
bool DBCMessageHandler::removeMessage(uint32_t ID)
{
bool foundSome = false;
if (messages.count() == 0) return false;
@@ -302,7 +304,7 @@ void DBCFile::loadFile(QString fileName)
{
int offset = 0;
bool isMultiplexor = false;
bool isMultiplexed = false;
//bool isMultiplexed = false;
DBC_SIGNAL sig;
sig.multiplexValue = 0;
@@ -326,7 +328,7 @@ void DBCFile::loadFile(QString fileName)
if (match.hasMatch())
{
qDebug() << "Multiplexed signal";
isMultiplexed = true;
//isMultiplexed = true;
sig.isMultiplexed = true;
sig.multiplexValue = match.captured(2).toInt();
offset = 1;
@@ -805,7 +807,7 @@ DBC_MESSAGE* DBCHandler::findMessage(const CANFrame &frame)
{
for(int i = 0; i < loadedFiles.count(); i++)
{
if (loadedFiles[i].getAssocBus() == -1 || frame.bus == loadedFiles[i].getAssocBus())
if (loadedFiles[i].getAssocBus() == -1 || frame.bus == (unsigned int)loadedFiles[i].getAssocBus())
{
DBC_MESSAGE* msg = loadedFiles[i].messageHandler->findMsgByID(frame.ID);
if (msg != NULL) return msg;
+2 -2
View File
@@ -32,13 +32,13 @@ class DBCMessageHandler: public QObject
{
Q_OBJECT
public:
DBC_MESSAGE *findMsgByID(int id);
DBC_MESSAGE *findMsgByID(uint32_t id);
DBC_MESSAGE *findMsgByIdx(int idx);
DBC_MESSAGE *findMsgByName(QString name);
bool addMessage(DBC_MESSAGE &msg);
bool removeMessage(DBC_MESSAGE *msg);
bool removeMessageByIndex(int idx);
bool removeMessage(int ID);
bool removeMessage(uint32_t ID);
bool removeMessage(QString name);
void removeAllMessages();
int getCount();
+1
View File
@@ -114,6 +114,7 @@ void DBCLoadSaveWindow::cellChanged(int row, int col)
void DBCLoadSaveWindow::cellDoubleClicked(int row, int col)
{
Q_UNUSED(col)
editorWindow->setFileIdx(row);
editorWindow->show();
}